Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ci:
autofix_prs: true
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: quarterly
autoupdate_schedule: 'quarterly'
skip: []
submodules: false

Expand All @@ -24,17 +24,17 @@ repos:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
args: ["--allow-multiple-documents"]
args: [ "--allow-multiple-documents" ]
- id: debug-statements
- id: end-of-file-fixer
- id: no-commit-to-branch
- id: pretty-format-json
args: ["--autofix", "--no-ensure-ascii", "--no-sort-keys"]
args: [ "--autofix", "--no-ensure-ascii", "--no-sort-keys" ]
exclude: ".ipynb|asv.conf.json"
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.13.3"
rev: "v0.14.13"
hooks:
- id: ruff-check
args: [ "--fix" ]
Expand All @@ -43,10 +43,10 @@ repos:
types_or: [python, pyi, jupyter]

- repo: https://github.com/keewis/blackdoc
rev: v0.4.3
rev: v0.4.6
hooks:
- id: blackdoc
additional_dependencies: ["black==25.1.0"]
additional_dependencies: [ 'black==25.9.0' ]

- repo: https://github.com/PyCQA/doc8
rev: v2.0.0
Expand All @@ -62,23 +62,23 @@ repos:
]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.18.2"
rev: "v1.19.1"
hooks:
- id: mypy
exclude: "asv_bench"
additional_dependencies: [
# Type stubs
types-python-dateutil,
types-setuptools,
types-PyYAML,
types-pytz,
typing-extensions,
'types-python-dateutil',
'types-setuptools',
'types-PyYAML',
'types-pytz',
'typing-extensions',
# Dependencies that are typed
numpy,
'numpy',
]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.34.0
rev: 0.36.0
hooks:
- id: check-github-workflows
- id: check-readthedocs
17 changes: 17 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ Changelog History
=================


xskillscore v0.0.28 (2025-01-19)
--------------------------------

Bug Fixes
~~~~~~~~~
- Fixed a bug introduced in v0.0.27 where `numpy` v1.x support was broken for some
algorithms. (:pr:`431`) `Trevor James Smith`_.
Comment thread
Zeitsperre marked this conversation as resolved.
- Removed all `numpy.atleast_1d()` calls that were causing numerical differences in
p-value calculations with `numpy` v2.x and fixed several doctest expected outputs.
(:pr:`440`) `Aaron Spring`_.

Internal Changes
~~~~~~~~~~~~~~~~
- Pinned `numpy` below v2.4 due to breaking API changes. (:pr:`441`) `Trevor James Smith`_
- Adjusted tests to adapt to new `xarray` attributes preservation
behaviour. (:pr:`441`) `Trevor James Smith`_

xskillscore v0.0.27 (2025-07-14)
--------------------------------

Expand Down
2 changes: 1 addition & 1 deletion ci/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- cftime
- dask-core >=2023.4.0
- numba >=0.57
- numpy >=1.24
- numpy >=1.24,<2.4
- properscoring
- scikit-learn
- scipy >=1.10.0
Expand Down
3 changes: 2 additions & 1 deletion ci/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ dependencies:
- ipython
- matplotlib-base
- nbsphinx
- numpy >=1.24
- numba >=0.57
- numpy >=1.24,<2.4
- properscoring
- scikit-learn
- scipy >=1.10
Expand Down
2 changes: 1 addition & 1 deletion ci/docs_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- dask-core >=2023.4.0
- doc8
- numba >=0.57
- numpy >=1.24
- numpy >=1.24,<2.4
- properscoring
- ipykernel
- jupyterlab
Expand Down
3 changes: 2 additions & 1 deletion ci/minimum-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ dependencies:
- coveralls
- dask-core >=2023.4.0
- matplotlib-base
- numpy >=1.24
- numba >=0.57
- numpy >=1.24,<2.4
- properscoring
- pytest
- pytest-cov
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "xskillscore"
dependencies = [
"dask[array] >=2023.4.0",
"numpy >=1.24",
"numpy >=1.24,<2.4",
"properscoring",
"scipy >=1.10",
"statsmodels",
Expand Down Expand Up @@ -40,6 +40,7 @@ test = [
"xskillscore[accel]",
"cftime",
"matplotlib",
"packaging",
"pre-commit",
"pytest",
"pytest-cov",
Expand Down
3 changes: 2 additions & 1 deletion xskillscore/core/probabilistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
except ImportError:
from scipy.stats import rankdata

# Remove when `numpy` v1.x support is dropped
try:
from numpy import trapezoid
except ImportError:
from numpy import trapz as trapezoid # type: ignore[no-redef]
from numpy import trapz as trapezoid # type: ignore[attr-defined,no-redef]

__all__ = [
"brier_score",
Expand Down
10 changes: 9 additions & 1 deletion xskillscore/tests/test_probabilistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest
import xarray as xr
from dask import is_dask_collection
from packaging.version import Version
from scipy.stats import norm
from sklearn.calibration import calibration_curve
from sklearn.metrics import roc_auc_score, roc_curve
Expand Down Expand Up @@ -64,10 +65,17 @@ def assert_chunk(actual, chunk_bool):


def assert_keep_attrs(actual, o, keep_attrs):
"""check that actual kept attributes only if keep_attrs==True."""
"""
check that actual kept attributes only if keep_attrs==True.

For newer xarray versions, attributes are preserved by default.
"""
if keep_attrs:
assert actual.attrs == o.attrs
else:
if Version(xr.__version__) >= Version("2025.11.0"):
if "source" in actual.attrs:
del actual.attrs["source"]
assert actual.attrs == {}


Expand Down