Skip to content

Commit ecaa514

Browse files
[pre-commit.ci] pre-commit autoupdate (#7651)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/charliermarsh/ruff-pre-commit: v0.0.254 → v0.0.257](astral-sh/ruff-pre-commit@v0.0.254...v0.0.257) * fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Illviljan <[email protected]>
1 parent 1e361cc commit ecaa514

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
files: ^xarray/
1717
- repo: https://github.com/charliermarsh/ruff-pre-commit
1818
# Ruff version.
19-
rev: 'v0.0.254'
19+
rev: 'v0.0.257'
2020
hooks:
2121
- id: ruff
2222
args: ["--fix"]

xarray/core/computation.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,8 @@
88
import operator
99
import warnings
1010
from collections import Counter
11-
from collections.abc import Hashable, Iterable, Mapping, Sequence
12-
from typing import (
13-
TYPE_CHECKING,
14-
AbstractSet,
15-
Any,
16-
Callable,
17-
Literal,
18-
TypeVar,
19-
Union,
20-
overload,
21-
)
11+
from collections.abc import Hashable, Iterable, Mapping, Sequence, Set
12+
from typing import TYPE_CHECKING, Any, Callable, Literal, TypeVar, Union, overload
2213

2314
import numpy as np
2415

@@ -211,7 +202,7 @@ def _get_coords_list(args: Iterable[Any]) -> list[Coordinates]:
211202
def build_output_coords_and_indexes(
212203
args: Iterable[Any],
213204
signature: _UFuncSignature,
214-
exclude_dims: AbstractSet = frozenset(),
205+
exclude_dims: Set = frozenset(),
215206
combine_attrs: CombineAttrsOptions = "override",
216207
) -> tuple[list[dict[Any, Variable]], list[dict[Any, Index]]]:
217208
"""Build output coordinates and indexes for an operation.
@@ -561,7 +552,7 @@ def apply_groupby_func(func, *args):
561552

562553

563554
def unified_dim_sizes(
564-
variables: Iterable[Variable], exclude_dims: AbstractSet = frozenset()
555+
variables: Iterable[Variable], exclude_dims: Set = frozenset()
565556
) -> dict[Hashable, int]:
566557
dim_sizes: dict[Hashable, int] = {}
567558

@@ -846,7 +837,7 @@ def apply_ufunc(
846837
*args: Any,
847838
input_core_dims: Sequence[Sequence] | None = None,
848839
output_core_dims: Sequence[Sequence] | None = ((),),
849-
exclude_dims: AbstractSet = frozenset(),
840+
exclude_dims: Set = frozenset(),
850841
vectorize: bool = False,
851842
join: JoinOptions = "exact",
852843
dataset_join: str = "exact",

xarray/core/merge.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

33
from collections import defaultdict
4-
from collections.abc import Hashable, Iterable, Mapping, Sequence
5-
from typing import TYPE_CHECKING, AbstractSet, Any, NamedTuple, Optional, Union
4+
from collections.abc import Hashable, Iterable, Mapping, Sequence, Set
5+
from typing import TYPE_CHECKING, Any, NamedTuple, Optional, Union
66

77
import pandas as pd
88

@@ -381,7 +381,7 @@ def collect_from_coordinates(
381381
def merge_coordinates_without_align(
382382
objects: list[Coordinates],
383383
prioritized: Mapping[Any, MergeElement] | None = None,
384-
exclude_dims: AbstractSet = frozenset(),
384+
exclude_dims: Set = frozenset(),
385385
combine_attrs: CombineAttrsOptions = "override",
386386
) -> tuple[dict[Hashable, Variable], dict[Hashable, Index]]:
387387
"""Merge variables/indexes from coordinates without automatic alignments.

xarray/core/parallel.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import itertools
55
import operator
66
from collections.abc import Hashable, Iterable, Mapping, Sequence
7-
from typing import TYPE_CHECKING, Any, Callable, DefaultDict
7+
from typing import TYPE_CHECKING, Any, Callable
88

99
import numpy as np
1010

@@ -403,7 +403,9 @@ def _wrapper(
403403
# func applied to the values.
404404

405405
graph: dict[Any, Any] = {}
406-
new_layers: DefaultDict[str, dict[Any, Any]] = collections.defaultdict(dict)
406+
new_layers: collections.defaultdict[str, dict[Any, Any]] = collections.defaultdict(
407+
dict
408+
)
407409
gname = "{}-{}".format(
408410
dask.utils.funcname(func), dask.base.tokenize(npargs[0], args, kwargs)
409411
)

0 commit comments

Comments
 (0)