Skip to content

Commit 41d850a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 761a598 commit 41d850a

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

cf_xarray/accessor.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -721,17 +721,15 @@ def _getitem(
721721
accessor: CFAccessor,
722722
key: Hashable,
723723
skip: list[Literal["coords", "measures"]] | None = None,
724-
) -> DataArray:
725-
...
724+
) -> DataArray: ...
726725

727726

728727
@overload
729728
def _getitem(
730729
accessor: CFAccessor,
731730
key: Iterable[Hashable],
732731
skip: list[Literal["coords", "measures"]] | None = None,
733-
) -> Dataset:
734-
...
732+
) -> Dataset: ...
735733

736734

737735
def _getitem(

cf_xarray/coding.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Encoders and decoders for CF conventions not implemented by Xarray.
33
"""
4+
45
import numpy as np
56
import pandas as pd
67
import xarray as xr

cf_xarray/formatting.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ def _print_rows(subtitle: str, rows: list[str], rich: bool):
110110

111111
# Add subtitle to the first row, align other rows
112112
rows = [
113-
_format_subtitle(subtitle, rich=rich) + row
114-
if i == 0
115-
else len(subtitle) * " " + row
113+
(
114+
_format_subtitle(subtitle, rich=rich) + row
115+
if i == 0
116+
else len(subtitle) * " " + row
117+
)
116118
for i, row in enumerate(rows)
117119
]
118120

cf_xarray/tests/test_accessor.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1454,9 +1454,9 @@ def test_rename(obj):
14541454
"air_temperature" if isinstance(obj, Dataset) else "longitude": "renamed"
14551455
}
14561456
xr_dict = {
1457-
"air"
1458-
if isinstance(obj, Dataset) and "air" in obj.data_vars
1459-
else "lon": "renamed"
1457+
(
1458+
"air" if isinstance(obj, Dataset) and "air" in obj.data_vars else "lon"
1459+
): "renamed"
14601460
}
14611461
assert_identical(obj.rename(xr_dict), obj.cf.rename(cf_dict))
14621462
assert_identical(obj.rename(**xr_dict), obj.cf.rename(**cf_dict))

cf_xarray/units.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module to provide unit support via pint approximating UDUNITS/CF."""
2+
23
import functools
34
import re
45

0 commit comments

Comments
 (0)