Skip to content

Honor the exact light-time convergence tolerance - #146

Merged
SuperdoerTrav merged 1 commit into
llnl:mainfrom
sylvesterkaczmarek:fix/light-time-convergence-tolerance
Sep 19, 2026
Merged

SuperdoerTrav merged 1 commit into
llnl:mainfrom
sylvesterkaczmarek:fix/light-time-convergence-tolerance

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Apply the existing 1 ps tolerance to each light-time update before reducing the convergence condition. The previous np.any(abs(delta)) > 1e-12 compared a Boolean with the tolerance, effectively requiring bitwise-stable delays.

This can reject already-converged observations when floating-point epoch rounding produces a sub-picosecond cycle. Two real Keplerian examples reproduce the failure in radec(..., obsAngleCorrection="exact"). The numerical tolerance and iteration limit are unchanged; nonconvergent and NaN updates still raise.

Validation

Python 3.12, NumPy 2.5.3, SciPy 1.18.1 on macOS arm64:

  • New regressions on unchanged main (8bb784c): 4 failed, 2 passed. With the fix: all 6 passed.
  • Coverage includes multi-orbit convergence, nonconvergence/NaN controls, and public RA/Dec and direction-cosine results checked against an independently bracketed light-time root.
  • Focused compute tests: 23 passed.
  • Full suite: 334 passed, 2 skipped, 35 subtests passed.
  • New tests pass Flake8; no additional Flake8 findings in compute.py. Syntax checks and git diff --check pass.

No native code or public API changes. Other operating systems were not tested locally.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.39%. Comparing base (8bb784c) to head (0f9a368).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #146   +/-   ##
=======================================
  Coverage   97.39%   97.39%           
=======================================
  Files          17       17           
  Lines        5897     5897           
=======================================
  Hits         5743     5743           
  Misses        154      154           
Flag Coverage Δ
unittests 97.39% <100.00%> (ø)

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

Files with missing lines Coverage Δ
ssapy/compute.py 94.93% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review September 19, 2026 20:51
@SuperdoerTrav
SuperdoerTrav merged commit 45730dc into llnl:main Sep 19, 2026
5 checks passed
@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Thank you for merging this. Much appreciated, and I’m glad to keep contributing to SSAPy.

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.

3 participants