Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
=======================================
Coverage ? 97.31%
=======================================
Files ? 6
Lines ? 261
Branches ? 0
=======================================
Hits ? 254
Misses ? 7
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Dense solutions allocate interpolation buffers up to the solve's
max_steps, which can be much larger than needed for later evaluation. Adddiffraxtra.subsample(sol, max_steps=...)to compact that storage after integration.If the accepted steps fit, preserve the original knots and interpolation exactly while trimming padding. Otherwise, sample the original dense curve and its derivatives on a uniform grid and fit cubic Hermite pieces. The returned object remains a
diffrax.Solution, with only its interpolation replaced usingeqx.tree_at; saved values, statistics, and solver state retain their original meaning. A shared packed coefficient layout letslax.condselect trimming or resampling under JIT, including mixed batches.Resampling introduces additional interpolation error and does not inherit the solver's tolerance guarantee. The documentation explains the convergence check, static size requirement, and scope for smooth ODEs.
Validation:
1e-7 kpc.-jax.grad(potential). The example only adds matplotlib; it has no galax or unxt dependency. Solving, checking the compact solutions, and plotting are separate helpers, with a smallmainthat assembles the figure. Harmonic trimming from 4096 to 32 slots preserves evaluations exactly while reducing dense storage from 3.18 MB to 24.9 KB. The Kepler example shows convergence with increasing budgets and exact preservation once all 62 accepted steps fit.Orbit comparisons:
Left: original and compacted orbits. Right: position error relative to the original dense solution. Increasing the resampling budget reduces interpolation error; once all accepted steps fit, trimming preserves the original curve exactly. Exact-zero errors are plotted at a floor of
1e-15 kpcon the logarithmic axes.