Skip to content

Comments

Move FiniteDiffDerivative to test utils, remove from public API#2094

Open
dpanici wants to merge 5 commits intomasterfrom
dp/remove-findif
Open

Move FiniteDiffDerivative to test utils, remove from public API#2094
dpanici wants to merge 5 commits intomasterfrom
dp/remove-findif

Conversation

@dpanici
Copy link
Collaborator

@dpanici dpanici commented Feb 18, 2026

No description provided.

@dpanici dpanici requested review from a team, YigitElma, ddudt, f0uriest, rahulgaur104 and unalmis and removed request for a team February 18, 2026 15:22
@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

Memory benchmark result

|               Test Name                |      %Δ      |    Master (MB)     |      PR (MB)       |    Δ (MB)    |    Time PR (s)     |  Time Master (s)   |
| -------------------------------------- | ------------ | ------------------ | ------------------ | ------------ | ------------------ | ------------------ |
  test_objective_jac_w7x                 |    1.18 %    |     3.888e+03      |     3.934e+03      |    45.87     |       40.47        |       36.53        |
  test_proximal_jac_w7x_with_eq_update   |   -1.77 %    |     6.640e+03      |     6.523e+03      |   -117.26    |       166.64       |       161.38       |
  test_proximal_freeb_jac                |   -0.08 %    |     1.322e+04      |     1.321e+04      |    -11.13    |       85.32        |       83.00        |
  test_proximal_freeb_jac_blocked        |   -0.35 %    |     7.510e+03      |     7.483e+03      |    -26.59    |       75.48        |       73.56        |
  test_proximal_freeb_jac_batched        |   -0.39 %    |     7.507e+03      |     7.478e+03      |    -29.23    |       73.86        |       72.86        |
  test_proximal_jac_ripple               |    1.66 %    |     3.499e+03      |     3.558e+03      |    58.19     |       67.47        |       66.06        |
  test_proximal_jac_ripple_bounce1d      |    1.39 %    |     3.544e+03      |     3.593e+03      |    49.29     |       76.71        |       77.02        |
  test_eq_solve                          |    0.18 %    |     2.027e+03      |     2.031e+03      |     3.67     |       94.51        |       94.87        |

For the memory plots, go to the summary of Memory Benchmarks workflow and download the artifact.


from abc import ABC, abstractmethod

import jax
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think during the dev meeting, we decided to keep the backend flexible for other autodiff libraries, so I think the conditional if use_jax is still useful. To be honest, I think that is a very distant future (so not very important for now) but everywhere in the code, we omit importing jax directly, so for consistency, having the conditional is better imo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right sorry, I will revert that

@dpanici dpanici requested a review from YigitElma February 19, 2026 16:19
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.53%. Comparing base (29c7877) to head (6f3290f).

Files with missing lines Patch % Lines
desc/derivatives.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2094    +/-   ##
========================================
  Coverage   94.52%   94.53%            
========================================
  Files         102      102            
  Lines       28785    28654   -131     
========================================
- Hits        27210    27087   -123     
+ Misses       1575     1567     -8     
Files with missing lines Coverage Δ
desc/derivatives.py 94.54% <66.66%> (-0.48%) ⬇️

... and 3 files with indirect coverage changes

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

Copy link
Collaborator

@ddudt ddudt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think we could remove the FiniteDiffDerivative class completely and replace it with something simpler, since it is only used in the testing functions. But this is fine for now.

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.

3 participants