Test against minimum dependencies, remove old deps#2301
Test against minimum dependencies, remove old deps#2301VeckoTheGecko merged 20 commits intoParcels-code:v4-devfrom
Conversation
74504b9 to
6979d45
Compare
…into minimum-deps
Let's pin numpy >2.1.0 and also have the other packages be more recent. Let's scope this PR to not touch code, and just focus on the environments and CI. We can discuss/explore policy or adherance to SPEC0 in another issues/PRs (+ I would like some time to discuss with other maintainers to see how they handle SPEC0 :) ). Can we do the following as well in this PR?:
|
|
@VeckoTheGecko Sounds good, thanks for your feedback. The notebook was removed as per your comment in #2292, since this notebook was the only place remaining in Parcels with a SciPy dependency. Can do on the rest! |
Ah woops! I meant completely remove the dependency rather than moving it to the notebook environment :)) . If you could leave the notebook that would be great |
This reverts commit cbd71d7. new file: docs/examples/tutorial_peninsula_AvsCgrid.ipynb
…into minimum-deps
|
@VeckoTheGecko I think I've addressed all the comments now and things may be ready to go - let me know if there's anything missing! |
Matplotlib, trajan, platformdirs, and pytest do not need to be in the released verion. Let's use this recipe.yml as the universal source of truth as we develop v4
This reverts commit 0b18cf5.
726198c to
b5b3712
Compare
|
This is awesome 🤩 - thanks @andrew-s28 🚀 |
Co-authored-by: Vecko <36369090+VeckoTheGecko@users.noreply.github.com>
Fixes #2286, fixes #2292, fixes #2304
Finding the minimum dependencies that pass the tests was a little bit tricky. It turns out that, since the dependencies aren't pinned for the Python 3.11 tests, anything below NumPy 2.3.3 isn't currently being tested.
When I tried to use NumPy 1.x (even the most recent 1.26.4), the tests fail with 109 errors. Most of these seem to be caused by changes in how NumPy handles casting array values, which I think changed with NumPy 2.x (but I couldn't find a super defnitive PR over in the NumPy repo). However, even at NumPy 2.0.x the tests fail with 4 errors, still caused by some minor casting issues. Finally, using NumPy 2.1.0, all the tests pass.
Pinning NumPy to 2.1.0 is above the minimum shown in SPEC0, and forces several other dependencies to have more recent minimum versions. Currently I have this as a draft PR to determine how best to handle this. For example, if these are the minimum versions that pass tests, should the minimums in the core dependencies section also be updated? Should the tests be modified?
Minimum reproducible examples are shown in the drop downs below. Environment details for
test-py311andtest-minimumcan be found in the attached files (or by runningpixi list -e test-py311andpixi list -e test-minimum).test-minimum.txt
test-py311.txt
Minimum Reproducible Example
I used
uvto run the test script, which was easier for quick demonstration purposes:You should see them each fail on one of the two print lines.
Running Test Suite with Different NumPy Versions
In order to reproduce the tests failing, you can replace all of the dependencies under the[feature.minimum.dependencies]section with eithernumpy = "==1.26.4"ornumpy = "==2.0.2", then run the tests as usual:EDIT VeckoTheGecko: Using
fixes #issue_numberso that issues are automatically closed on merge