Skip to content

Fix orbit-evection slow test after obliqua merge - #888

Merged
timlichtenberg merged 2 commits into
mainfrom
tl/orbit-evection-interior-struct
Sep 19, 2026
Merged

timlichtenberg merged 2 commits into
mainfrom
tl/orbit-evection-interior-struct

Conversation

@timlichtenberg

Copy link
Copy Markdown
Member

Description

The orbit-evection slow-tier test errored at setup after the obliqua merge, #859. Two problems surfaced together: the test helpfile row did not set core_density, so get_C_planet fell through to a config attribute the test namespace does not have (AttributeError at setup), and the Hansen table spanned k in [-50, 200] while the m=0 mirror requests k down to -200, which mismatched the array shapes in orbitals() (251 against 401 modes).

This adds core_density to the row, builds the table over [-200, 200], guards the table range against what the mirror requests, and refreshes the module docstring figures to values measured from the current run. Related: #859.

Validation of changes

  • pytest tests/integration/test_slow_orbit_evection_ctl.py on the branch tip: 4 passed in 629 s. macOS, Python 3.12.
  • The new fixture assertion checks that the Hansen table range covers kmin_kmax_for_m0_mirror; it evaluates False for the old [-50, 200] table and True for [-200, 200].
  • The docstring peak, timing, capture and angular-momentum figures are re-measured from the run (peak e = 0.744 at a' = 12.33 R_earth, capture at t = 2.5e4 yr, plan_sat_am drift -4.2%), stated as one run on one machine. No test assertion changed.

Checklist

  • I have followed the contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have checked that the tests still pass on my computer
  • I have updated the docs, as appropriate
  • I have added tests for these changes, as appropriate
  • I have checked that all dependencies have been updated, as required

The slow-tier test built its initial helpfile row without core_density, which get_C_planet reads, and its Hansen table spanned k in [-50, 200] while the m=0 mirror requests k down to -200. Add core_density to the row and build the table over [-200, 200]. Related: #859
The orbit-evection slow test failed in two places after the obliqua merge, #859: hf_row lacked core_density, so get_C_planet fell through to a config attribute the test namespace does not have (AttributeError at setup), and the Hansen table spanned k in [-50, 200] while the m=0 mirror requests k down to -200, which broke the array shapes in orbitals() (251 against 401 modes). Add an assertion in the fixture that the table range covers what kmin_kmax_for_m0_mirror requests, so widening the test spectrum without the table fails at setup. Replace the timing, peak eccentricity, capture time and angular momentum drift figures in the module docstring with values measured from the current run (628 s, e_peak=0.744 at a'=12.33 R_earth, drift -4.2%), and drop the claims that came from a standalone run that cannot be reproduced here. Correct the C_planet comment to the C_int key that get_C_planet writes.
@timlichtenberg
timlichtenberg requested a review from a team as a code owner September 19, 2026 17:11
@codecov

codecov Bot commented Sep 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.24%. Comparing base (bf63262) to head (113de86).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #888   +/-   ##
=======================================
  Coverage   94.24%   94.24%           
=======================================
  Files         118      118           
  Lines       18641    18641           
  Branches     3187     3187           
=======================================
+ Hits        17568    17569    +1     
+ Misses       1069     1068    -1     
  Partials        4        4           
Flag Coverage Δ
unit-tests 88.84% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timlichtenberg

Copy link
Copy Markdown
Member Author

@MarijnJ0 Please review, the recent Obliqua PR merge broke the nightly apparently, this should it get back on track.

@timlichtenberg
timlichtenberg merged commit 68ff6f6 into main Sep 19, 2026
14 checks passed
@timlichtenberg
timlichtenberg deleted the tl/orbit-evection-interior-struct branch September 19, 2026 17:24

@MarijnJ0 MarijnJ0 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me. Iverified the tests pass on my machine as well. The table span test is also a nice addition!

The discrepancy between the original pinned values and the new values arise due to a slight shift in the evection angle phase that arises due to the inclusing of the new (neglegible) m=0 modes. This does not affect the overall migration substantially. Since the pinned values are still in_band the semi major axis and eccentricity still undergo rapid oscillations, so a small change (due to additional m=0 terms) affects the specific moment during this oscillation that we observe at the end, and can give rise to the observed ~4% offset.

Overall, the structure now matches the correct orbit solver structure in PROTEUS/orbit.

Thanks for catching this Tim!

@timlichtenberg

Copy link
Copy Markdown
Member Author

Thanks a lot! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants