Repository navigation
Conversation
…uters. Before the tolerances were very tight and could fail on other platforms.
Extend formationBarycenter coverage beyond single-spacecraft singular states with 18 formation cases spanning both equinoctial representations. Add 12 exact and near-equatorial cases with circular, near-circular, and eccentric members. Use unequal masses, semimajor axes, and orbital phases, with widely separated ascending nodes and nearby periapsis longitudes. Compute the independent reference from prescribed classical elements so undefined angles need not be recovered from Cartesian input states. Add six cases that cancel the averaged eccentricity components, inclination components, or both. A 1:3 mass ratio balances opposing component vectors with a 3:1 magnitude ratio. Their common mean longitude and analytically known averaged orbit provide expected states independently of the general weighted-reference helper. Check position and velocity on both C and C++ output interfaces using physical absolute tolerances. Include descriptive parameter IDs and docstrings explaining each fixture. Production behavior is unchanged. Validation: - All 249 module tests pass on the local macOS build in 1.04 seconds. - All 18 new cases pass under Python 3.14 and Python 3.15. - A separate 70-digit classical-orbit reference agrees with all 18 expected states within 6.4 nm in position and 5.1e-12 m/s in velocity. - Review probes confirm all 18 cases reject Cartesian fallback and equal weights; all six near-equatorial cases reject flattening onto the equator. - Applicable pre-commit checks, docstring rendering, and git diff --check pass.
… tests Protect the existing classical averaging behavior while PR 1668 adds optional equinoctial representations. Add 12 regressions using four three-spacecraft formations across three configuration paths: - Omit orbitalElementType to exercise the default classical selection. - Set CLASSICAL explicitly. - Start in Cartesian mode with zero mu, then enable orbital averaging through the legacy useOrbitalElements and mu attributes after an update. Cover unequal spacecraft masses and semimajor axes, angular wrapping, eccentric retrograde motion, and low-eccentricity inclined formations. Check position and velocity against fixed outputs captured from the unmodified C++ module and header at PR 1668's base commit, d0f9832. Document the reference provenance, input element ordering, physical units, and configuration coverage. Require finite, identical C and C++ output states. Compare against the fixed references with zero relative tolerance and absolute tolerances of 2 micrometers in position and 2e-8 m/s in velocity. Use nonsingular inputs to retain sensitivity without depending on ill-conditioned classical angles or exact floating-point agreement across computers. Validation: - All 261 formationBarycenter tests pass under Python 3.15. - All 12 added cases also pass under Python 3.14. - Baseline outputs remain within tolerance with floating-point contraction disabled in the original module and orbital utilities. - Separate review probes reject Cartesian/equinoctial substitution, equal weighting, arithmetic angle averaging, and mean-anomaly substitution. - All 128 input-rounding probes, perturbing components by up to four ULPs, remain within tolerance. - Pre-commit checks, diff checks, and RST docstring parsing pass. Validation was performed on macOS ARM; Linux and Windows execution remains for CI. This change adds tests only and preserves the production module and public API.
…ct formation references
|
Backward compatibility The opt-in design follows the recommendation in issue #1656: preserve existing Cartesian and classical averaging while adding alternative representations. Added 12 classical compatibility regressions using fixed outputs captured from the pre-PR implementation. These cover default selection, explicit |
|
Equinoctial option names Renamed the choices to |
|
Portable numerical assertions Corrected the Cartesian regression test’s dependence on bitwise agreement between NumPy and C++ arithmetic. The independent NumPy comparison now permits small floating-point rounding differences, including fused multiply-add differences. Exact comparisons between native outputs remain, preserving the check that the orbital selector does not affect Cartesian behavior. |
|
Multi-spacecraft singularity coverage Added 18 regressions covering nontrivial equatorial and near-equatorial formations, including circular and near-circular members. Additional cases exercise cancellation of averaged eccentricity components, inclination components, and both together. Both representations and output interfaces are checked against independent references, including analytical cancellation cases. |
|
Observable runtime-selector transitions Replaced the singleton runtime-selector test, which could pass even when the selector change was ignored. The replacement covers all six directed transitions among classical, prograde, and retrograde averaging using a formation with distinct expected outputs. It verifies changes after initialization and after a scheduled update. Deliberately ignored or swapped selections fail every applicable case. |
|
Mathematical review, documentation, and validation Independently checked the equinoctial conversion and reconstruction for both representations, including singular and cancellation cases; no algebraic defect was found. The documentation explains the supported elliptic domain, excluded poles, undefined longitude means, and the interpretation of output velocity for unequal semimajor axes. All 266 module tests and both existing station-keeping integration cases pass locally. Captured legacy outputs remain identical, and header compilation, scoped documentation, and formatting checks pass. Validation of the combined branch on Linux and Windows remains for CI. |
schaubh
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I posted some small comments and pushed commits to address them. @zakariyaghazzol , please take a look at my commits and let me know if you agree with them.
|
Thanks, @schaubh. I went through your commits and agree with the changes. The test with multiple spacecraft makes it easier to tell if the mode switched. The barycenter and station-keeping tests passed in my Linux run too. When you get a chance, could you approve the new CI run so we can check macOS? |
schaubh
left a comment
There was a problem hiding this comment.
Thanks for reviewing my changes @zakariyaghazzol. I'll merge this PR when all the tests are successfully completed.
Description
Adds optional prograde and retrograde equinoctial mass-averaged formation barycenter evaluation through
orbitalElementType. The Cartesian and default classical-element modes still use the same calculations and output messages.The new modes mass-average orbit size, shape and tilt, and circularly average mean longitude. They calculate the reference position and velocity from the averaged equinoctial elements. The scalar is named
semiMajorAxisto distinguish it from the plane-direction vectors.The supported domain is nonradial elliptic motion. Unsupported states, excluded poles and numerically undefined longitude means raise explicit Basilisk errors.
Verification
run_all_test.py: 807 native tests passed; 13,874 Python tests passed, 459 skipped, zero failures.Skips require disabled optional features, Cargo or optional Orekit. Native Windows and enabled optional-feature configurations were not validated locally.
Documentation
Updates module usage, element definitions and limitations, and adds release-note and known-issue snippets.