File tree 3 files changed +43
-2
lines changed 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 8
8
9
9
pylint :
10
10
pylint --extension-pkg-whitelist=' pydantic' ./lib/*
11
+
12
+ dev :
13
+ python3 -m uvicorn lib:app --reload --port 3000
14
+
15
+ clean :
16
+ docker stop infinity-api
17
+ docker rm infinity-api
18
+ docker system prune -fa
19
+
20
+ build :
21
+ docker build -t infinity-api . --no-cache
Original file line number Diff line number Diff line change
1
+ from enum import Enum
2
+ from typing import Optional
1
3
from pydantic import BaseModel
2
4
from lib .models .rocket import Rocket
3
5
from lib .models .environment import Env
4
6
5
7
8
+ class EquationsOfMotion (str , Enum ):
9
+ STANDARD = "STANDARD"
10
+ SOLID_PROPULSION = "SOLID_PROPULSION"
11
+
12
+
6
13
class Flight (BaseModel ):
14
+ name : str = "Flight"
7
15
environment : Env = Env ()
8
16
rocket : Rocket = Rocket ()
9
- inclination : int = 85
10
- heading : int = 0
11
17
rail_length : float = 5.2
18
+ inclination : Optional [int ] = 80.0
19
+ heading : Optional [int ] = 90.0
20
+ # TODO: implement initial_solution
21
+ terminate_on_apogee : Optional [bool ] = False
22
+ max_time : Optional [int ] = 600
23
+ max_time_step : Optional [float ] = 9999
24
+ min_time_step : Optional [int ] = 0
25
+ rtol : Optional [float ] = 1e-3
26
+ atol : Optional [float ] = 1e-3
27
+ time_overshoot : Optional [bool ] = True
28
+ verbose : Optional [bool ] = False
29
+ equations_of_motion : Optional [EquationsOfMotion ] = (
30
+ EquationsOfMotion .STANDARD
31
+ )
Original file line number Diff line number Diff line change @@ -35,6 +35,16 @@ def from_flight_model(cls, flight: Flight) -> Self:
35
35
heading = flight .heading ,
36
36
environment = rocketpy_env ,
37
37
rail_length = flight .rail_length ,
38
+ # initial_solution=flight.initial_solution,
39
+ terminate_on_apogee = flight .terminate_on_apogee ,
40
+ max_time = flight .max_time ,
41
+ max_time_step = flight .max_time_step ,
42
+ min_time_step = flight .min_time_step ,
43
+ rtol = flight .rtol ,
44
+ atol = flight .atol ,
45
+ time_overshoot = flight .time_overshoot ,
46
+ verbose = flight .verbose ,
47
+ equations_of_motion = flight .equations_of_motion .value .lower (),
38
48
)
39
49
return cls (flight = rocketpy_flight )
40
50
You can’t perform that action at this time.
0 commit comments