Skip to content

Commit b5cfef8

Browse files
committed
Merge remote-tracking branch 'origin/main' into julia-codegen
2 parents 27d385d + 9083787 commit b5cfef8

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414

1515
- repo: https://github.com/astral-sh/ruff-pre-commit
1616
# Ruff version.
17-
rev: 'v0.8.1'
17+
rev: 'v0.9.2'
1818
hooks:
1919
# Run the linter.
2020
- id: ruff
@@ -23,15 +23,15 @@ repos:
2323
- id: ruff-format
2424

2525
- repo: https://github.com/pre-commit/mirrors-mypy
26-
rev: v1.13.0
26+
rev: v1.14.1
2727
hooks:
2828
- id: mypy
2929
additional_dependencies: ["types-attrs"]
3030
files: ^src/|^tests/
3131
args: ["--config-file", "pyproject.toml"]
3232

3333
- repo: https://github.com/streetsidesoftware/cspell-cli
34-
rev: v8.16.0
34+
rev: v8.17.1
3535
hooks:
3636
- id: cspell
3737
files: src/|docs/(.+).md|tests|README.md|examples/(.+).py

src/gotranx/cli/gotran2c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def get_code(
5959
codegen.imports(),
6060
f"int NUM_STATES = {len(ode.states)};",
6161
f"int NUM_PARAMS = {len(ode.parameters)};",
62-
f"int NUM_MONITORED = { len(ode.state_derivatives) + len(ode.intermediates)};",
62+
f"int NUM_MONITORED = {len(ode.state_derivatives) + len(ode.intermediates)};",
6363
codegen.parameter_index(),
6464
codegen.state_index(),
6565
codegen.monitor_index(),

src/gotranx/exceptions.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ class StateNotFoundInComponent(GotranxError):
3434
component_name: str
3535

3636
def __str__(self) -> str:
37-
return (
38-
f"State with name {self.state_name!r} "
39-
f"not found in component {self.component_name!r}"
40-
)
37+
return f"State with name {self.state_name!r} not found in component {self.component_name!r}"
4138

4239

4340
@dataclass

src/gotranx/sympytools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def Conditional(cond, true_value, false_value):
9191

9292
if not isinstance(cond, (Relational, Boolean)):
9393
raise TypeError(
94-
"Cond %s is of type %s, but must be a Relational" " or Boolean." % (cond, type(cond)),
94+
"Cond %s is of type %s, but must be a Relational or Boolean." % (cond, type(cond)),
9595
)
9696

9797
return sympy.functions.Piecewise(
@@ -124,7 +124,7 @@ def ContinuousConditional(cond, true_value, false_value, sigma=1.0):
124124
# FIXME: in latest sympy making comparison difficult
125125
if "<" not in cond.rel_op and ">" not in cond.rel_op:
126126
TypeError(
127-
"Expected a lesser or greater than relational for " "a continuous conditional .",
127+
"Expected a lesser or greater than relational for a continuous conditional .",
128128
)
129129

130130
# Create Heaviside

tests/test_ode_component.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_component_with_multiple_component_names(
8686

8787
def test_component_intermediates(parser, trans):
8888
tree = parser.parse(
89-
("parameters(x=1, y=2)\n" "states(a=2, b=3)\n" "da_dt=0\n" "c=a+b\n" "db_dt=c - a"),
89+
("parameters(x=1, y=2)\nstates(a=2, b=3)\nda_dt=0\nc=a+b\ndb_dt=c - a"),
9090
)
9191
result = trans.transform(tree)
9292
comp = result.components[0]

0 commit comments

Comments
 (0)