Skip to content

Commit 903491f

Browse files
documents possible motors and rockets
1 parent d042007 commit 903491f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

lib/models/motor.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
from typing import Optional, Tuple
2+
from enum import Enum
23
from pydantic import BaseModel
34

5+
class MotorOptions(str, Enum):
6+
cesaroni = "Cesaroni_M1670"
7+
custom = "Custom (Coming soon)"
8+
49
class Motor(BaseModel, frozen=True):
510
burn_time: float
611
dry_mass: float
@@ -13,7 +18,7 @@ class Motor(BaseModel, frozen=True):
1318
grain_initial_height: float
1419
grains_center_of_mass_position: float
1520
#TBD: thrust_source must be the id of a previously uploaded .eng file and a list of "default" files must be provided in the api docs
16-
thrust_source: Optional[str] = "Cesaroni_M1670"
21+
thrust_source: MotorOptions = MotorOptions.cesaroni
1722
grain_separation: float
1823
nozzle_radius: float
1924
throat_radius: float

lib/models/rocket.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
from typing import Optional, Tuple
22
from pydantic import BaseModel
3+
from enum import Enum
34
from lib.models.motor import Motor
45
from lib.models.aerosurfaces import Fins, NoseCone, Tail, RailButtons
56
from lib.models.parachute import Parachute
67

8+
class RocketOptions(str, Enum):
9+
calisto = "calisto"
10+
custom = "Custom (Coming soon)"
11+
712
class Rocket(BaseModel, frozen=True):
813
radius: float
914
mass: float
1015
inertia: "Tuple[float, float, float]" = (6.321, 6.321, 0.0346)
1116
#TBD: powerOffDrag an powerOnDrag need to be the id of previously uploaded .csv files and a list of "default" files must be provided in the api docs
12-
power_off_drag: Optional[str] = 'calisto'
13-
power_on_drag: Optional[str] = 'calisto'
17+
power_off_drag: RocketOptions = RocketOptions.calisto
18+
power_on_drag: RocketOptions = RocketOptions.calisto
1419
center_of_mass_without_motor: int
1520
#TBD: a list of possible tailToNose values must be provided in the api docs
1621
coordinate_system_orientation: Optional[str] = "tail_to_nose"

0 commit comments

Comments
 (0)