Skip to content

Commit

Permalink
MNT: change Airbrakes to AirBrakes
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusStano committed Nov 21, 2023
1 parent 480258f commit 00a4687
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions docs/notebooks/airbrakes_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"id": "nvAT8wcRNVEk"
},
"source": [
"# Airbrakes Example\n"
"# Air Brakes Example\n"
]
},
{
Expand Down Expand Up @@ -229,15 +229,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setting Up the Airbrakes\n",
"## Setting Up the Air Brakes\n",
"\n",
"Now we can get started!\n",
"\n",
"To create an airbrakes model, we need to define the following:\n",
"\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."
]
Expand Down Expand Up @@ -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",
")"
]
},
Expand Down Expand Up @@ -861,7 +861,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.10.5"
},
"vscode": {
"interpreter": {
Expand Down
4 changes: 2 additions & 2 deletions rocketpy/plots/aero_surface_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -459,7 +459,7 @@ def __init__(self, airbrakes):
Parameters
----------
airbrakes : rocketpy.AeroSurface.airbrakes
Airbrakes object to be plotted
AirBrakes object to be plotted
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion rocketpy/prints/aero_surface_prints.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def geometry(self):
return None


class _AirbrakesPrints(_AeroSurfacePrints):
class _AirBrakesPrints(_AeroSurfacePrints):
"""Class that contains all airbrakes prints."""

def geometry(self):
Expand Down
2 changes: 1 addition & 1 deletion rocketpy/rocket/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rocketpy.control.controller import Controller
from rocketpy.rocket.aero_surface import (
AeroSurface,
Airbrakes,
AirBrakes,
EllipticalFins,
Fins,
NoseCone,
Expand Down
26 changes: 13 additions & 13 deletions rocketpy/rocket/aero_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
----------
Expand All @@ -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
-------
Expand All @@ -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 = []
Expand Down
16 changes: 8 additions & 8 deletions rocketpy/rocket/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -278,7 +278,7 @@ def __init__(
# Controllers data initialization
self.controllers = []

# Airbrakes data initialization
# AirBrakes data initialization
self.airbrakes = []

# Aerodynamic data initialization
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 00a4687

Please sign in to comment.