Skip to content

Commit

Permalink
TST: fixes test that checks coordinate systems
Browse files Browse the repository at this point in the history
  • Loading branch information
giovaniceotto committed Nov 21, 2023
1 parent a08790b commit b16ac87
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/test_rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_coordinate_system_orientation(
burn_time=3.9,
dry_mass=1.815,
dry_inertia=(0.125, 0.125, 0.002),
center_of_dry_mass_position=0.317,
center_of_dry_mass_position=-0.317,
nozzle_position=0,
grain_number=5,
grain_density=1815,
Expand All @@ -60,7 +60,7 @@ def test_coordinate_system_orientation(
grain_separation=5 / 1000,
grain_outer_radius=33 / 1000,
grain_initial_height=120 / 1000,
grains_center_of_mass_position=0.397,
grains_center_of_mass_position=-0.397,
grain_initial_inner_radius=15 / 1000,
interpolation_method="linear",
coordinate_system_orientation="combustion_chamber_to_nozzle",
Expand All @@ -81,7 +81,7 @@ def test_coordinate_system_orientation(
rocket_tail_to_nose.aerodynamic_surfaces.add(calisto_nose_cone, 1.160)
rocket_tail_to_nose.aerodynamic_surfaces.add(calisto_trapezoidal_fins, -1.168)

static_margin_tail_to_nose = rocket_tail_to_nose.static_margin(0)
static_margin_tail_to_nose = rocket_tail_to_nose.static_margin

rocket_nose_to_tail = Rocket(
radius=0.0635,
Expand All @@ -98,13 +98,9 @@ def test_coordinate_system_orientation(
rocket_nose_to_tail.aerodynamic_surfaces.add(calisto_nose_cone, -1.160)
rocket_nose_to_tail.aerodynamic_surfaces.add(calisto_trapezoidal_fins, 1.168)

static_margin_nose_to_tail = rocket_nose_to_tail.static_margin(0)
static_margin_nose_to_tail = rocket_nose_to_tail.static_margin

assert (
rocket_tail_to_nose.all_info() == None
or rocket_nose_to_tail.all_info() == None
or not abs(static_margin_tail_to_nose - static_margin_nose_to_tail) < 0.0001
)
assert np.array_equal(static_margin_tail_to_nose, static_margin_nose_to_tail)


@patch("matplotlib.pyplot.show")
Expand Down

0 comments on commit b16ac87

Please sign in to comment.