Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Dec 5, 2023
1 parent bb2b68f commit 0e382f7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cf_xarray/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def apply_mapper(
"""

if not isinstance(key, Hashable):
if default is None:
if default is None: # type: ignore[unreachable]
raise ValueError(
"`default` must be provided when `key` is not not a valid DataArray name (of hashable type)."
)
Expand Down Expand Up @@ -858,7 +858,7 @@ def check_results(names, key):
ds = ds.reset_coords()[varnames + coords]
if isinstance(obj, DataArray):
if scalar_key:
if len(ds.variables) == 1:
if len(ds.variables) == 1: # type: ignore[unreachable]
# single dimension coordinates
assert coords
assert not varnames
Expand Down
2 changes: 1 addition & 1 deletion cf_xarray/criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
try:
import regex as re
except ImportError:
import re # type: ignore
import re # type: ignore[no-redef]

Check warning on line 10 in cf_xarray/criteria.py

View check run for this annotation

Codecov / codecov/patch

cf_xarray/criteria.py#L10

Added line #L10 was not covered by tests

from collections.abc import Mapping, MutableMapping
from typing import Any
Expand Down
2 changes: 1 addition & 1 deletion cf_xarray/tests/test_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ def test_new_standard_name_mappers() -> None:
)
assert_identical(forecast.cf.chunk({"realization": 1}), forecast.chunk({"M": 1}))
assert_identical(forecast.cf.isel({"realization": 1}), forecast.isel({"M": 1}))
assert_identical(forecast.cf.isel(**{"realization": 1}), forecast.isel(**{"M": 1}))
assert_identical(forecast.cf.isel(realization=1), forecast.isel(M=1))
assert_identical(
forecast.cf.groupby("forecast_reference_time.month").mean(),
forecast.groupby("S.month").mean(),
Expand Down

0 comments on commit 0e382f7

Please sign in to comment.