Skip to content

Conversation

@Sfonxu
Copy link
Collaborator

@Sfonxu Sfonxu commented Jul 23, 2025

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:

  • Replace interpolate as in shallow-water examples
  • Make interpolate JIT-compilable
  • Look for other places where such functions are defined
  • Look into replacing interpolate in those places

@slayoo
Copy link
Member

slayoo commented Jul 23, 2025

* [ ]  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:

@codecov
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

❌ Patch coverage is 77.35849% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.74%. Comparing base (a921acc) to head (5b9f157).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
PyMPDATA/impl/formulae_divide.py 0.00% 21 Missing ⚠️
PyMPDATA/impl/indexers.py 88.88% 2 Missing ⚠️
PyMPDATA/solver.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #612      +/-   ##
==========================================
- Coverage   92.69%   90.74%   -1.96%     
==========================================
  Files          39       31       -8     
  Lines        1697     1566     -131     
==========================================
- Hits         1573     1421     -152     
- Misses        124      145      +21     

☔ 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.

@Sfonxu
Copy link
Collaborator Author

Sfonxu commented Jul 23, 2025

It seems that, according to numba docs, the argument axis in np.diff is not supported.

@slayoo
Copy link
Member

slayoo commented Jul 24, 2025

It seems that, according to numba docs, the argument axis in np.diff is not supported.

IIUC, usage of np.diff is anyhow out of question here as it allocates new memory

@github-actions
Copy link

Stale pull request message

@Sfonxu Sfonxu removed the no-activity label Nov 2, 2025
@Sfonxu Sfonxu force-pushed the interpolation_refactor branch from f667bd5 to 5b9f157 Compare November 28, 2025 18:21
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