Skip to content

fix: support xarray v2025.x#883

Merged
Zeitsperre merged 31 commits into
updates-2025from
fix-xarray-v2025
Jan 22, 2026
Merged

fix: support xarray v2025.x#883
Zeitsperre merged 31 commits into
updates-2025from
fix-xarray-v2025

Conversation

@aaronspring

@aaronspring aaronspring commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR removes xarray version pins to support v2025.x releases and fixes related compatibility issues.

Closes #880

Changes Made

Dependencies

  • Removed pin from xarray in
  • Removed xarray version pins from CI requirements files

Test Infrastructure

  • Fixed pytest-lazy-fixtures import conflict (wrong package name was being imported)
  • Removed duplicate from dependency-groups

Analysis

Breaking changes in xarray v2025.x:

  1. v2025.09.1: returns - Verified climpred uses , not affected
  2. v2025.11.0: Operations preserve attributes by default - May need doctest updates
  3. v2025.09.0: pandas 3.0 resampling changes - May need filterwarnings

Testing

  • Basic xarray 2025.1.2 operations verified working locally
  • Full CI test suite running on this branch
  • Local testing limited by netCDF4/Python 3.14 segfault on macOS

References

Zeitsperre and others added 9 commits October 21, 2025 09:39
- Remove xarray version pin (<2025.3.0) from dependencies
- Fix pytest-lazy-fixtures import conflict
- Prepare for xarray v2025 breaking changes
- Remove <2025.3.0 pin from minimum-tests.yml and maximum-tests.yml
- Allow testing with latest xarray versions
@codecov

codecov Bot commented Jan 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (updates-2025@60bf4ec). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/climpred/bootstrap.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##             updates-2025     #883   +/-   ##
===============================================
  Coverage                ?   91.51%           
===============================================
  Files                   ?       59           
  Lines                   ?     6273           
  Branches                ?        0           
===============================================
  Hits                    ?     5741           
  Misses                  ?      532           
  Partials                ?        0           

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

aaronspring and others added 5 commits January 16, 2026 20:37
- Coordinate ordering changed in xarray v2025
- Updated expected outputs in utils.py and classes.py to match new ordering
- PerfectModelEnsemble.verify: fix coordinate ordering (skill before lead)
- PerfectModelEnsemble.bootstrap: update data values for new random state
- Add explicit np.random.seed(42) for reproducibility (attempt)
pre-commit-ci Bot and others added 7 commits January 16, 2026 20:06
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@aaronspring

aaronspring commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator Author

#884 may fix src/climpred/tests/test_bootstrap.py::test_bootstrap_PM_lazy_result in py3.12 https://github.com/pangeo-data/climpred/actions/runs/21221428782/job/61056950903?pr=883

@aaronspring

Copy link
Copy Markdown
Collaborator Author

how about deprecating all below python 3.11 the same way as Xarray?

@Zeitsperre

Copy link
Copy Markdown
Collaborator

how about deprecating all below python 3.11 the same way as Xarray?

If you think that's fine, we could do that both here and in xskillscore. I'd much rather have something that is functional/reliable than something that is inconsistent across older/newer Python versions.

Avoid xarray bug with partial chunk dicts like {'iteration': 'auto'}
by only chunking non-dask arrays and object-dtype variables.
…an-centered data

The test was failing for  with  because:
- The test data is mean-centered (anomalies)
- The climatology reference = mean of observations ≈ 0 (a constant)
- pearson_r = covariance / (std_forecast * std_climatology)
- std(climatology) = 0 when data is mean-centered, causing division by zero -> NaN

This is a mathematical limitation, not a bug. The fix excludes
from the CI variance check when using  metric, while other
metrics (, ) still check all skills.
@aaronspring

Copy link
Copy Markdown
Collaborator Author

all green ticks. AWESOME @Zeitsperre

@aaronspring

Copy link
Copy Markdown
Collaborator Author

is uv.lock needed? did that spill over from my uv migration attempt?

@Zeitsperre

Copy link
Copy Markdown
Collaborator

is uv.lock needed? did that spill over from my uv migration attempt?

I think it's an artifact, actually. We could look into trying that out later, as you mentioned. I'd love to get this and the bot updates in, then we can release and make more significant changes. Thrilled to see this working as well!

@aaronspring

Copy link
Copy Markdown
Collaborator Author

deleted the AI generated md files. anything missing? anything to do here? @Zeitsperre

@Zeitsperre

Copy link
Copy Markdown
Collaborator

I'll give it a final review to be certain!

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread src/climpred/classes.py
Comment thread src/climpred/tests/test_bias_removal.py
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@Zeitsperre

Copy link
Copy Markdown
Collaborator

I'm going to do some final finagling here for the xclim/xsdba. Let's make this the final version supporting Python3.9 to save ourselves from headaches in the future.

Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
@aaronspring

Copy link
Copy Markdown
Collaborator Author

great. can be merged but not released before fixing #885

@Zeitsperre Zeitsperre merged commit 1b8857f into updates-2025 Jan 22, 2026
21 checks passed
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.

2 participants