Skip to content
forked from pydata/xarray

Commit 583a3d2

Browse files
committed
fix mypy
1 parent 699c3b8 commit 583a3d2

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

xarray/tests/test_groupby.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_multi_index_groupby_sum() -> None:
154154

155155

156156
@requires_pandas_ge_2_2
157-
def test_multi_index_propagation():
157+
def test_multi_index_propagation() -> None:
158158
# regression test for GH9648
159159
times = pd.date_range("2023-01-01", periods=4)
160160
locations = ["A", "B"]
@@ -2289,7 +2289,7 @@ def test_resample_origin(self) -> None:
22892289
times = pd.date_range("2000-01-01T02:03:01", freq="6h", periods=10)
22902290
array = DataArray(np.arange(10), [("time", times)])
22912291

2292-
origin = "start"
2292+
origin: Literal["start"] = "start"
22932293
actual = array.resample(time="24h", origin=origin).mean()
22942294
expected = DataArray(array.to_series().resample("24h", origin=origin).mean())
22952295
assert_identical(expected, actual)
@@ -2694,7 +2694,7 @@ def test_default_flox_method() -> None:
26942694

26952695
@requires_cftime
26962696
@pytest.mark.filterwarnings("ignore")
2697-
def test_cftime_resample_gh_9108():
2697+
def test_cftime_resample_gh_9108() -> None:
26982698
import cftime
26992699

27002700
ds = Dataset(
@@ -3044,7 +3044,7 @@ def test_gappy_resample_reductions(reduction):
30443044
assert_identical(expected, actual)
30453045

30463046

3047-
def test_groupby_transpose():
3047+
def test_groupby_transpose() -> None:
30483048
# GH5361
30493049
data = xr.DataArray(
30503050
np.random.randn(4, 2),
@@ -3104,7 +3104,7 @@ def test_lazy_grouping(grouper, expect_index):
31043104

31053105

31063106
@requires_dask
3107-
def test_lazy_grouping_errors():
3107+
def test_lazy_grouping_errors() -> None:
31083108
import dask.array
31093109

31103110
data = DataArray(
@@ -3130,15 +3130,15 @@ def test_lazy_grouping_errors():
31303130

31313131

31323132
@requires_dask
3133-
def test_lazy_int_bins_error():
3133+
def test_lazy_int_bins_error() -> None:
31343134
import dask.array
31353135

31363136
with pytest.raises(ValueError, match="Bin edges must be provided"):
31373137
with raise_if_dask_computes():
31383138
_ = BinGrouper(bins=4).factorize(DataArray(dask.array.arange(3)))
31393139

31403140

3141-
def test_time_grouping_seasons_specified():
3141+
def test_time_grouping_seasons_specified() -> None:
31423142
time = xr.date_range("2001-01-01", "2002-01-01", freq="D")
31433143
ds = xr.Dataset({"foo": np.arange(time.size)}, coords={"time": ("time", time)})
31443144
labels = ["DJF", "MAM", "JJA", "SON"]
@@ -3147,7 +3147,7 @@ def test_time_grouping_seasons_specified():
31473147
assert_identical(actual, expected.reindex(season=labels))
31483148

31493149

3150-
def test_multiple_grouper_unsorted_order():
3150+
def test_multiple_grouper_unsorted_order() -> None:
31513151
time = xr.date_range("2001-01-01", "2003-01-01", freq="MS")
31523152
ds = xr.Dataset({"foo": np.arange(time.size)}, coords={"time": ("time", time)})
31533153
labels = ["DJF", "MAM", "JJA", "SON"]
@@ -3169,14 +3169,14 @@ def test_multiple_grouper_unsorted_order():
31693169
coords={"x": [0, 1], "y": [0, 1, 2]},
31703170
dims=["x", "y", "z"],
31713171
)
3172-
actual = b.groupby(
3172+
actual2 = b.groupby(
31733173
x=UniqueGrouper(labels=[1, 0]), y=UniqueGrouper(labels=[2, 0, 1])
31743174
).sum()
3175-
expected = b.reindex(x=[1, 0], y=[2, 0, 1]).transpose("z", ...)
3176-
assert_identical(actual, expected)
3175+
expected2 = b.reindex(x=[1, 0], y=[2, 0, 1]).transpose("z", ...)
3176+
assert_identical(actual2, expected2)
31773177

31783178

3179-
def test_groupby_multiple_bin_grouper_missing_groups():
3179+
def test_groupby_multiple_bin_grouper_missing_groups() -> None:
31803180
from numpy import nan
31813181

31823182
ds = xr.Dataset(
@@ -3253,7 +3253,7 @@ def test_shuffle_by(chunks, expected_chunks):
32533253

32543254

32553255
@requires_dask
3256-
def test_groupby_dask_eager_load_warnings():
3256+
def test_groupby_dask_eager_load_warnings() -> None:
32573257
ds = xr.Dataset(
32583258
{"foo": (("z"), np.arange(12))},
32593259
coords={"x": ("z", np.arange(12)), "y": ("z", np.arange(12))},

0 commit comments

Comments
 (0)