Skip to content

Commit 60a7aea

Browse files
committed
ENH: add sweep_angle to Fins model and refactor get_additional_parameters method
1 parent 25a8178 commit 60a7aea

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/models/sub/aerosurfaces.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,19 @@ class Fins(BaseModel):
4242
Tuple[List[Tuple[float, float]], Literal['radians', 'degrees']]
4343
] = None
4444
sweep_length: Optional[float] = None
45+
sweep_angle: Optional[float] = None
46+
47+
_base_keys = {"fins_kind", "name", "n", "root_chord", "span", "position"}
4548

4649
def get_additional_parameters(self):
47-
return {
48-
key: value
49-
for key, value in self.dict().items()
50-
if value is not None
51-
and key
52-
not in ["fins_kind", "name", "n", "root_chord", "span", "position"]
50+
params = {
51+
k: v for k, v in self.dict().items()
52+
if v is not None and k not in self._base_keys
5353
}
54+
if "sweep_angle" in params and "sweep_length" in params:
55+
params.pop("sweep_length")
56+
57+
return params
5458

5559

5660
# TODO: implement airbrakes

0 commit comments

Comments
 (0)