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
Update version
  • Loading branch information
adeas31 committed Dec 26, 2025
commit 7e9a14473db28b8e1b34767c74607364ea928230
15 changes: 8 additions & 7 deletions OMPython/ModelicaSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ def __init__(
else:
self._session = OMCSessionLocal(omhome=omhome)

# get OpenModelica version
self._version = self._session.sendExpression("getVersion()", parsed=True)
# set commandLineOptions using default values or the user defined list
if command_line_options is None:
# set default command line options to improve the performance of linearization and to avoid recompilation if
Expand Down Expand Up @@ -1074,12 +1076,11 @@ def simulate_cmd(
if self._override_variables or self._simulate_options_override:
override_file = result_file.parent / f"{result_file.stem}_override.txt"

# simulation options are not read from override file from version > 1.25.0,
# simulation options are not read from override file from version >= 1.26.0,
# pass them to simulation executable directly as individual arguments
# see https://github.com/OpenModelica/OpenModelica/pull/14813
version = self._session.sendExpression("getVersion()", parsed=True)
major, minor, patch = self.parse_om_version(version)
if (major, minor, patch) > (1, 25, 0):
major, minor, patch = self.parse_om_version(self._version)
if (major, minor, patch) >= (1, 26, 0):
for key, opt_value in self._simulate_options_override.items():
om_cmd.arg_set(key=key, val=str(opt_value))
override_content = (
Expand Down Expand Up @@ -1774,9 +1775,9 @@ def linearize(
modelname=self._model_name,
)

version = self._session.sendExpression("getVersion()", parsed=True)
major, minor, patch = self.parse_om_version(version)
if (major, minor, patch) > (1, 25, 0):
# See comment in simulate_cmd regarding override file and OM version
major, minor, patch = self.parse_om_version(self._version)
if (major, minor, patch) >= (1, 26, 0):
for key, opt_value in self._linearization_options.items():
om_cmd.arg_set(key=key, val=str(opt_value))
override_content = (
Expand Down