Skip to content
Merged
Changes from all commits
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
9 changes: 7 additions & 2 deletions OMPython/ModelicaSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def __init__(
variableFilter: Optional[str] = None,
customBuildDirectory: Optional[str | os.PathLike] = None,
omhome: Optional[str] = None,
session: Optional[OMCSessionBase] = None
session: Optional[OMCSessionBase] = None,
build: Optional[bool] = True
):
"""Initialize, load and build a model.

Expand Down Expand Up @@ -146,6 +147,9 @@ def __init__(
session.
session: OMC session to be used. If unspecified, a new session
will be created.
build: Boolean controlling whether or not the model should be
built when constructor is called. If False, the constructor
simply loads the model without compiling.

Examples:
mod = ModelicaSystem("ModelicaModel.mo", "modelName")
Expand Down Expand Up @@ -217,7 +221,8 @@ def __init__(
elif fileName is None and modelName is not None:
self.loadLibrary(lmodel=self.lmodel)

self.buildModel(variableFilter)
if build:
self.buildModel(variableFilter)

def setCommandLineOptions(self, commandLineOptions: str):
# set commandLineOptions if provided by users
Expand Down
Loading