Skip to content

Commit 7620bcc

Browse files
authored
[ModelicaSystem] use items() if possible (#360)
1 parent 6b863ff commit 7620bcc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

OMPython/ModelicaSystem.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,7 @@ def simulate_cmd(
10591059
om_cmd.arg_set(key="overrideFile", val=override_file.as_posix())
10601060

10611061
if self._inputs: # if model has input quantities
1062-
for key in self._inputs:
1063-
val = self._inputs[key]
1062+
for key, val in self._inputs.items():
10641063
if val is None:
10651064
val = [(float(self._simulate_options["startTime"]), 0.0),
10661065
(float(self._simulate_options["stopTime"]), 0.0)]
@@ -1696,8 +1695,7 @@ def linearize(
16961695
om_cmd.arg_set(key="overrideFile", val=override_file.as_posix())
16971696

16981697
if self._inputs:
1699-
for key in self._inputs:
1700-
data = self._inputs[key]
1698+
for key, data in self._inputs.items():
17011699
if data is not None:
17021700
for value in data:
17031701
if value[0] < float(self._simulate_options["startTime"]):

0 commit comments

Comments
 (0)