Skip to content

Commit 2802d9f

Browse files
committed
[ModelicaSystem.linearize] fix mypy
1 parent 191cd59 commit 2802d9f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

OMPython/ModelicaSystem.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,12 +1495,13 @@ def linearize(self, lintime: Optional[float] = None, simflags: Optional[str] = N
14951495
linear_data = {}
14961496
linear_file_content = linear_file.read_text()
14971497
try:
1498+
# ignore possible typing errors below (mypy) - these are catched by the try .. except .. block
14981499
linear_file_ast = ast.parse(linear_file_content)
1499-
for body_part in linear_file_ast.body[0].body:
1500+
for body_part in linear_file_ast.body[0].body: # type: ignore
15001501
if not isinstance(body_part, ast.Assign):
15011502
continue
15021503

1503-
target = body_part.targets[0].id
1504+
target = body_part.targets[0].id # type: ignore
15041505
value = ast.literal_eval(body_part.value)
15051506

15061507
linear_data[target] = value

0 commit comments

Comments
 (0)