From ccd63733d2a74ed97b8eb9ebf65f449aa7d6c231 Mon Sep 17 00:00:00 2001 From: Julio Machado Date: Mon, 17 Jun 2024 18:07:51 -0300 Subject: [PATCH] BUG: RailButtons does not have rocket_radius attribute #606. rocket_radius attribute added to RailButtons Class --- rocketpy/rocket/aero_surface.py | 12 +++++------- rocketpy/rocket/rocket.py | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/rocketpy/rocket/aero_surface.py b/rocketpy/rocket/aero_surface.py index ef054169c..c1e891277 100644 --- a/rocketpy/rocket/aero_surface.py +++ b/rocketpy/rocket/aero_surface.py @@ -1861,13 +1861,8 @@ class RailButtons(AeroSurface): relative to one of the other principal axis. """ - def __init__( - self, - rocket_radius, - buttons_distance, - angular_position=45, - name="Rail Buttons", - ): + def __init__(self, rocket_radius, buttons_distance, + angular_position=45, name="Rail Buttons",): """Initializes RailButtons Class. Parameters @@ -1882,6 +1877,8 @@ def __init__( Name of the rail buttons. Default is "Rail Buttons". rocket_radius: int, float, optional The reference rocket radius used for lift coefficient normalization. + rocket_radius: int, float, optional + The reference rocket radius used for lift coefficient normalization. Returns ------- @@ -1893,6 +1890,7 @@ def __init__( self.angular_position = angular_position self.name = name self.rocket_radius = rocket_radius + self.rocket_radius = rocket_radius self.evaluate_lift_coefficient() self.evaluate_center_of_pressure() diff --git a/rocketpy/rocket/rocket.py b/rocketpy/rocket/rocket.py index 7abc9e69a..d64c3badd 100644 --- a/rocketpy/rocket/rocket.py +++ b/rocketpy/rocket/rocket.py @@ -1509,9 +1509,9 @@ def set_rail_buttons( RailButtons object created """ buttons_distance = abs(upper_button_position - lower_button_position) - rail_buttons = RailButtons( + rail_buttons = RailButtons(rocket_radius=self.radius, buttons_distance=buttons_distance, - angular_position=angular_position, + angular_position=angular_position ) self.rail_buttons.add(rail_buttons, lower_button_position) return rail_buttons