chore: Migrate to numpy 2.x, pydantic 2.13, and target Python 3.12-3.14#143
Open
tlambert03 wants to merge 13 commits into
Open
chore: Migrate to numpy 2.x, pydantic 2.13, and target Python 3.12-3.14#143tlambert03 wants to merge 13 commits into
tlambert03 wants to merge 13 commits into
Conversation
numpy 2.x compatibility: - _simple_psf: cast 0-d xarray bounds to float before np.linspace (numpy>=2 __array_wrap__ rewraps into a mismatched Variable) - fft/convolve: accept (and ignore) the `xp` arg scipy>=1.15 added to _apply_conv_mode - _data_array/simulation: coerce jax arrays to contiguous numpy before zarr write (numcodecs uses np.array(copy=False), strict on numpy>=2) - spectrum: np.trapz -> np.trapezoid (removed in numpy 2.0) - mypy-under-numpy-2 cleanups; ignore xarray's import-time timedelta warning pydantic 2.13: - space: convert deprecated classmethod-style model_validator(mode="after") to an instance method Python 3.12-3.14: - requires-python >=3.12; CI matrix -> 3.12/3.13/3.14; classifiers updated - drop dm-tree (replace its sole tree.map_structure use in vendored xarray_jax with a local helper, mirroring upstream) - per-python min pins for compiled deps (numpy/scipy/tensorstore/pydantic/ matplotlib) reflecting first cp31x wheels; pyopengl-accelerate gated <3.14 - test_docs: give exec() a shared namespace (PEP 667 ended locals leak on 3.13) - skip matplotlib plotting on 3.14 (upstream ax.plot deepcopy recursion) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #143 +/- ##
===========================================
+ Coverage 60.58% 83.66% +23.07%
===========================================
Files 47 47
Lines 3032 3036 +4
===========================================
+ Hits 1837 2540 +703
+ Misses 1195 496 -699 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Added a constraint for pillow to require version >=11.3.0 for Python 3.14 and above in pyproject.toml. - Updated uv.lock to reflect the new pillow versioning, including separate entries for versions 11.2.1 and 12.2.0 based on Python version. - Modified _client.py to handle HTTPError properly when fetching Supabase URL and key.
- uv.lock: full upgrade so transitive deps (pandas, etc.) move to versions shipping cp314 wheels (old pins source-built and failed on linux/windows 3.14) - pyproject: ignore ResourceWarning / PytestUnraisableExceptionWarning — py3.14's GC surfaces unclosed sockets from third-party network clients (supabase/s3fs) as fatal warnings under filterwarnings=error - tests/_util: close the internet-check socket (another leaked-socket source) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nned 0.45.3) The full lock upgrade bumped griffe-fieldz to 0.5.0, which imports DocstringAttribute from griffe (only in newer griffe), breaking the strict mkdocs build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
supabase>=2.31 passes now-deprecated timeout/verify/proxy params to its postgrest client, which filterwarnings=error promoted to fatal errors in every COSEM test (the query itself works fine outside pytest). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Hypothesis: coverage's C tracer exits non-zero at interpreter teardown on Windows with the bumped C-extensions (jax/torch/tensorstore), despite all tests passing. sys.monitoring avoids the C tracer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…zeEx culprit on Windows
The culprit was identified as tensorstore's S3/HTTP transport crashing at interpreter shutdown on Windows (google/tensorstore#275), now handled by the version pin + matrix exclude. The diagnostic backend-import step is no longer needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tlambert03
commented
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
numpy 2.x compatibility:
xparg scipy>=1.15 added to _apply_conv_modepydantic 2.13:
Python 3.12-3.14: