Skip to content

Commit aa154c7

Browse files
[pre-commit.ci] pre-commit autoupdate (#510)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/pyupgrade: v3.15.0 → v3.15.2](asottile/pyupgrade@v3.15.0...v3.15.2) - [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.3.5](astral-sh/ruff-pre-commit@v0.1.9...v0.3.5) - [github.com/psf/black-pre-commit-mirror: 23.12.1 → 24.3.0](psf/black-pre-commit-mirror@23.12.1...24.3.0) - [github.com/nbQA-dev/nbQA: 1.7.1 → 1.8.5](nbQA-dev/nbQA@1.7.1...1.8.5) - [github.com/abravalheri/validate-pyproject: v0.15 → v0.16](abravalheri/validate-pyproject@v0.15...v0.16) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
1 parent 24dd81b commit aa154c7

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ ci:
33

44
repos:
55
- repo: https://github.com/asottile/pyupgrade
6-
rev: v3.15.0
6+
rev: v3.15.2
77
hooks:
88
- id: pyupgrade
99
args: ["--py39-plus"]
1010

1111
- repo: https://github.com/astral-sh/ruff-pre-commit
1212
# Ruff version.
13-
rev: 'v0.1.9'
13+
rev: 'v0.3.5'
1414
hooks:
1515
- id: ruff
1616
args: ["--show-fixes", "--fix"]
1717

1818
- repo: https://github.com/psf/black-pre-commit-mirror
19-
rev: 23.12.1
19+
rev: 24.3.0
2020
hooks:
2121
- id: black
2222

@@ -36,7 +36,7 @@ repos:
3636
- mdformat-myst
3737

3838
- repo: https://github.com/nbQA-dev/nbQA
39-
rev: 1.7.1
39+
rev: 1.8.5
4040
hooks:
4141
- id: nbqa-black
4242
- id: nbqa-ruff
@@ -67,7 +67,7 @@ repos:
6767
- id: validate-cff
6868

6969
- repo: https://github.com/abravalheri/validate-pyproject
70-
rev: v0.15
70+
rev: v0.16
7171
hooks:
7272
- id: validate-pyproject
7373

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)