diff --git a/cf_xarray/accessor.py b/cf_xarray/accessor.py index 08bc28ea..29d63e31 100644 --- a/cf_xarray/accessor.py +++ b/cf_xarray/accessor.py @@ -24,7 +24,6 @@ import xarray as xr from xarray import DataArray, Dataset -from xarray.core.arithmetic import SupportsArithmetic from xarray.core.groupby import GroupBy from xarray.core.resample import Resample from xarray.core.rolling import Coarsen, Rolling @@ -997,7 +996,7 @@ def _get_possible(accessor, criteria): return _get_possible(obj.cf, y_criteria) -class _CFWrappedClass(SupportsArithmetic): +class _CFWrappedClass: """ This class is used to wrap any class in _WRAPPED_CLASSES. """ diff --git a/cf_xarray/tests/test_accessor.py b/cf_xarray/tests/test_accessor.py index 8860b58a..c3f7005a 100644 --- a/cf_xarray/tests/test_accessor.py +++ b/cf_xarray/tests/test_accessor.py @@ -1524,15 +1524,14 @@ def test_groupby_special_ops() -> None: grouped = airds.groupby_bins("lat", np.arange(20, 50, 10)) # __iter__ - for (label, group), (cflabel, cfgroup) in zip(grouped, cfgrouped, strict=False): + for (label, group), (cflabel, cfgroup) in zip(grouped, cfgrouped, strict=True): assert label == cflabel assert_identical(group, cfgroup) # arithmetic # TODO: Extremely buggy! # 1. cfgrouped - cfgrouped.mean() raises RecursionError - # 2. use_flox=True doesn't preserve attributes for some reason - with xr.set_options(keep_attrs=True): + with xr.set_options(keep_attrs=True, use_flox=True): expected = grouped - grouped.mean() actual = grouped - cfgrouped.mean() assert_identical(expected, actual)