|
16 | 16 | Iterator,
|
17 | 17 | Mapping,
|
18 | 18 | Sequence,
|
19 |
| - Set, |
20 | 19 | )
|
21 |
| -from typing import TYPE_CHECKING, Any, Literal, TypeVar, Union |
| 20 | +from collections.abc import ( |
| 21 | + Set as AbstractSet, |
| 22 | +) |
| 23 | +from typing import TYPE_CHECKING, Any, Literal |
22 | 24 |
|
23 | 25 | import numpy as np
|
24 | 26 |
|
25 |
| -_T = TypeVar("_T", bound=Union["Dataset", "DataArray"]) |
26 |
| -_U = TypeVar("_U", bound=Union["Dataset", "DataArray"]) |
27 |
| -_V = TypeVar("_V", bound=Union["Dataset", "DataArray"]) |
28 |
| - |
29 | 27 | from xarray.core import duck_array_ops, utils
|
30 | 28 | from xarray.core.formatting import limit_lines
|
31 | 29 | from xarray.core.indexes import Index, filter_indexes_from_coords
|
@@ -200,7 +198,7 @@ def _get_coords_list(args: Iterable[Any]) -> list[Coordinates]:
|
200 | 198 | def build_output_coords_and_indexes(
|
201 | 199 | args: Iterable[Any],
|
202 | 200 | signature: _UFuncSignature,
|
203 |
| - exclude_dims: Set = frozenset(), |
| 201 | + exclude_dims: AbstractSet = frozenset(), |
204 | 202 | combine_attrs: CombineAttrsOptions = "override",
|
205 | 203 | ) -> tuple[list[dict[Any, Variable]], list[dict[Any, Index]]]:
|
206 | 204 | """Build output coordinates and indexes for an operation.
|
@@ -615,7 +613,7 @@ def apply_groupby_func(func, *args):
|
615 | 613 |
|
616 | 614 |
|
617 | 615 | def unified_dim_sizes(
|
618 |
| - variables: Iterable[Variable], exclude_dims: Set = frozenset() |
| 616 | + variables: Iterable[Variable], exclude_dims: AbstractSet = frozenset() |
619 | 617 | ) -> dict[Hashable, int]:
|
620 | 618 | dim_sizes: dict[Hashable, int] = {}
|
621 | 619 |
|
@@ -894,7 +892,7 @@ def apply_ufunc(
|
894 | 892 | *args: Any,
|
895 | 893 | input_core_dims: Sequence[Sequence] | None = None,
|
896 | 894 | output_core_dims: Sequence[Sequence] | None = ((),),
|
897 |
| - exclude_dims: Set = frozenset(), |
| 895 | + exclude_dims: AbstractSet = frozenset(), |
898 | 896 | vectorize: bool = False,
|
899 | 897 | join: JoinOptions = "exact",
|
900 | 898 | dataset_join: str = "exact",
|
|
0 commit comments