Skip to content

Commit 84e01d6

Browse files
committed
[ModelicaSystem] rename variables: commandLineOptions => command_line
1 parent a169cbc commit 84e01d6

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,15 @@ def parse_simflags(simflags: str) -> dict[str, Optional[str | dict[str, Any] | n
325325
class ModelicaSystem:
326326
def __init__(
327327
self,
328-
commandLineOptions: Optional[list[str]] = None,
328+
command_line: Optional[list[str]] = None,
329329
customBuildDirectory: Optional[str | os.PathLike] = None,
330330
omhome: Optional[str] = None,
331331
omc_process: Optional[OMCProcess] = None,
332332
) -> None:
333333
"""Create a ModelicaSystem instance. To define the model use model() or convertFmu2Mo().
334334
335335
Args:
336-
commandLineOptions: List with extra command line options as elements. The list elements are
336+
command_line: List with extra command line options as elements. The list elements are
337337
provided to omc via setCommandLineOptions(). If set, the default values will be overridden.
338338
To disable any command line options, use an empty list.
339339
customBuildDirectory: Path to a directory to be used for temporary
@@ -367,14 +367,14 @@ def __init__(
367367
self._session = OMCSessionZMQ(omhome=omhome)
368368

369369
# set commandLineOptions using default values or the user defined list
370-
if commandLineOptions is None:
370+
if command_line is None:
371371
# set default command line options to improve the performance of linearization and to avoid recompilation if
372372
# the simulation executable is reused in linearize() via the runtime flag '-l'
373-
commandLineOptions = [
373+
command_line = [
374374
"--linearizationDumpLanguage=python",
375375
"--generateSymbolicLinearization",
376376
]
377-
for opt in commandLineOptions:
377+
for opt in command_line:
378378
self.setCommandLineOptions(commandLineOptions=opt)
379379

380380
self._simulated = False # True if the model has already been simulated
@@ -1947,7 +1947,7 @@ def __init__(
19471947
raise ModelicaSystemError("No model name provided!")
19481948

19491949
self._mod = ModelicaSystem(
1950-
commandLineOptions=commandLineOptions,
1950+
command_line=commandLineOptions,
19511951
customBuildDirectory=customBuildDirectory,
19521952
omhome=omhome,
19531953
omc_process=omc_process,

tests/test_FMIImport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_FMIImport(model_firstorder):
3333

3434
# import FMU & check & simulate
3535
# TODO: why is '--allowNonStandardModelica=reinitInAlgorithms' needed? any example without this possible?
36-
mod2 = OMPython.ModelicaSystem(commandLineOptions=['--allowNonStandardModelica=reinitInAlgorithms'])
36+
mod2 = OMPython.ModelicaSystem(command_line=['--allowNonStandardModelica=reinitInAlgorithms'])
3737
mo = mod2.convertFmu2Mo(fmu=fmu)
3838
assert os.path.exists(mo)
3939

0 commit comments

Comments
 (0)