|
11 | 11 | Mapping,
|
12 | 12 | )
|
13 | 13 | from html import escape
|
14 |
| -from typing import TYPE_CHECKING, Any, Generic, Literal, NoReturn, Union, overload |
| 14 | +from typing import TYPE_CHECKING, Any, Literal, NoReturn, Union, overload |
15 | 15 |
|
16 | 16 | from xarray.core import utils
|
17 | 17 | from xarray.core.alignment import align
|
|
37 | 37 | from xarray.core.indexes import Index, Indexes
|
38 | 38 | from xarray.core.merge import dataset_update_method
|
39 | 39 | from xarray.core.options import OPTIONS as XR_OPTS
|
40 |
| -from xarray.core.treenode import NamedNode, NodePath, Tree |
| 40 | +from xarray.core.treenode import NamedNode, NodePath |
41 | 41 | from xarray.core.utils import (
|
42 | 42 | Default,
|
43 | 43 | Frozen,
|
@@ -365,8 +365,7 @@ class DataTree(
|
365 | 365 | MappedDataWithCoords,
|
366 | 366 | DataTreeArithmeticMixin,
|
367 | 367 | TreeAttrAccessMixin,
|
368 |
| - Generic[Tree], |
369 |
| - Mapping, |
| 368 | + Mapping[str, "DataArray | DataTree"], |
370 | 369 | ):
|
371 | 370 | """
|
372 | 371 | A tree-like hierarchical collection of xarray objects.
|
@@ -701,8 +700,8 @@ def __contains__(self, key: object) -> bool:
|
701 | 700 | def __bool__(self) -> bool:
|
702 | 701 | return bool(self._data_variables) or bool(self._children)
|
703 | 702 |
|
704 |
| - def __iter__(self) -> Iterator[Hashable]: |
705 |
| - return itertools.chain(self._data_variables, self._children) |
| 703 | + def __iter__(self) -> Iterator[str]: |
| 704 | + return itertools.chain(self._data_variables, self._children) # type: ignore |
706 | 705 |
|
707 | 706 | def __array__(self, dtype=None, copy=None):
|
708 | 707 | raise TypeError(
|
|
0 commit comments