Skip to content

Commit be89d52

Browse files
committed
[ModelicaSystem] simplify code; additional compatibility layer NOT needed!
1 parent b20568b commit be89d52

File tree

1 file changed

+1
-49
lines changed

1 file changed

+1
-49
lines changed

OMPython/ModelicaSystem.py

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import os
88
import pathlib
99
import platform
10-
from typing import Any, Optional
10+
from typing import Optional
1111

1212
import numpy as np
1313

@@ -67,54 +67,6 @@ def __init__(
6767
def setCommandLineOptions(self, commandLineOptions: str):
6868
super().set_command_line_options(command_line_option=commandLineOptions)
6969

70-
def setContinuous( # type: ignore[override]
71-
self,
72-
cvals: str | list[str] | dict[str, Any],
73-
) -> bool:
74-
if isinstance(cvals, dict):
75-
return super().setContinuous(**cvals)
76-
raise ModelicaSystemError("Only dict input supported for setContinuous()")
77-
78-
def setParameters( # type: ignore[override]
79-
self,
80-
pvals: str | list[str] | dict[str, Any],
81-
) -> bool:
82-
if isinstance(pvals, dict):
83-
return super().setParameters(**pvals)
84-
raise ModelicaSystemError("Only dict input supported for setParameters()")
85-
86-
def setOptimizationOptions( # type: ignore[override]
87-
self,
88-
optimizationOptions: str | list[str] | dict[str, Any],
89-
) -> bool:
90-
if isinstance(optimizationOptions, dict):
91-
return super().setOptimizationOptions(**optimizationOptions)
92-
raise ModelicaSystemError("Only dict input supported for setOptimizationOptions()")
93-
94-
def setInputs( # type: ignore[override]
95-
self,
96-
name: str | list[str] | dict[str, Any],
97-
) -> bool:
98-
if isinstance(name, dict):
99-
return super().setInputs(**name)
100-
raise ModelicaSystemError("Only dict input supported for setInputs()")
101-
102-
def setSimulationOptions( # type: ignore[override]
103-
self,
104-
simOptions: str | list[str] | dict[str, Any],
105-
) -> bool:
106-
if isinstance(simOptions, dict):
107-
return super().setSimulationOptions(**simOptions)
108-
raise ModelicaSystemError("Only dict input supported for setSimulationOptions()")
109-
110-
def setLinearizationOptions( # type: ignore[override]
111-
self,
112-
linearizationOptions: str | list[str] | dict[str, Any],
113-
) -> bool:
114-
if isinstance(linearizationOptions, dict):
115-
return super().setLinearizationOptions(**linearizationOptions)
116-
raise ModelicaSystemError("Only dict input supported for setLinearizationOptions()")
117-
11870
def getContinuous(
11971
self,
12072
names: Optional[str | list[str]] = None,

0 commit comments

Comments
 (0)