Repository navigation
Conversation
interpax 0.3.16 solves the not-a-knot tridiagonal system with `jax.lax.linalg.tridiagonal_solve` instead of `lineax`, so `approx_df` works inside `jax.shard_map`. That removes the reason for the hand-written solve added in GalacticDynamics#1077, and `fit_log_spline` now returns `approx_df` directly. The interpax floor goes to 0.3.16 in galax.potential and galax.dynamics; the lock moves interpax 0.3.12 -> 0.3.16 and adds jaxkd. The shard_map test stays as the guard on the interpax path. The test that compared `fit_log_spline` with `approx_df` is dropped, since the two are now the same call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1091 +/- ##
==========================================
+ Coverage 98.20% 98.27% +0.06%
==========================================
Files 214 219 +5
Lines 8685 9019 +334
==========================================
+ Hits 8529 8863 +334
Misses 156 156 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
galax#1077 hand-wrote the not-a-knot tridiagonal solve in
fit_log_splinebecauseinterpax.approx_dfsolved throughlineax, which failed insidejax.shard_maponce the values varied over a mapped axis while the knots did not. interpax 0.3.16 (released 2026-10-22) solves that system withjax.lax.linalg.tridiagonal_solveitself, so the workaround can go.Changes
fit_log_splinereturnsinterpax.approx_df(log_r, values, "cubic2", 0, bc_type="not-a-knot"). The inlined system and then < 4special case are removed. The docstring keeps the paragraph on why the end condition is not-a-knot, and notes that theshard_mapcase works from interpax 0.3.16 on.interpax>=0.3.16in galax.potential and galax.dynamics.uv.lockmoves interpax 0.3.12 → 0.3.16, which addsjaxkdand drops interpax's ownlineaxdependency (diffrax still pulls inlineax).test_knot_derivatives_inside_shard_mapstays and now guards the interpax path.test_knot_derivatives_match_interpaxis removed, since it would compareapprox_dfwith itself. TheCubicSplineequality test stays.Checks
shard_mapfailure reproduces on interpax 0.3.12 and 0.3.15 and passes on 0.3.16.approx_dfand the 🐛 fix(potential): fit_log_spline works inside shard_map #1077 solve agree to 1e-14.gradtimes are within ~10% of each other for shapes (128,), (128, 25) and (128, 10, 25).tests/unit/potential/{harmonic,multipole_profile,tabulated_basis}: 408 passed, 5 skipped (gala not installed), 2 xfailed (Time-grid MultipoleProfilePotential raises on a batchedt, sopotential_energy(pot, orbit)fails #938). galax.dynamicstest_uniform_acceleration.pyand the interpax doctests inexamples/: pass.Follow-up (not in this PR)
eval_log_splinecould becomeinterpax.interp1d(..., "cubic", fx=..., extrap=True, even_spacing=True). That waits for f0uriest/interpax#213 to be released: today that path is ~10x slower than galax's helper, and with #213 it is ~3x faster.Related interpax PRs from the same effort: f0uriest/interpax#210 (shard_map regression test) and f0uriest/interpax#211 (
approx_dfaxis=-1fix; galax passesaxis=0, so it is unaffected).🤖 Generated with Claude Code