Skip to content

Commit fb8c266

Browse files
committed
fix flake8 E501 - line too long
1 parent ee53a6e commit fb8c266

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

OMPython/ModelicaSystem.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,8 @@ def getSimulationOptions(self, names: Optional[str | list[str]] = None) -> dict[
911911
912912
Examples:
913913
>>> mod.getSimulationOptions()
914-
{'startTime': '0', 'stopTime': '1.234', 'stepSize': '0.002', 'tolerance': '1.1e-08', 'solver': 'dassl', 'outputFormat': 'mat'}
914+
{'startTime': '0', 'stopTime': '1.234',
915+
'stepSize': '0.002', 'tolerance': '1.1e-08', 'solver': 'dassl', 'outputFormat': 'mat'}
915916
>>> mod.getSimulationOptions("stopTime")
916917
['1.234']
917918
>>> mod.getSimulationOptions(["tolerance", "stopTime"])
@@ -1095,8 +1096,10 @@ def simulate(
10951096
Examples:
10961097
mod.simulate()
10971098
mod.simulate(resultfile="a.mat")
1098-
mod.simulate(simflags="-noEventEmit -noRestart -override=e=0.3,g=10") # set runtime simulation flags, deprecated
1099-
mod.simulate(simargs={"noEventEmit": None, "noRestart": None, "override": "override": {"e": 0.3, "g": 10}}) # using simargs
1099+
# set runtime simulation flags, deprecated
1100+
mod.simulate(simflags="-noEventEmit -noRestart -override=e=0.3,g=10")
1101+
# using simargs
1102+
mod.simulate(simargs={"noEventEmit": None, "noRestart": None, "override": "override": {"e": 0.3, "g": 10}})
11001103
"""
11011104

11021105
if resultfile is None:
@@ -1132,7 +1135,11 @@ def simulate(
11321135

11331136
self._simulated = True
11341137

1135-
def getSolutions(self, varList: Optional[str | list[str]] = None, resultfile: Optional[str] = None) -> tuple[str] | np.ndarray:
1138+
def getSolutions(
1139+
self,
1140+
varList: Optional[str | list[str]] = None,
1141+
resultfile: Optional[str] = None,
1142+
) -> tuple[str] | np.ndarray:
11361143
"""Extract simulation results from a result data file.
11371144
11381145
Args:
@@ -1357,7 +1364,8 @@ def setSimulationOptions(
13571364
) -> bool:
13581365
"""
13591366
This method is used to set simulation options. It can be called:
1360-
with a sequence of simulation options name and assigning corresponding values as arguments as show in the example below:
1367+
with a sequence of simulation options name and assigning corresponding values as arguments as show in the
1368+
example below:
13611369
usage
13621370
>>> setSimulationOptions("Name=value") # depreciated
13631371
>>> setSimulationOptions(["Name1=value1","Name2=value2"]) # depreciated
@@ -1377,7 +1385,8 @@ def setLinearizationOptions(
13771385
) -> bool:
13781386
"""
13791387
This method is used to set linearization options. It can be called:
1380-
with a sequence of linearization options name and assigning corresponding value as arguments as show in the example below
1388+
with a sequence of linearization options name and assigning corresponding value as arguments as show in the
1389+
example below
13811390
usage
13821391
>>> setLinearizationOptions("Name=value") # depreciated
13831392
>>> setLinearizationOptions(["Name1=value1","Name2=value2"]) # depreciated
@@ -1397,7 +1406,8 @@ def setOptimizationOptions(
13971406
) -> bool:
13981407
"""
13991408
This method is used to set optimization options. It can be called:
1400-
with a sequence of optimization options name and assigning corresponding values as arguments as show in the example below:
1409+
with a sequence of optimization options name and assigning corresponding values as arguments as show in the
1410+
example below:
14011411
usage
14021412
>>> setOptimizationOptions("Name=value") # depreciated
14031413
>>> setOptimizationOptions(["Name1=value1","Name2=value2"]) # depreciated
@@ -1530,7 +1540,8 @@ def convertMo2Fmu(self, version: str = "2.0", fmuType: str = "me_cs",
15301540
Examples:
15311541
>>> mod.convertMo2Fmu()
15321542
'/tmp/tmpmhfx9umo/CauerLowPassAnalog.fmu'
1533-
>>> mod.convertMo2Fmu(version="2.0", fmuType="me|cs|me_cs", fileNamePrefix="<default>", includeResources=True)
1543+
>>> mod.convertMo2Fmu(version="2.0", fmuType="me|cs|me_cs", fileNamePrefix="<default>",
1544+
includeResources=True)
15341545
'/tmp/tmpmhfx9umo/CauerLowPassAnalog.fmu'
15351546
"""
15361547

@@ -1553,7 +1564,8 @@ def convertMo2Fmu(self, version: str = "2.0", fmuType: str = "me_cs",
15531564
# to convert FMU to Modelica model
15541565
def convertFmu2Mo(self, fmuName): # 20
15551566
"""
1556-
In order to load FMU, at first it needs to be translated into Modelica model. This method is used to generate Modelica model from the given FMU. It generates "fmuName_me_FMU.mo".
1567+
In order to load FMU, at first it needs to be translated into Modelica model. This method is used to generate
1568+
Modelica model from the given FMU. It generates "fmuName_me_FMU.mo".
15571569
Currently, it only supports Model Exchange conversion.
15581570
usage
15591571
>>> convertFmu2Mo("c:/BouncingBall.Fmu")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ Issues = "https://github.com/OpenModelica/OMPython/issues"
3434
Download = "https://pypi.org/project/OMPython/#files"
3535

3636
[tool.flake8]
37+
max-line-length = 120
3738
extend-ignore = [
38-
'E501', # line too long
3939
]

0 commit comments

Comments
 (0)