Skip to content

Commit

Permalink
DOC: write docstring for the add motor test.
Browse files Browse the repository at this point in the history
  • Loading branch information
phmbressan committed Oct 3, 2023
1 parent 01efe3e commit c437c9e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/test_rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,37 @@ def test_add_motor_coordinates(
expected_motor_cdm,
expected_motor_cpp,
):
"""Test the method add_motor and related position properties in a Rocket
instance.
This test checks the correctness of the `add_motor` method and the computed
`motor_center_of_dry_mass_position` and `center_of_propellant_position`
properties in the `Rocket` class using various parameters related to the
motor's position, nozzle's position, and other related coordinates.
Different scenarios are tested using parameterization, checking scenarios
moving from the nozzle to the combustion chamber and vice versa, and with
various specific physical and geometrical characteristics of the motor.
Parameters
----------
calisto_motorless : Rocket instance
A predefined instance of a Rocket without a motor, used as a base for testing.
cdm_position : float
Position of the center of dry mass of the motor.
grain_cm_position : float
Position of the grains' center of mass.
nozzle_position : float
Position of the nozzle.
coord_direction : str
Direction for coordinate system orientation;
it can be "nozzle_to_combustion_chamber" or "combustion_chamber_to_nozzle".
motor_position : float
Position where the motor should be added to the rocket.
expected_motor_cdm : float
Expected position of the motor's center of dry mass after addition.
expected_motor_cpp : float
Expected position of the center of propellant after addition.
"""
example_motor = SolidMotor(
thrust_source="data/motors/Cesaroni_M1670.eng",
burn_time=3.9,
Expand Down

0 comments on commit c437c9e

Please sign in to comment.