From 00a468731c0557d988c0be548f2c7733afab9141 Mon Sep 17 00:00:00 2001 From: MateusStano Date: Tue, 21 Nov 2023 16:29:45 +0100 Subject: [PATCH] MNT: change Airbrakes to AirBrakes --- docs/notebooks/airbrakes_example.ipynb | 12 ++++++------ rocketpy/plots/aero_surface_plots.py | 4 ++-- rocketpy/prints/aero_surface_prints.py | 2 +- rocketpy/rocket/__init__.py | 2 +- rocketpy/rocket/aero_surface.py | 26 +++++++++++++------------- rocketpy/rocket/rocket.py | 16 ++++++++-------- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/notebooks/airbrakes_example.ipynb b/docs/notebooks/airbrakes_example.ipynb index 89d904119..bf1773e30 100644 --- a/docs/notebooks/airbrakes_example.ipynb +++ b/docs/notebooks/airbrakes_example.ipynb @@ -8,7 +8,7 @@ "id": "nvAT8wcRNVEk" }, "source": [ - "# Airbrakes Example\n" + "# Air Brakes Example\n" ] }, { @@ -229,7 +229,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Setting Up the Airbrakes\n", + "## Setting Up the Air Brakes\n", "\n", "Now we can get started!\n", "\n", @@ -237,7 +237,7 @@ "\n", "* The airbrakes' drag coefficient as a function of the airbrakes' deployed level and of the Mach number. This can be done by defining by inputing the directory of a CSV file containing the drag coefficient as a function of the airbrakes' deployed level and of the Mach number. The CSV file must contain no headers and must have three columns: the first column must be the airbrakes' deployed level, the second column must be the Mach number, and the third column must be the drag coefficient.\n", "\n", - "* The controller function, which takes in the current time, the current state, and the `Airbrakes` instance being defined, and sets the desired airbrakes' deployed level. The airbrakes' deployed level must be between 0 and 1, and must be set using the `set_deployed_level` method of the `Airbrakes` instance being defined. Inside this function, any controller logic, filters, and apogee prediction can be implemented.\n", + "* The controller function, which takes in the current time, the current state, and the `AirBrakes` instance being defined, and sets the desired airbrakes' deployed level. The airbrakes' deployed level must be between 0 and 1, and must be set using the `set_deployed_level` method of the `AirBrakes` instance being defined. Inside this function, any controller logic, filters, and apogee prediction can be implemented.\n", "\n", "* The sampling rate of the controller function, in seconds. This is the time between each call of the controller function, in simulation time. Must be given in Hertz." ] @@ -337,8 +337,8 @@ " controller_function=controller_function,\n", " sampling_rate=100,\n", " reference_area=None,\n", - " name=\"Airbrakes\",\n", - " controller_name=\"Airbrakes Controller\",\n", + " name=\"AirBrakes\",\n", + " controller_name=\"AirBrakes Controller\",\n", ")" ] }, @@ -861,7 +861,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.8" + "version": "3.10.5" }, "vscode": { "interpreter": { diff --git a/rocketpy/plots/aero_surface_plots.py b/rocketpy/plots/aero_surface_plots.py index fac7cbcaa..1285bd07a 100644 --- a/rocketpy/plots/aero_surface_plots.py +++ b/rocketpy/plots/aero_surface_plots.py @@ -450,7 +450,7 @@ def draw(self): return None -class _AirbrakesPlots(_AeroSurfacePlots): +class _AirBrakesPlots(_AeroSurfacePlots): """Class that contains all airbrakes plots.""" def __init__(self, airbrakes): @@ -459,7 +459,7 @@ def __init__(self, airbrakes): Parameters ---------- airbrakes : rocketpy.AeroSurface.airbrakes - Airbrakes object to be plotted + AirBrakes object to be plotted Returns ------- diff --git a/rocketpy/prints/aero_surface_prints.py b/rocketpy/prints/aero_surface_prints.py index ed9f60590..1988e59e3 100644 --- a/rocketpy/prints/aero_surface_prints.py +++ b/rocketpy/prints/aero_surface_prints.py @@ -293,7 +293,7 @@ def geometry(self): return None -class _AirbrakesPrints(_AeroSurfacePrints): +class _AirBrakesPrints(_AeroSurfacePrints): """Class that contains all airbrakes prints.""" def geometry(self): diff --git a/rocketpy/rocket/__init__.py b/rocketpy/rocket/__init__.py index ea36b6f13..0c7d75afe 100644 --- a/rocketpy/rocket/__init__.py +++ b/rocketpy/rocket/__init__.py @@ -1,7 +1,7 @@ from rocketpy.control.controller import Controller from rocketpy.rocket.aero_surface import ( AeroSurface, - Airbrakes, + AirBrakes, EllipticalFins, Fins, NoseCone, diff --git a/rocketpy/rocket/aero_surface.py b/rocketpy/rocket/aero_surface.py index 9058567f4..1da075fa1 100644 --- a/rocketpy/rocket/aero_surface.py +++ b/rocketpy/rocket/aero_surface.py @@ -7,14 +7,14 @@ from ..mathutils.function import Function from ..plots.aero_surface_plots import ( - _AirbrakesPlots, + _AirBrakesPlots, _EllipticalFinsPlots, _NoseConePlots, _TailPlots, _TrapezoidalFinsPlots, ) from ..prints.aero_surface_prints import ( - _AirbrakesPrints, + _AirBrakesPrints, _EllipticalFinsPrints, _NoseConePrints, _RailButtonsPrints, @@ -1894,25 +1894,25 @@ def all_info(self): return None -class Airbrakes(AeroSurface): - """Airbrakes class. Inherits from AeroSurface. +class AirBrakes(AeroSurface): + """AirBrakes class. Inherits from AeroSurface. Attributes ---------- - Airbrakes.cd : int, float, callable, array, Function + AirBrakes.cd : int, float, callable, array, Function Drag coefficient as a function of deployed level and Mach number. - Airbrakes.cd_curve : int, float, callable, array, string, Function + AirBrakes.cd_curve : int, float, callable, array, string, Function Curve that defines the drag coefficient as a function of deployed level and Mach number. - Airbrakes.deployed_level : float + AirBrakes.deployed_level : float Current deployed level, ranging from 0 to 1. Deployed level is the fraction of the total airbrake area that is deployed. - Airbrakes.name : str + AirBrakes.name : str Name of the airbrakes. """ - def __init__(self, cd_curve, reference_area, deployed_level=0, name="Airbrakes"): - """Initializes the Airbrakes class. + def __init__(self, cd_curve, reference_area, deployed_level=0, name="AirBrakes"): + """Initializes the AirBrakes class. Parameters ---------- @@ -1936,7 +1936,7 @@ def __init__(self, cd_curve, reference_area, deployed_level=0, name="Airbrakes") Current deployed level, ranging from 0 to 1. Deployed level is the fraction of the total airbrake area that is deployed. Default is 0. name : str, optional - Name of the airbrakes. Default is "Airbrakes". + Name of the airbrakes. Default is "AirBrakes". Returns ------- @@ -1952,8 +1952,8 @@ def __init__(self, cd_curve, reference_area, deployed_level=0, name="Airbrakes") ) self.reference_area = reference_area self.deployed_level = deployed_level - self.prints = _AirbrakesPrints(self) - self.plots = _AirbrakesPlots(self) + self.prints = _AirBrakesPrints(self) + self.plots = _AirBrakesPlots(self) # Initialize tracker lists self.state_history = [] diff --git a/rocketpy/rocket/rocket.py b/rocketpy/rocket/rocket.py index adee9b002..cf5395493 100644 --- a/rocketpy/rocket/rocket.py +++ b/rocketpy/rocket/rocket.py @@ -8,7 +8,7 @@ from rocketpy.plots.rocket_plots import _RocketPlots from rocketpy.prints.rocket_prints import _RocketPrints from rocketpy.rocket.aero_surface import ( - Airbrakes, + AirBrakes, EllipticalFins, Fins, NoseCone, @@ -278,7 +278,7 @@ def __init__( # Controllers data initialization self.controllers = [] - # Airbrakes data initialization + # AirBrakes data initialization self.airbrakes = [] # Aerodynamic data initialization @@ -1161,8 +1161,8 @@ def add_airbrakes( controller_function, sampling_rate, reference_area=None, - name="Airbrakes", - controller_name="Airbrakes Controller", + name="AirBrakes", + controller_name="AirBrakes Controller", ): """Creates a new airbrakes, storing its parameters such as opening delay, drag coefficients and trigger function. @@ -1208,7 +1208,7 @@ def add_airbrakes( from the drag coefficient curve. If None, which is default, use rocket section area. Must be given in squared meters. name : string, optional - Airbrakes name, such as drogue and main. Has no impact in + AirBrakes name, such as drogue and main. Has no impact in simulation, as it is only used to display data in a more organized matter. controller_name : string, optional @@ -1217,13 +1217,13 @@ def add_airbrakes( Returns ------- - airbrakes : Airbrakes - Airbrakes object created. + airbrakes : AirBrakes + AirBrakes object created. controller : Controller Controller object created. """ reference_area = reference_area if reference_area is not None else self.area - airbrakes = Airbrakes( + airbrakes = AirBrakes( cd_curve=cd_curve, reference_area=reference_area, deployed_level=0,