From 4825d549dcbdc758602af8a83c5a465dbaac61f3 Mon Sep 17 00:00:00 2001 From: GabrielBarberini Date: Sat, 28 Oct 2023 02:58:17 -0300 Subject: [PATCH] implements MotorTankGeometry --- lib/models/motor.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/models/motor.py b/lib/models/motor.py index da3e4f2..4b84b84 100644 --- a/lib/models/motor.py +++ b/lib/models/motor.py @@ -28,10 +28,11 @@ class TankFluids(BaseModel, frozen=True): class MotorTankGeometry(BaseModel, TankGeometry): tank_geometry: dict = {(0, 5): 1} - def __init__(self, **data): - super().__init__(**data) - super(TankGeometry, self).__init__() - #super(TankGeometry, self).__setattr__("geometry", self.tank_geometry) + def __init__(self): + super().__init__() + attributes = vars(TankGeometry(geometry_dict=self.tank_geometry)) + for key, value in attributes.items(): + object.__setattr__(self, key, value) class MotorTank(BaseModel, frozen=True): #Required parameters