Skip to content

Commit 8322e94

Browse files
committed
Fix mypy issues
1 parent b5eb2b8 commit 8322e94

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/test_axis.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,16 @@ def test_returns_dataset_dimension_coordinate_vars_using_common_var_names(
195195
)
196196

197197
result = get_dim_coords(ds, "X")
198-
assert result.identical(ds["lon"])
198+
xr.testing.assert_identical(result, ds["lon"])
199199

200200
result = get_dim_coords(ds, "Y")
201-
assert result.identical(ds["lat"])
201+
xr.testing.assert_identical(result, ds["lat"])
202202

203203
result = get_dim_coords(ds, "T")
204-
assert result.identical(ds["time"])
204+
xr.testing.assert_identical(result, ds["time"])
205205

206206
result = get_dim_coords(ds, "Z")
207-
assert result.identical(ds["lev"])
207+
xr.testing.assert_identical(result, ds["lev"])
208208

209209
def test_returns_dataset_dimension_coordinate_vars_using_axis_attr(self):
210210
# For example, E3SM datasets might have "ilev" and "lev" dimensions
@@ -214,7 +214,7 @@ def test_returns_dataset_dimension_coordinate_vars_using_axis_attr(self):
214214
coords={"ilev": self.ds_axis.ilev, "lev": self.ds_axis.lev}
215215
)
216216

217-
assert result.identical(expected)
217+
xr.testing.assert_identical(result, expected)
218218

219219
def test_returns_dataset_dimension_coordinate_vars_using_standard_name_attr(self):
220220
# For example, E3SM datasets might have "ilev" and "lev" dimensions
@@ -223,7 +223,7 @@ def test_returns_dataset_dimension_coordinate_vars_using_standard_name_attr(self
223223
result = get_dim_coords(self.ds_sn, "Z")
224224
expected = xr.Dataset(coords={"ilev": self.ds_sn.ilev, "lev": self.ds_sn.lev})
225225

226-
assert result.identical(expected)
226+
xr.testing.assert_identical(result, expected)
227227

228228
def test_returns_dataarray_dimension_coordinate_var_using_axis_attr(self):
229229
result = get_dim_coords(self.ds_axis.hyai, "Z")

xcdat/temporal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,8 +1398,8 @@ def _drop_incomplete_djf(self, dataset: xr.Dataset) -> xr.Dataset:
13981398
# method concatenates the time dimension to non-time dimension data
13991399
# vars, which is not a desired behavior.
14001400
ds = dataset.copy()
1401-
ds_time = ds.get([v for v in ds.data_vars if self.dim in ds[v].dims])
1402-
ds_no_time = ds.get([v for v in ds.data_vars if self.dim not in ds[v].dims])
1401+
ds_time = ds[[v for v in ds.data_vars if self.dim in ds[v].dims]]
1402+
ds_no_time = ds[[v for v in ds.data_vars if self.dim not in ds[v].dims]]
14031403

14041404
start_year, end_year = (
14051405
ds[self.dim].dt.year.values[0],

0 commit comments

Comments
 (0)