chore: Migrate to numpy 2.x, pydantic 2.13, and target Python 3.12-3.14#143
Merged
Conversation
Bumps the actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/upload-artifact` from 6 to 7 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v6...v7) Updates `actions/download-artifact` from 7 to 8 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v7...v8) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
updates: - [github.com/abravalheri/validate-pyproject: v0.24.1 → v0.25](abravalheri/validate-pyproject@v0.24.1...v0.25) - [github.com/adhtruong/mirrors-typos: v1.41.0 → v1.47.0](adhtruong/mirrors-typos@v1.41.0...v1.47.0) - [github.com/astral-sh/ruff-pre-commit: v0.14.10 → v0.15.15](astral-sh/ruff-pre-commit@v0.14.10...v0.15.15) - [github.com/pre-commit/mirrors-mypy: v1.19.1 → v2.1.0](pre-commit/mirrors-mypy@v1.19.1...v2.1.0)
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 83.57% 83.66% +0.08%
==========================================
Files 47 47
Lines 3026 3036 +10
==========================================
+ Hits 2529 2540 +11
+ Misses 497 496 -1 ☔ 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
Surfaced by the mypy/ruff pre-commit bumps from #136 now that the project targets Python 3.12+. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ert03/microsim into numpy2-py312-modernization
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.
Closes #133
Closes #136
Closes #137
numpy 2.x compatibility:
xparg scipy>=1.15 added to _apply_conv_modepydantic 2.13:
Python 3.12-3.14: