Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[ModelicaSystem.simulate_cmd] fix result_file handling
* rename resultfile => result_file
* use local variable result_file and not self._result_file
  • Loading branch information
syntron committed Jul 9, 2025
commit cc44b7913a3ea9a29abb2cbeffb3cdfd014e5be2
10 changes: 5 additions & 5 deletions OMPython/ModelicaSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ def getOptimizationOptions(self, names: Optional[str | list[str]] = None) -> dic

def simulate_cmd(
self,
resultfile: pathlib.Path,
result_file: pathlib.Path,
simflags: Optional[str] = None,
simargs: Optional[dict[str, Optional[str | dict[str, str]]]] = None,
timeout: Optional[float] = None,
Expand All @@ -933,7 +933,7 @@ def simulate_cmd(

Parameters
----------
resultfile
result_file
simflags
simargs
timeout
Expand All @@ -946,7 +946,7 @@ def simulate_cmd(
om_cmd = ModelicaSystemCmd(runpath=self._tempdir, modelname=self._model_name, timeout=timeout)

# always define the result file to use
om_cmd.arg_set(key="r", val=resultfile.as_posix())
om_cmd.arg_set(key="r", val=result_file.as_posix())

# allow runtime simulation flags from user input
if simflags is not None:
Expand All @@ -968,7 +968,7 @@ def simulate_cmd(

if self._has_inputs: # if model has input quantities
# csvfile is based on name used for result file
csvfile = self._result_file.parent / f"{self._result_file.stem}.csv"
csvfile = result_file.parent / f"{result_file.stem}.csv"

for i in self._inputs:
val = self._inputs[i]
Expand Down Expand Up @@ -1023,7 +1023,7 @@ def simulate(
self._result_file = self._tempdir / resultfile

om_cmd = self.simulate_cmd(
resultfile=self._result_file,
result_file=self._result_file,
simflags=simflags,
simargs=simargs,
timeout=timeout,
Expand Down