Skip to content

Commit

Permalink
MNT: small doc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusStano committed Sep 24, 2024
1 parent 1f76b41 commit 94e2958
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion rocketpy/rocket/aero_surface/fins/elliptical_fins.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __init__(
Parameters
----------
n : int
Number of fins, from 2 to infinity.
Number of fins, must be larger than 2.
root_chord : int, float
Fin root chord in meters.
span : int, float
Expand Down
2 changes: 1 addition & 1 deletion rocketpy/rocket/aero_surface/fins/fins.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __init__(
Parameters
----------
n : int
Number of fins, from 2 to infinity.
Number of fins, must be larger than 2.
root_chord : int, float
Fin root chord in meters.
span : int, float
Expand Down
2 changes: 1 addition & 1 deletion rocketpy/rocket/aero_surface/fins/free_form_fins.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def __init__(
Parameters
----------
n : int
Number of fins, from 2 to infinity.
Number of fins, must be larger than 2.
shape_points : list
List of tuples (x, y) containing the coordinates of the fin's
geometry defining points. The point (0, 0) is the root leading edge.
Expand Down
2 changes: 1 addition & 1 deletion rocketpy/rocket/aero_surface/fins/trapezoidal_fins.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(
Parameters
----------
n : int
Number of fins, from 2 to infinity.
Number of fins, must be larger than 2.
root_chord : int, float
Fin root chord in meters.
tip_chord : int, float
Expand Down
17 changes: 9 additions & 8 deletions rocketpy/rocket/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,10 @@ def evaluate_surfaces_cp_to_cdm(self):
surface center of pressure to the rocket's center of mass.
"""
for surface, position in self.aerodynamic_surfaces:
self.evaluate_single_surface_cp_to_cdm(surface, position)
self.__evaluate_single_surface_cp_to_cdm(surface, position)

Check warning on line 566 in rocketpy/rocket/rocket.py

View check run for this annotation

Codecov / codecov/patch

rocketpy/rocket/rocket.py#L566

Added line #L566 was not covered by tests
return self.surfaces_cp_to_cdm

def evaluate_single_surface_cp_to_cdm(self, surface, position):
def __evaluate_single_surface_cp_to_cdm(self, surface, position):
"""Calculates the relative position of each aerodynamic surface
center of pressure to the rocket's center of dry mass in Body Axes
Coordinate System."""
Expand Down Expand Up @@ -996,21 +996,22 @@ def add_surfaces(self, surfaces, positions):
-------
None
"""
# TODO: separate this method into smaller methods: https://github.com/RocketPy-Team/RocketPy/pull/696#discussion_r1771978422
try:
for surface, position in zip(surfaces, positions):
if not isinstance(position, (Vector, tuple, list)):
position = Vector([0, 0, position])

Check warning on line 1003 in rocketpy/rocket/rocket.py

View check run for this annotation

Codecov / codecov/patch

rocketpy/rocket/rocket.py#L1002-L1003

Added lines #L1002 - L1003 were not covered by tests
else:
position = Vector(position)

Check warning on line 1005 in rocketpy/rocket/rocket.py

View check run for this annotation

Codecov / codecov/patch

rocketpy/rocket/rocket.py#L1005

Added line #L1005 was not covered by tests
self.aerodynamic_surfaces.add(surface, position)
self.evaluate_single_surface_cp_to_cdm(surface, position)
self.__evaluate_single_surface_cp_to_cdm(surface, position)

Check warning on line 1007 in rocketpy/rocket/rocket.py

View check run for this annotation

Codecov / codecov/patch

rocketpy/rocket/rocket.py#L1007

Added line #L1007 was not covered by tests
except TypeError:
if not isinstance(positions, (Vector, tuple, list)):
positions = Vector([0, 0, positions])
else:
positions = Vector(positions)
self.aerodynamic_surfaces.add(surfaces, positions)
self.evaluate_single_surface_cp_to_cdm(surfaces, positions)
self.__evaluate_single_surface_cp_to_cdm(surfaces, positions)

self.evaluate_center_of_pressure()
self.evaluate_stability_margin()
Expand Down Expand Up @@ -1175,7 +1176,7 @@ def add_trapezoidal_fins(
Parameters
----------
n : int
Number of fins, from 2 to infinity.
Number of fins, must be greater than 2.
span : int, float
Fin span in meters.
root_chord : int, float
Expand Down Expand Up @@ -1273,7 +1274,7 @@ def add_elliptical_fins(
Parameters
----------
n : int
Number of fins, from 2 to infinity.
Number of fins, must be greater than 2.
root_chord : int, float
Fin root chord in meters.
span : int, float
Expand Down Expand Up @@ -1341,8 +1342,8 @@ def add_free_form_fins(
Parameters
----------
n : int
Number of fins, from 2 to infinity.
shape_points : list[tuple[float, float]]
Number of fins, must be greater than 2.
shape_points : list
List of tuples (x, y) containing the coordinates of the fin's
geometry defining points. The point (0, 0) is the root leading edge.
Positive x is rearwards, positive y is upwards (span direction).
Expand Down
10 changes: 0 additions & 10 deletions rocketpy/simulation/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -2704,16 +2704,6 @@ def angle_of_sideslip(self):
) # x-z plane
return np.column_stack([self.time, np.rad2deg(beta)])

@funcify_method("Time (s)", "Angle of Attack (°)", "spline", "constant")
def angle_of_attack2(self):
alpha = np.arctan(
np.sqrt(
np.tan(np.deg2rad(self.partial_angle_of_attack.y_array)) ** 2
+ np.tan(np.deg2rad(self.angle_of_sideslip.y_array)) ** 2
)
)
return np.column_stack([self.time, np.rad2deg(alpha)])

# Frequency response and stability variables
@funcify_method("Frequency (Hz)", "ω1 Fourier Amplitude", "spline", "zero")
def omega1_frequency_response(self):
Expand Down

0 comments on commit 94e2958

Please sign in to comment.