From ed9aa224be73098cf164b886f59221d4117c845f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:27:37 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks --- tests/test_generated_api.py | 16 ++++++++-------- tests/test_main.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_generated_api.py b/tests/test_generated_api.py index b971e026..e81eb433 100644 --- a/tests/test_generated_api.py +++ b/tests/test_generated_api.py @@ -137,7 +137,7 @@ def test_txx__season_slice_mode() -> None: res = icclim.txx(tas, slice_mode=["season", [11, 12, 1, 2]]).compute() # THEN # missing values for nov, dec of first period - np.testing.assert_array_equal(res.TXx.isel(time=0), np.NAN) + np.testing.assert_array_equal(res.TXx.isel(time=0), np.nan) np.testing.assert_array_equal(res.TXx.isel(time=1), 30.0) np.testing.assert_array_equal( res.time_bounds.isel(time=0), @@ -151,7 +151,7 @@ def test_txx__months_slice_mode() -> None: tas.loc[{"time": "2042-01-01"}] = 303.15 # 30°C 273.15 res = icclim.txx(tas, slice_mode=["months", [11, 1]]).compute() np.testing.assert_array_equal(res.TXx.isel(time=0), 30) - np.testing.assert_array_equal(res.TXx.isel(time=1), np.NAN) + np.testing.assert_array_equal(res.TXx.isel(time=1), np.nan) np.testing.assert_almost_equal(res.TXx.sel(time="2042-11"), 21.85) np.testing.assert_array_equal( res.time_bounds.isel(time=0), @@ -192,8 +192,8 @@ def test_custom_index__season_slice_mode( }, ).compute() # missing values algo applied for first and last years - np.testing.assert_almost_equal(res.pouet.isel(time=0), np.NAN) - np.testing.assert_almost_equal(res.pouet.isel(time=-1), np.NAN) + np.testing.assert_almost_equal(res.pouet.isel(time=0), np.nan) + np.testing.assert_almost_equal(res.pouet.isel(time=-1), np.nan) np.testing.assert_almost_equal(res.pouet.isel(time=1), expectation_year_1) np.testing.assert_almost_equal(res.pouet.isel(time=2), expectation_year_2) @@ -225,8 +225,8 @@ def test_custom_index_run_algos__season_slice_mode( }, ) # missing values algo applied for first and last years - np.testing.assert_almost_equal(res.pouet.isel(time=0), np.NAN) - np.testing.assert_almost_equal(res.pouet.isel(time=-1), np.NAN) + np.testing.assert_almost_equal(res.pouet.isel(time=0), np.nan) + np.testing.assert_almost_equal(res.pouet.isel(time=-1), np.nan) np.testing.assert_almost_equal(res.pouet.isel(time=1), expectation_year_1) np.testing.assert_almost_equal(res.pouet.isel(time=2), expectation_year_2) @@ -280,12 +280,12 @@ def test_custom_index_anomaly__datetime_ref_period() -> None: }, ).compute() # missing values algo applied for first and last years - np.testing.assert_almost_equal(res.anomaly.sel(time="2041"), np.NAN) + np.testing.assert_almost_equal(res.anomaly.sel(time="2041"), np.nan) np.testing.assert_almost_equal(res.anomaly.sel(time="2042"), 0) np.testing.assert_almost_equal(res.anomaly.sel(time="2043"), 0) np.testing.assert_almost_equal(res.anomaly.sel(time="2044"), 4.80645161) np.testing.assert_almost_equal(res.anomaly.sel(time="2045"), 0) - np.testing.assert_almost_equal(res.anomaly.sel(time="2046"), np.NAN) + np.testing.assert_almost_equal(res.anomaly.sel(time="2046"), np.nan) def test_custom_index_anomaly__groupby_and_resample_month() -> None: diff --git a/tests/test_main.py b/tests/test_main.py index a642c812..3d1c70e3 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -282,7 +282,7 @@ def test_index_su__djf_cf_time(self) -> None: out_file=self.OUTPUT_FILE, slice_mode=FrequencyRegistry.DJF, ) - np.testing.assert_array_equal(res.SU.isel(time=0), np.NAN) + np.testing.assert_array_equal(res.SU.isel(time=0), np.nan) np.testing.assert_array_equal(res.SU.isel(time=1), 0) # "+ 1" because DJF sampling create a december month with nans before first year np.testing.assert_array_equal(