File tree Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 88
99pylint :
1010 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
13from pydantic import BaseModel
24from lib .models .rocket import Rocket
35from lib .models .environment import Env
46
57
8+ class EquationsOfMotion (str , Enum ):
9+ STANDARD = "STANDARD"
10+ SOLID_PROPULSION = "SOLID_PROPULSION"
11+
12+
613class Flight (BaseModel ):
14+ name : str = "Flight"
715 environment : Env = Env ()
816 rocket : Rocket = Rocket ()
9- inclination : int = 85
10- heading : int = 0
1117 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:
3535 heading = flight .heading ,
3636 environment = rocketpy_env ,
3737 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 (),
3848 )
3949 return cls (flight = rocketpy_flight )
4050
You can’t perform that action at this time.
0 commit comments