Skip to content

Commit 1ff3f2d

Browse files
addresses PR review
1 parent d1f9a97 commit 1ff3f2d

File tree

4 files changed

+37
-22
lines changed

4 files changed

+37
-22
lines changed

src/views/environment.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88
class EnvironmentSimulation(ApiBaseView):
99
"""
10-
Environment simulation view that handles dynamically encoded RocketPy Environment attributes.
10+
Environment simulation view that handles dynamically
11+
encoded RocketPy Environment attributes.
1112
12-
Uses the new rocketpy_encoder which may return different attributes based on the
13-
actual RocketPy Environment object. The model allows extra fields to accommodate
13+
Uses the new rocketpy_encoder which may return
14+
different attributes based on the actual RocketPy Environment object.
15+
The model allows extra fields to accommodate
1416
any new attributes that might be encoded.
1517
"""
1618

@@ -39,7 +41,9 @@ class EnvironmentSimulation(ApiBaseView):
3941
local_date: Optional[datetime] = datetime.today() + timedelta(days=1)
4042
datetime_date: Optional[datetime] = datetime.today() + timedelta(days=1)
4143

42-
# Function attributes (discretized by rocketpy_encoder, serialized by RocketPyEncoder)
44+
# Function attributes
45+
# discretized by rocketpy_encoder
46+
# serialized by RocketPyEncoder
4347
ellipsoid: Optional[Any] = None
4448
barometric_height: Optional[Any] = None
4549
barometric_height_ISA: Optional[Any] = None

src/views/flight.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88

99
class FlightSimulation(RocketSimulation, EnvironmentSimulation):
1010
"""
11-
Flight simulation view that handles dynamically encoded RocketPy Flight attributes.
11+
Flight simulation view that handles dynamically encoded
12+
RocketPy Flight attributes.
1213
13-
Inherits from both RocketSimulation and EnvironmentSimulation, and adds flight-specific
14-
attributes. Uses the new rocketpy_encoder which may return different attributes based
15-
on the actual RocketPy Flight object. The model allows extra fields to accommodate
14+
Inherits from both RocketSimulation and EnvironmentSimulation,
15+
and adds flight-specific attributes. Uses the new rocketpy_encoder
16+
which may return different attributes based on the actual
17+
RocketPy Flight object. The model allows extra fields to accommodate
1618
any new attributes that might be encoded.
1719
"""
1820

@@ -29,8 +31,6 @@ class FlightSimulation(RocketSimulation, EnvironmentSimulation):
2931
rocket: Optional[RocketSimulation] = None
3032
environment: Optional[EnvironmentSimulation] = None
3133

32-
# Key Flight Function attributes (discretized by rocketpy_encoder, serialized by RocketPyEncoder)
33-
3434
# Position and trajectory
3535
latitude: Optional[Any] = None
3636
longitude: Optional[Any] = None
@@ -74,7 +74,9 @@ class FlightSimulation(RocketSimulation, EnvironmentSimulation):
7474
time: Optional[Any] = None
7575
solution: Optional[Any] = None
7676

77-
# Function attributes (discretized by rocketpy_encoder, serialized by RocketPyEncoder)
77+
# Function attributes
78+
# discretized by rocketpy_encoder
79+
# serialized by RocketPyEncoder
7880
angular_position: Optional[Any] = None
7981
attitude_angle: Optional[Any] = None
8082
attitude_vector_x: Optional[Any] = None

src/views/motor.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66

77
class MotorSimulation(ApiBaseView):
88
"""
9-
Motor simulation view that handles dynamically encoded RocketPy Motor attributes.
9+
Motor simulation view that handles dynamically
10+
encoded RocketPy Motor attributes.
1011
11-
Uses the new rocketpy_encoder which may return different attributes based on the
12-
actual RocketPy Motor object. The model allows extra fields to accommodate
13-
any new attributes that might be encoded.
12+
Uses the new rocketpy_encoder which may return
13+
different attributes based on the actual RocketPy Motor object.
14+
The model allows extra fields to accommodate any
15+
new attributes that might be encoded.
1416
"""
1517

1618
model_config = ConfigDict(extra='allow', arbitrary_types_allowed=True)
@@ -36,7 +38,9 @@ class MotorSimulation(ApiBaseView):
3638
motor_kind: Optional[str] = None
3739
interpolate: Optional[str] = None
3840

39-
# Function attributes (discretized by rocketpy_encoder, serialized by RocketPyEncoder)
41+
# Function attributes
42+
# discretized by rocketpy_encoder
43+
# serialized by RocketPyEncoder
4044
Kn: Optional[Any] = None
4145
I_11: Optional[Any] = None
4246
I_12: Optional[Any] = None

src/views/rocket.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77

88
class RocketSimulation(MotorSimulation):
99
"""
10-
Rocket simulation view that handles dynamically encoded RocketPy Rocket attributes.
10+
Rocket simulation view that handles dynamically
11+
encoded RocketPy Rocket attributes.
1112
12-
Inherits from MotorSimulation and adds rocket-specific attributes. Uses the new
13-
rocketpy_encoder which may return different attributes based on the actual
14-
RocketPy Rocket object. The model allows extra fields to accommodate any new
15-
attributes that might be encoded.
13+
Inherits from MotorSimulation and adds rocket-specific attributes.
14+
Uses the new rocketpy_encoder which may return different attributes
15+
based on the actual RocketPy Rocket object.
16+
17+
The model allows extra fields to accommodate any new attributes
18+
that might be encoded.
1619
"""
1720

1821
model_config = ConfigDict(extra='allow', arbitrary_types_allowed=True)
@@ -30,7 +33,9 @@ class RocketSimulation(MotorSimulation):
3033
parachutes: Optional[list] = None
3134
motor: Optional[MotorSimulation] = None
3235

33-
# Function attributes (discretized by rocketpy_encoder, serialized by RocketPyEncoder)
36+
# Function attributes
37+
# discretized by rocketpy_encoder
38+
# serialized by RocketPyEncoder
3439
I_11_without_motor: Optional[Any] = None
3540
I_12_without_motor: Optional[Any] = None
3641
I_13_without_motor: Optional[Any] = None

0 commit comments

Comments
 (0)