Skip to content

Commit 2d579f2

Browse files
[pre-commit.ci] pre-commit autoupdate (#431)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/charliermarsh/ruff-pre-commit: v0.0.237 → v0.0.260](astral-sh/ruff-pre-commit@v0.0.237...v0.0.260) - [github.com/psf/black: 22.12.0 → 23.3.0](psf/black@22.12.0...23.3.0) - [github.com/rstcheck/rstcheck: v6.1.1 → v6.1.2](rstcheck/rstcheck@v6.1.1...v6.1.2) - [github.com/nbQA-dev/nbQA: 1.6.1 → 1.7.0](nbQA-dev/nbQA@1.6.1...1.7.0) - [github.com/abravalheri/validate-pyproject: main → v0.12.2](abravalheri/validate-pyproject@main...v0.12.2) * [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 <[email protected]>
1 parent 6fc7609 commit 2d579f2

File tree

6 files changed

+5
-26
lines changed

6 files changed

+5
-26
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ ci:
44
repos:
55
- repo: https://github.com/charliermarsh/ruff-pre-commit
66
# Ruff version.
7-
rev: 'v0.0.237'
7+
rev: 'v0.0.260'
88
hooks:
99
- id: ruff
1010
args: ["--fix"]
1111

1212
- repo: https://github.com/psf/black
13-
rev: 22.12.0
13+
rev: 23.3.0
1414
hooks:
1515
- id: black
1616

1717
- repo: https://github.com/rstcheck/rstcheck
18-
rev: v6.1.1
18+
rev: v6.1.2
1919
hooks:
2020
- id: rstcheck
2121
additional_dependencies: [sphinx, tomli]
@@ -30,7 +30,7 @@ repos:
3030
- mdformat-myst
3131

3232
- repo: https://github.com/nbQA-dev/nbQA
33-
rev: 1.6.1
33+
rev: 1.7.0
3434
hooks:
3535
- id: nbqa-black
3636
- id: nbqa-ruff
@@ -61,6 +61,6 @@ repos:
6161
- id: validate-cff
6262

6363
- repo: https://github.com/abravalheri/validate-pyproject
64-
rev: main
64+
rev: v0.12.2
6565
hooks:
6666
- id: validate-pyproject

cf_xarray/accessor.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def apply_mapper(
119119
default = [] if default is None else list(always_iterable(default))
120120

121121
def _apply_single_mapper(mapper):
122-
123122
try:
124123
results = mapper(obj, key)
125124
except (KeyError, ValueError) as e:
@@ -1218,7 +1217,6 @@ def curvefit(
12181217
param_names: Sequence[str] | None = None,
12191218
kwargs: dict[str, Any] | None = None,
12201219
):
1221-
12221220
if coords is not None:
12231221
if isinstance(coords, (Hashable, DataArray)):
12241222
coords_iter: Iterable[Hashable | DataArray] = [coords]
@@ -2053,7 +2051,6 @@ def add_canonical_attributes(
20532051
ds = self._maybe_to_dataset().copy(deep=False)
20542052
attrs_to_print: dict = {}
20552053
for std_name, var_names in ds.cf.standard_names.items():
2056-
20572054
# Loop over variable names
20582055
for var_name in var_names:
20592056
old_attrs = ds[var_name].attrs
@@ -2067,7 +2064,6 @@ def add_canonical_attributes(
20672064
and key not in skip_
20682065
and (override or key not in old_attrs)
20692066
):
2070-
20712067
# Don't add units to time variables (e.g., datetime64, ...)
20722068
if key == "units" and _is_datetime_like(ds[var_name]):
20732069
continue

cf_xarray/formatting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def make_text_section(
4141
default_keys=None,
4242
rich: bool = False,
4343
):
44-
4544
from .accessor import sort_maybe_hashable
4645

4746
if dims is None:

cf_xarray/tests/test_accessor.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ def assert_dicts_identical(dict1, dict2):
6161

6262

6363
def test_repr() -> None:
64-
6564
assert "air_temperature: [(1, 2, 3)]" in ds_with_tuple.cf.__repr__()
6665

6766
# Dataset.
@@ -454,7 +453,6 @@ def test_rename_like() -> None:
454453
),
455454
)
456455
def test_wrapped_classes(obj, attr, xrkwargs, cfkwargs):
457-
458456
if attr in ("rolling", "coarsen"):
459457
# TODO: xarray bug, rolling and coarsen don't accept ellipsis
460458
args = ()
@@ -522,7 +520,6 @@ def test_pos_args_methods() -> None:
522520

523521

524522
def test_preserve_unused_keys() -> None:
525-
526523
ds = airds.copy(deep=False)
527524
ds.time.attrs.clear()
528525
actual = ds.cf.sel(X=260, Y=40, time=airds.time[:2], method="nearest")
@@ -531,7 +528,6 @@ def test_preserve_unused_keys() -> None:
531528

532529

533530
def test_kwargs_expand_key_to_multiple_keys() -> None:
534-
535531
actual = multiple.cf.isel(X=5, Y=3)
536532
expected = multiple.isel(x1=5, y1=3, x2=5, y2=3)
537533
assert_identical(actual, expected)
@@ -571,7 +567,6 @@ def test_args_methods(obj):
571567

572568

573569
def test_dataarray_getitem() -> None:
574-
575570
air = airds.air.copy(deep=False)
576571
air.name = None
577572

@@ -586,7 +581,6 @@ def test_dataarray_getitem() -> None:
586581

587582

588583
def test_dataarray_plot() -> None:
589-
590584
obj = airds.air.copy(deep=False)
591585

592586
rv = obj.isel(time=1).transpose("lon", "lat").cf.plot()
@@ -1375,7 +1369,6 @@ def test_standard_name_mapper() -> None:
13751369
@pytest.mark.parametrize("obj", objects)
13761370
@pytest.mark.parametrize("attr", ["drop_vars", "set_coords"])
13771371
def test_drop_vars_and_set_coords(obj, attr):
1378-
13791372
# DataArray object has no attribute set_coords
13801373
if not isinstance(obj, Dataset) and attr == "set_coords":
13811374
return
@@ -1398,7 +1391,6 @@ def test_drop_vars_and_set_coords(obj, attr):
13981391

13991392
@pytest.mark.parametrize("obj", objects)
14001393
def test_drop_sel_and_reset_coords(obj):
1401-
14021394
# Axis
14031395
assert_identical(obj.drop_sel(lat=75), obj.cf.drop_sel(Y=75))
14041396
# Coordinate
@@ -1415,7 +1407,6 @@ def test_drop_sel_and_reset_coords(obj):
14151407

14161408
@pytest.mark.parametrize("ds", datasets)
14171409
def test_drop_dims(ds):
1418-
14191410
# Add data_var and coord to test _get_dims
14201411
ds["lon_var"] = ds["lon"]
14211412
ds = ds.assign_coords(lon_coord=ds["lon"])
@@ -1427,7 +1418,6 @@ def test_drop_dims(ds):
14271418

14281419
@pytest.mark.parametrize("obj", objects)
14291420
def test_rename(obj):
1430-
14311421
cf_dict = {
14321422
"air_temperature" if isinstance(obj, Dataset) else "longitude": "renamed"
14331423
}
@@ -1450,7 +1440,6 @@ def test_rename_tuple():
14501440

14511441
@pytest.mark.parametrize("ds", datasets)
14521442
def test_differentiate(ds):
1453-
14541443
# Add data_var and coord to test _get_coords
14551444
ds["lon_var"] = ds["lon"]
14561445
ds = ds.assign_coords(lon_coord=ds["lon"])
@@ -1710,7 +1699,6 @@ def test_regex_match():
17101699

17111700

17121701
def test_cf_standard_name_table_version() -> None:
1713-
17141702
url = (
17151703
"https://raw.githubusercontent.com/cf-convention/cf-convention.github.io/"
17161704
"master/Data/cf-standard-names/current/src/cf-standard-name-table.xml"
@@ -1748,7 +1736,6 @@ def test_datetime_like(reshape):
17481736
@pytest.mark.parametrize("skip", ["units", None])
17491737
@pytest.mark.parametrize("verbose", [True, False])
17501738
def test_add_canonical_attributes(override, skip, verbose, capsys):
1751-
17521739
ds = airds
17531740
original = ds.copy(deep=True)
17541741
cf_ds = ds.cf.add_canonical_attributes(
@@ -1834,7 +1821,6 @@ def test_flag_errors() -> None:
18341821

18351822

18361823
def test_missing_variables() -> None:
1837-
18381824
# Bounds
18391825
ds = mollwds.copy(deep=False)
18401826
ds = ds.drop_vars("lon_bounds")

cf_xarray/tests/test_options.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
def test_options():
11-
1211
# test for inputting a nonexistent option
1312
with pytest.raises(ValueError):
1413
cfxr.set_options(DISPLAY_WIDTH=80)

cf_xarray/tests/test_scripts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
def test_make_doc():
8-
98
names = [
109
"axes_criteria",
1110
"coords_criteria",

0 commit comments

Comments
 (0)