Skip to content

Commit 033e3a8

Browse files
committed
use keyword arguments if possible (FKA100 - flake8-force-keyword-arguments)
1 parent 5b10515 commit 033e3a8

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

OMPython/ModelicaSystem.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,10 @@ def parse_simflags(simflags: str) -> dict[str, Optional[str | dict[str, Any] | n
291291
292292
The return data can be used as input for self.args_set().
293293
"""
294-
warnings.warn("The argument 'simflags' is depreciated and will be removed in future versions; "
295-
"please use 'simargs' instead", DeprecationWarning, stacklevel=2)
294+
warnings.warn(message="The argument 'simflags' is depreciated and will be removed in future versions; "
295+
"please use 'simargs' instead",
296+
category=DeprecationWarning,
297+
stacklevel=2)
296298

297299
simargs: dict[str, Optional[str | dict[str, Any] | numbers.Number]] = {}
298300

@@ -585,7 +587,7 @@ def buildModel(self, variableFilter: Optional[str] = None):
585587

586588
def sendExpression(self, expr: str, parsed: bool = True) -> Any:
587589
try:
588-
retval = self._session.sendExpression(expr, parsed)
590+
retval = self._session.sendExpression(command=expr, parsed=parsed)
589591
except OMCSessionException as ex:
590592
raise ModelicaSystemError(f"Error executing {repr(expr)}: {ex}") from ex
591593

@@ -1612,9 +1614,9 @@ def _createCSVData(self, csvfile: Optional[OMCPath] = None) -> OMCPath:
16121614
for signal_name, signal_values in inputs.items():
16131615
signal = np.array(signal_values)
16141616
interpolated_inputs[signal_name] = np.interp(
1615-
all_times,
1616-
signal[:, 0], # times
1617-
signal[:, 1], # values
1617+
x=all_times,
1618+
xp=signal[:, 0], # times
1619+
fp=signal[:, 1], # values
16181620
)
16191621

16201622
# Write CSV file

OMPython/OMCSession.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,10 @@ def run_model_executable(cmd_run_data: OMCSessionRunData) -> int:
848848
return returncode
849849

850850
def execute(self, command: str):
851-
warnings.warn("This function is depreciated and will be removed in future versions; "
852-
"please use sendExpression() instead", DeprecationWarning, stacklevel=2)
851+
warnings.warn(message="This function is depreciated and will be removed in future versions; "
852+
"please use sendExpression() instead",
853+
category=DeprecationWarning,
854+
stacklevel=2)
853855

854856
return self.sendExpression(command, parsed=False)
855857

0 commit comments

Comments
 (0)