Skip to content

Fix FiniteDifferences.replace_params losing accuracy - #162

Merged
astanziola merged 1 commit into
mainfrom
fix/fd-accuracy-replace-params
Mar 22, 2026
Merged

astanziola merged 1 commit into
mainfrom
fix/fd-accuracy-replace-params

Conversation

@astanziola

Copy link
Copy Markdown
Member

Summary

  • OnGrid.replace_params() was inherited by FiniteDifferences but only passed (new_params, domain), dropping the accuracy static field (silently reverting to default 8)
  • This caused lax.scan pytree metadata mismatches when users created FD fields with non-default accuracy
  • Override replace_params in FiniteDifferences to preserve accuracy

Fixes the jaxdf side of ucl-bug/jwave#224.

Added parametrized unit tests and a lax.scan integration test to prevent regression.

@astanziola
astanziola merged commit 5ccc2be into main Mar 22, 2026
7 checks passed
@codecov

codecov Bot commented Mar 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.45%. Comparing base (5150d6d) to head (fb54866).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #162      +/-   ##
==========================================
+ Coverage   93.43%   93.45%   +0.01%     
==========================================
  Files          15       15              
  Lines         945      947       +2     
==========================================
+ Hits          883      885       +2     
  Misses         62       62              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant