Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
luca7084 committed Aug 24, 2023
1 parent f65ff89 commit ae08793
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,6 @@ $RECYCLE.BIN/
**.html

# Command sequences
*.fmu
#*.fmu

# End of https://www.gitignore.io/api/git,linux,macos,python,windows,pycharm,jupyternotebook
2 changes: 1 addition & 1 deletion rocket_twin/systems/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
StageControllerCoSApp,
StageControllerFMU,
StationControllerCoSApp,
StationControllerFMU
StationControllerFMU,
)
from rocket_twin.systems.engine import Engine, EngineGeom, EnginePerfo
from rocket_twin.systems.ground import Ground
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion rocket_twin/systems/control/stage_controller.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ equation
else
w = 0.;
end if;
end stage_controller;
end stage_controller;
Binary file not shown.
4 changes: 2 additions & 2 deletions rocket_twin/systems/control/stage_controller_fmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def setup(self, model_path, model_name):
fmu_path = self.create_fmu(model_path, model_name)
self.add_child(
FMUSystem("fmu_controller", fmu_path=fmu_path),
pulling=['is_on', 'w'],
pulling=["is_on", "w"],
)

self.add_event("full", trigger="weight_prop == weight_max")
Expand Down Expand Up @@ -74,4 +74,4 @@ def create_fmu(self, model_path, model_name):
if filename != (model_name + ".fmu"):
os.remove(filename)

return fmu
return fmu
2 changes: 1 addition & 1 deletion rocket_twin/systems/control/station_controller.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ equation
else
w = 0.;
end if;
end station_controller;
end station_controller;
Binary file not shown.
4 changes: 2 additions & 2 deletions rocket_twin/systems/control/station_controller_fmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def setup(self, model_path, model_name):
fmu_path = self.create_fmu(model_path, model_name)
self.add_child(
FMUSystem("fmu_controller", fmu_path=fmu_path),
pulling=['fueling', 'w'],
pulling=["fueling", "w"],
)

def create_fmu(self, model_path, model_name):
Expand Down Expand Up @@ -64,4 +64,4 @@ def create_fmu(self, model_path, model_name):
if filename != (model_name + ".fmu"):
os.remove(filename)

return fmu
return fmu
2 changes: 1 addition & 1 deletion rocket_twin/systems/rocket/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def setup(self, n_stages=1):
self.add_child(
RocketControllerCoSApp("controller", n_stages=n_stages),
execution_index=0,
pulling=["flying"]
pulling=["flying"],
)
self.add_child(OCCGeometry("geom", shapes=shapes, properties=properties))
self.add_child(Dynamics("dyn", forces=forces, weights=["weight_rocket"]), pulling=["a"])
Expand Down
1 change: 1 addition & 0 deletions rocket_twin/tests/test_controller_cosapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class TestControllerCosapp:
"""Tests for the cosapp controller."""

def test_run_once(self):

sys = Station("sys", n_stages=3)
Expand Down
10 changes: 8 additions & 2 deletions rocket_twin/tests/test_controller_fmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
from cosapp.recorders import DataFrameRecorder
from cosapp.utils import swap_system

from rocket_twin.systems import StageControllerFMU, StationControllerFMU, RocketControllerFMU, Station
from rocket_twin.systems import (
RocketControllerFMU,
StageControllerFMU,
Station,
StationControllerFMU,
)


class TestControllerFMU:
"""Tests for the FMU controller."""

def test_controller_fmu(self):

n_stages = 3
Expand Down Expand Up @@ -38,7 +44,7 @@ def test_controller_fmu(self):
StageControllerFMU("controller", model_path=model_path_s, model_name=model_name_s),
)

driver = sys.add_driver(RungeKutta(order=4, time_interval=[0, 35], dt=1.))
driver = sys.add_driver(RungeKutta(order=4, time_interval=[0, 35], dt=1.0))
driver.add_child(NonLinearSolver("solver"))
init = {
"g_tank.fuel.weight_p": 20.0,
Expand Down
2 changes: 1 addition & 1 deletion rocket_twin/tests/test_drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TestDrivers:
sys = Station("sys")

def test_fuel(self):
dt = 1.
dt = 1.0

init = {
"rocket.stage_1.tank.fuel.weight_p": 0.0,
Expand Down
1 change: 1 addition & 0 deletions rocket_twin/tests/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class TestEngine:
"""Tests for the engine model."""

def test_run_once(self):
sys = Engine("sys")

Expand Down
1 change: 1 addition & 0 deletions rocket_twin/tests/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

class TestGeometry:
"""Tests for the geometry model."""

def test_structure(self):

sys = OCCGeometry("sys", shapes=["cylinder_s", "cone_s"], properties=["cylinder", "cone"])
Expand Down
2 changes: 1 addition & 1 deletion rocket_twin/tests/test_mission.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TestMission:

def test_run_once(self):
sys = Station("sys")
dt = 1.
dt = 1.0

init = {
"rocket.stage_1.tank.fuel.weight_p": 0.0,
Expand Down
1 change: 1 addition & 0 deletions rocket_twin/tests/test_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class TestStation:
"""Tests for the station model."""

def test_run_once(self):
sys = Station("sys")

Expand Down

0 comments on commit ae08793

Please sign in to comment.