P2.7 Dissipative forces: backend test scaffold (migration deferred to Pspecial)#897
Closed
jobovy wants to merge 1 commit into
Closed
P2.7 Dissipative forces: backend test scaffold (migration deferred to Pspecial)#897jobovy wants to merge 1 commit into
jobovy wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/backends #897 +/- ##
==============================================
Coverage 99.92% 99.92%
==============================================
Files 228 228
Lines 34213 34213
Branches 712 723 +11
==============================================
Hits 34186 34186
Misses 27 27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
DissipativeForce / planarDissipativeForce / ChandrasekharDynamicalFrictionForce / FDMDynamicalFrictionForce. Establishes the velocity-dependent-force convention (forces take v=[vR,vT,vz]). No compute methods migrated: every force compute path routes through scipy.special.erf/sici, a scipy.interpolate sigmar spline, a mutable input-hash cache, and data-dependent branching -- all deferred to the later scipy.special (Pspecial) router. Adds tests/test_backend_dissipative.py pinning the numpy path + velocity convention and documenting the deferred jax/ torch differentiability via strict xfail. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2ca9833 to
e0d6567
Compare
Owner
Author
|
Closing per review: the dissipative-forces test scaffold on its own isn't worth merging. The real DissipativeForce/ChandrasekharDynamicalFriction/FDMDynamicalFriction namespace-swap (P2.7) will be done as a proper migration after Pspecial lands (some of these depend on special functions), and the tests will go in with that work. Superseded by the upcoming post-Pspecial dissipative migration. |
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.
Part of the P2.x series (→ #892). Dissipative / velocity-dependent forces (
f=f(x,v)).Outcome (conservative, by design): zero compute methods migrated — every force path in ChandrasekharDynamicalFrictionForce and FDMDynamicalFrictionForce irreducibly uses scipy.special.erf/sici + a scipy.interpolate sigmar spline + a mutable input-hash cache + data-dependent branching, all out of scope until the Pspecial backend router. No source files changed → numpy path byte-identical by construction.
Deliverable:
tests/test_backend_dissipative.py— 6 passed, 2 strict-xfail. Establishes thev=[vR,vT,vz]calling convention +_cached_force*{...}factoring + below-minr-zero branch, pins the numpy values as a regression guard, and documents (xfail) thatjax.gradcurrently raisesTracerArrayConversionError(auto-flips to PASS once Pspecial + a cache/branching refactor land).Follow-up: after Pspecial provides backend erf/sici and a backend-friendly sigmar, refactor the cache (
gate on xp is numpy) + branches (xp.where), then migrate_calc_force+ add real parity/grad tests. (This is also "route 2" — the C-STM dissipative Jacobian — on the variational side.)🤖 Generated with Claude Code