Skip to content

Commit c437c9e

Browse files
committed
DOC: write docstring for the add motor test.
1 parent 01efe3e commit c437c9e

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

tests/test_rocket.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,37 @@ def test_add_motor_coordinates(
400400
expected_motor_cdm,
401401
expected_motor_cpp,
402402
):
403+
"""Test the method add_motor and related position properties in a Rocket
404+
instance.
405+
406+
This test checks the correctness of the `add_motor` method and the computed
407+
`motor_center_of_dry_mass_position` and `center_of_propellant_position`
408+
properties in the `Rocket` class using various parameters related to the
409+
motor's position, nozzle's position, and other related coordinates.
410+
Different scenarios are tested using parameterization, checking scenarios
411+
moving from the nozzle to the combustion chamber and vice versa, and with
412+
various specific physical and geometrical characteristics of the motor.
413+
414+
Parameters
415+
----------
416+
calisto_motorless : Rocket instance
417+
A predefined instance of a Rocket without a motor, used as a base for testing.
418+
cdm_position : float
419+
Position of the center of dry mass of the motor.
420+
grain_cm_position : float
421+
Position of the grains' center of mass.
422+
nozzle_position : float
423+
Position of the nozzle.
424+
coord_direction : str
425+
Direction for coordinate system orientation;
426+
it can be "nozzle_to_combustion_chamber" or "combustion_chamber_to_nozzle".
427+
motor_position : float
428+
Position where the motor should be added to the rocket.
429+
expected_motor_cdm : float
430+
Expected position of the motor's center of dry mass after addition.
431+
expected_motor_cpp : float
432+
Expected position of the center of propellant after addition.
433+
"""
403434
example_motor = SolidMotor(
404435
thrust_source="data/motors/Cesaroni_M1670.eng",
405436
burn_time=3.9,

0 commit comments

Comments
 (0)