Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (pydata#7651)
Browse files Browse the repository at this point in the history
* [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]>
  • Loading branch information
pre-commit-ci[bot] and Illviljan authored Mar 23, 2023
1 parent 1e361cc commit ecaa514
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
files: ^xarray/
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.254'
rev: 'v0.0.257'
hooks:
- id: ruff
args: ["--fix"]
Expand Down
19 changes: 5 additions & 14 deletions xarray/core/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,8 @@
import operator
import warnings
from collections import Counter
from collections.abc import Hashable, Iterable, Mapping, Sequence
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
Literal,
TypeVar,
Union,
overload,
)
from collections.abc import Hashable, Iterable, Mapping, Sequence, Set
from typing import TYPE_CHECKING, Any, Callable, Literal, TypeVar, Union, overload

import numpy as np

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


def unified_dim_sizes(
variables: Iterable[Variable], exclude_dims: AbstractSet = frozenset()
variables: Iterable[Variable], exclude_dims: Set = frozenset()
) -> dict[Hashable, int]:
dim_sizes: dict[Hashable, int] = {}

Expand Down Expand Up @@ -846,7 +837,7 @@ def apply_ufunc(
*args: Any,
input_core_dims: Sequence[Sequence] | None = None,
output_core_dims: Sequence[Sequence] | None = ((),),
exclude_dims: AbstractSet = frozenset(),
exclude_dims: Set = frozenset(),
vectorize: bool = False,
join: JoinOptions = "exact",
dataset_join: str = "exact",
Expand Down
6 changes: 3 additions & 3 deletions xarray/core/merge.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from collections import defaultdict
from collections.abc import Hashable, Iterable, Mapping, Sequence
from typing import TYPE_CHECKING, AbstractSet, Any, NamedTuple, Optional, Union
from collections.abc import Hashable, Iterable, Mapping, Sequence, Set
from typing import TYPE_CHECKING, Any, NamedTuple, Optional, Union

import pandas as pd

Expand Down Expand Up @@ -381,7 +381,7 @@ def collect_from_coordinates(
def merge_coordinates_without_align(
objects: list[Coordinates],
prioritized: Mapping[Any, MergeElement] | None = None,
exclude_dims: AbstractSet = frozenset(),
exclude_dims: Set = frozenset(),
combine_attrs: CombineAttrsOptions = "override",
) -> tuple[dict[Hashable, Variable], dict[Hashable, Index]]:
"""Merge variables/indexes from coordinates without automatic alignments.
Expand Down
6 changes: 4 additions & 2 deletions xarray/core/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import itertools
import operator
from collections.abc import Hashable, Iterable, Mapping, Sequence
from typing import TYPE_CHECKING, Any, Callable, DefaultDict
from typing import TYPE_CHECKING, Any, Callable

import numpy as np

Expand Down Expand Up @@ -403,7 +403,9 @@ def _wrapper(
# func applied to the values.

graph: dict[Any, Any] = {}
new_layers: DefaultDict[str, dict[Any, Any]] = collections.defaultdict(dict)
new_layers: collections.defaultdict[str, dict[Any, Any]] = collections.defaultdict(
dict
)
gname = "{}-{}".format(
dask.utils.funcname(func), dask.base.tokenize(npargs[0], args, kwargs)
)
Expand Down

0 comments on commit ecaa514

Please sign in to comment.