Skip to content

[pre-commit.ci] pre-commit autoupdate #7651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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