Skip to content

Commit

Permalink
pre-commit update
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Apr 2, 2022
1 parent 228ee4a commit 062f9d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ ci:
repos:
# isort should run before black as black sometimes tweaks the isort output
- repo: https://github.com/timothycrosley/isort
rev: 5.9.3
rev: 5.10.1
hooks:
- id: isort
files: .+\.py$

# https://github.com/python/black#version-control-integration
- repo: https://github.com/python/black
rev: 21.7b0
rev: 22.3.0
hooks:
- id: black

Expand All @@ -21,7 +21,7 @@ repos:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
rev: v0.942
hooks:
- id: mypy
additional_dependencies: [types-all]
Expand Down
4 changes: 2 additions & 2 deletions cf_xarray/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ def _process_signature(
def _rewrite_values(
self,
kwargs,
key_mappers: Mapping[str, tuple[Mapper, ...]],
key_mappers: MutableMapping[str, tuple[Mapper, ...]],
var_kws: tuple[str, ...],
):
"""
Expand All @@ -1138,7 +1138,7 @@ def _rewrite_values(

# allow multiple return values here.
# these are valid for .sel, .isel, .coarsen
all_mappers = ChainMap(
all_mappers = ChainMap( # type: ignore
key_mappers,
dict.fromkeys(var_kws, (_get_all,)),
)
Expand Down
4 changes: 2 additions & 2 deletions cf_xarray/tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ def test_percent_units():
@pytest.mark.xfail(reason="not supported by pint, yet: hgrecco/pint#1295")
def test_udunits_power_syntax():
"""Test that UDUNITS style powers are properly parsed and interpreted."""
assert ureg("m2 s-2").units == ureg.m ** 2 / ureg.s ** 2
assert ureg("m2 s-2").units == ureg.m**2 / ureg.s**2


def test_udunits_power_syntax_parse_units():
"""Test that UDUNITS style powers are properly parsed and interpreted."""
assert ureg.parse_units("m2 s-2") == ureg.m ** 2 / ureg.s ** 2
assert ureg.parse_units("m2 s-2") == ureg.m**2 / ureg.s**2


@pytest.mark.parametrize(
Expand Down
1 change: 0 additions & 1 deletion cf_xarray/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def repl(m):
out = out.replace("Δ°", "delta_deg")
return out.replace("percent", "%")


except ImportError:
pass

Expand Down

0 comments on commit 062f9d0

Please sign in to comment.