Skip to content

Commit 63475c7

Browse files
committed
[ModelicaSystem] replace pathlib by OMCPath
1 parent 904b292 commit 63475c7

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,17 +1154,14 @@ def plot(
11541154
raise ModelicaSystemError("Plot is using the OMC plot functionality; "
11551155
"thus, it is only working if OMC is running locally!")
11561156

1157-
plot_result_file = None
11581157
if resultfile is not None:
1159-
plot_result_file = pathlib.Path(resultfile)
1158+
plot_result_file = self._getconn.omcpath(resultfile)
11601159
elif self._result_file is not None:
1161-
plot_result_file = pathlib.Path(self._result_file)
1160+
plot_result_file = self._result_file
11621161
else:
11631162
raise ModelicaSystemError("No resultfile available - either run simulate() before plotting "
11641163
"or provide a result file!")
11651164

1166-
if plot_result_file is None:
1167-
raise ModelicaSystemError("No resultfile defined!")
11681165
if not plot_result_file.is_file():
11691166
raise ModelicaSystemError(f"Provided resultfile {repr(plot_result_file.as_posix())} does not exists!")
11701167

0 commit comments

Comments
 (0)