Skip to content

Commit 5ba494a

Browse files
TST: relax noisy stream_velocity_z apogee tolerance
stream_velocity_z at apogee is a residual of the apogee-time estimation: it is physically ~0 but swings by ~1e-4 m/s across platforms/NumPy versions and atmosphere discretizations (e.g. -8.9e-8 on py3.10 with the new ISA grid, -2.0e-4 with the old grid, +2.6e-4 on py3.14). The previous atol=1e-5 was tighter than this numerical noise, making the assertion flaky. Use atol=1e-3, which is physically negligible (vertical speed peaks above 200 m/s) while still catching real regressions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a79b84a commit 5ba494a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/integration/simulation/test_flight.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,13 @@ def test_freestream_speed_at_apogee(example_plain_env, calisto):
386386
"""
387387
# NOTE: this rocket doesn't move in x or z direction. There's no wind.
388388
hard_atol = 1e-12
389-
soft_atol = 1e-5
390389
soft_rtol = 1e-4
390+
# stream_velocity_z at apogee is a numerically noisy ~0 quantity: it is a
391+
# residual of the apogee-time estimation and swings by ~1e-4 across
392+
# platforms/NumPy versions and atmosphere discretizations. Use a looser
393+
# absolute tolerance for it (1e-3 m/s is physically negligible for a rocket
394+
# whose vertical speed peaks above 200 m/s).
395+
apogee_z_atol = 1e-3
391396
test_flight = Flight(
392397
environment=example_plain_env,
393398
rocket=calisto,
@@ -414,7 +419,7 @@ def test_freestream_speed_at_apogee(example_plain_env, calisto):
414419
npt.assert_allclose(
415420
test_flight.stream_velocity_z(test_flight.apogee_time),
416421
0.0,
417-
atol=soft_atol,
422+
atol=apogee_z_atol,
418423
rtol=soft_rtol,
419424
)
420425
npt.assert_allclose(

0 commit comments

Comments
 (0)