pybamm-team / PyBaMM

Fast and flexible physics-based battery models in Python
https://www.pybamm.org/
BSD 3-Clause "New" or "Revised" License
1.12k stars 547 forks source link

bug: use direct casadi bspline function for 1D & 2D cubic interp #4572

Closed martinjrobins closed 2 weeks ago

martinjrobins commented 2 weeks ago

Description

Instead of using the casadi plugin system, use direct bspline function for 1D and 2D cubic interpolation.

I didn't implement 3D cubic interpolation because (a) scipy has no functions for bspline interpolation in 3D, and (b) we only test 3D linear interpolation so didn't think it was neccessary.

Fixes #4570

Type of change

Key checklist:

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.27%. Comparing base (9a479cf) to head (d1977b6). Report is 1 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #4572 +/- ## =========================================== - Coverage 99.29% 99.27% -0.02% =========================================== Files 300 300 Lines 22776 22795 +19 =========================================== + Hits 22615 22630 +15 - Misses 161 165 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kratman commented 2 weeks ago

@martinjrobins Thanks, I am testing it now before I review