From 8c73b025e54f7ab29163d8efafc28edc9cc587f7 Mon Sep 17 00:00:00 2001 From: Pascal Bourgault Date: Tue, 3 Sep 2024 11:24:58 -0400 Subject: [PATCH] add new fields to dask access test --- xarray/tests/test_accessor_dt.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xarray/tests/test_accessor_dt.py b/xarray/tests/test_accessor_dt.py index 315830eb8bb..8e8821267aa 100644 --- a/xarray/tests/test_accessor_dt.py +++ b/xarray/tests/test_accessor_dt.py @@ -143,10 +143,14 @@ def test_strftime(self) -> None: ) @requires_cftime - @pytest.mark.parametrize("calendar,expected", [('standard', 366), ('noleap', 365), ('360_day', 360), ('all_leap', 366)]) + @pytest.mark.parametrize( + "calendar,expected", + [("standard", 366), ("noleap", 365), ("360_day", 360), ("all_leap", 366)], + ) def test_days_in_year(self, calendar, expected) -> None: assert ( - self.data.convert_calendar(calendar, align_on='year').time.dt.days_in_year == expected + self.data.convert_calendar(calendar, align_on="year").time.dt.days_in_year + == expected ).all() @requires_cftime @@ -154,7 +158,7 @@ def test_decimal_year(self) -> None: h_per_yr = 366 * 24 np.testing.assert_array_equal( self.data.time.dt.decimal_year[0:3], - [2000, 2000 + 1 / h_per_yr, 2000 + 2 / h_per_yr] + [2000, 2000 + 1 / h_per_yr, 2000 + 2 / h_per_yr], ) def test_not_datetime_type(self) -> None: @@ -192,6 +196,8 @@ def test_not_datetime_type(self) -> None: "is_year_start", "is_year_end", "is_leap_year", + "days_in_year", + "decimal_year", ], ) def test_dask_field_access(self, field) -> None: