Add dedicated interpolate function
This PR is a first in series of PRs of API refactoring described in #510.
The aim is to replace repeated definitions of interpolate around the code to a single function in PyMPDATA.impl.
Current tasks:
- [x] Replace interpolate as in shallow-water examples
- [x] Make
interpolateJIT-compilable - [ ] Look for other places where such functions are defined
- [ ] Look into replacing interpolate in those places
* [ ] Look for other places where such functions are defined * [ ] Look into replacing interpolate in other places, such as `Shipway and Hill (2012)`
The interpolation happens only when advecting momentum. Shipway and Hill (2012) example features only vapour mass advection, so it is not relevant. Other locations where we can refactor the interpolation code are:
- https://github.com/open-atmos/PyMPDATA/blob/a921acca90743d498c98e63971bf12b391fb0bf4/examples/PyMPDATA_examples/burgers_equation/burgers_equation.py#L40
- https://github.com/open-atmos/PyMPDATA/blob/a921acca90743d498c98e63971bf12b391fb0bf4/examples/PyMPDATA_examples/Jaruga_et_al_2015/fig19.ipynb#L347
- https://github.com/open-atmos/PyMPDATA/blob/a921acca90743d498c98e63971bf12b391fb0bf4/examples/PyMPDATA_examples/Jarecka_et_al_2015/simulation.py#L40
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 92.93%. Comparing base (ed8d8c1) to head (559bd76).
:warning: Report is 3 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #612 +/- ##
==========================================
+ Coverage 92.69% 92.93% +0.23%
==========================================
Files 39 40 +1
Lines 1697 1754 +57
==========================================
+ Hits 1573 1630 +57
Misses 124 124
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
It seems that, according to numba docs, the argument axis in np.diff is not supported.
It seems that, according to
numbadocs, the argumentaxisinnp.diffis not supported.
IIUC, usage of np.diff is anyhow out of question here as it allocates new memory
Stale pull request message