Skip to content

Commit 170f219

Browse files
committed
ruff
1 parent 0956c55 commit 170f219

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

petab/v1/models/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
from .model import Model # noqa F401
1717

1818
__all__ = [
19-
"MODEL_TYPE_SBML",
20-
"MODEL_TYPE_PYSB",
2119
"MODEL_TYPE_BNGL",
22-
"known_model_types",
20+
"MODEL_TYPE_PYSB",
21+
"MODEL_TYPE_SBML",
2322
"Model",
23+
"known_model_types",
2424
]

petab/v1/models/bngl_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from . import MODEL_TYPE_BNGL
3838
from .model import Model
3939

40-
__all__ = ["BnglModel", "BnglEntities", "parse_bngl"]
40+
__all__ = ["BnglEntities", "BnglModel", "parse_bngl"]
4141

4242
#: The three keywords that open an observable declaration line.
4343
_OBS_KEYWORDS = frozenset({"Molecules", "Species", "Counter"})
@@ -379,6 +379,7 @@ def is_valid(self) -> bool:
379379
text=True,
380380
timeout=120,
381381
cwd=str(path.parent),
382+
check=False,
382383
)
383384
except (OSError, subprocess.SubprocessError):
384385
# A tooling hiccup must not masquerade as an invalid model.

petab/v2/models/bngl_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Functions for handling BNGL models"""
22

3-
from ...v1.models.bngl_model import * # noqa: F401, F403
3+
from ...v1.models.bngl_model import *

tests/v1/test_bngl_corpus.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ def _strip_to_model(text):
132132
out, stack = [], []
133133
for line in text.splitlines():
134134
s = line.split("#", 1)[0].strip()
135-
begin = re.match(r"begin\s+(.+)", s, re.I)
136-
end = re.match(r"end\s+(.+)", s, re.I)
135+
begin = re.match(r"begin\s+(.+)", s, re.IGNORECASE)
136+
end = re.match(r"end\s+(.+)", s, re.IGNORECASE)
137137
if begin:
138138
stack.append(begin.group(1).strip().lower())
139139
if stack[-1] != "actions":
@@ -157,6 +157,7 @@ def _canonical_bngl(model_text, bng2):
157157
capture_output=True,
158158
text=True,
159159
timeout=120,
160+
check=False,
160161
)
161162
canon = Path(work) / "canon.bngl"
162163
if result.returncode != 0 or not canon.is_file():

0 commit comments

Comments
 (0)