diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a0a6c01a5..ac83b6178b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: - id: no-commit-to-branch - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.1.14" + rev: "v0.2.1" hooks: - id: ruff types: [file, python] diff --git a/lib/iris/analysis/__init__.py b/lib/iris/analysis/__init__.py index b9bb0c13b9..773e804a14 100644 --- a/lib/iris/analysis/__init__.py +++ b/lib/iris/analysis/__init__.py @@ -1577,7 +1577,7 @@ def _lazy_max_run(array, axis=-1, **kwargs): stepped_run_lengths = da.reductions.cumreduction( np.maximum.accumulate, np.maximum, - np.NINF, + -np.inf, run_totals, axis=axis, dtype=cum_sum.dtype, diff --git a/lib/iris/tests/test_cell.py b/lib/iris/tests/test_cell.py index d5d11b8ee5..9271f47670 100644 --- a/lib/iris/tests/test_cell.py +++ b/lib/iris/tests/test_cell.py @@ -131,7 +131,7 @@ def test_numpy_int_equality(self): def test_numpy_float_equality(self): dtypes = ( - np.float_, + np.float64, np.float16, np.float32, np.float64, diff --git a/lib/iris/tests/unit/plot/test_contourf.py b/lib/iris/tests/unit/plot/test_contourf.py index 64ab87f879..59fe631b67 100644 --- a/lib/iris/tests/unit/plot/test_contourf.py +++ b/lib/iris/tests/unit/plot/test_contourf.py @@ -93,7 +93,7 @@ def test_skip_contour(self): def test_apply_contour_nans(self): # Presence of nans should not prevent contours being added. cube = simple_2d() - cube.data = cube.data.astype(np.float_) + cube.data = cube.data.astype(np.float64) cube.data[0, 0] = np.nan levels = [2, 4, 6, 8]