|
63 | 63 | assert_coordinate_consistent,
|
64 | 64 | create_coords_with_default_indexes,
|
65 | 65 | )
|
66 |
| -from xarray.core.daskmanager import DaskManager |
67 | 66 | from xarray.core.duck_array_ops import datetime_to_numeric
|
68 | 67 | from xarray.core.indexes import (
|
69 | 68 | Index,
|
|
86 | 85 | )
|
87 | 86 | from xarray.core.missing import get_clean_interp_index
|
88 | 87 | from xarray.core.options import OPTIONS, _get_keep_attrs
|
89 |
| -from xarray.core.parallelcompat import get_chunked_array_type, guess_chunkmanager |
90 |
| -from xarray.core.pycompat import ( |
91 |
| - array_type, |
92 |
| - is_chunked_array, |
93 |
| - is_duck_array, |
94 |
| - is_duck_dask_array, |
95 |
| -) |
96 | 88 | from xarray.core.types import (
|
97 | 89 | QuantileMethods,
|
98 | 90 | Self,
|
|
114 | 106 | drop_dims_from_indexers,
|
115 | 107 | either_dict_or_kwargs,
|
116 | 108 | emit_user_level_warning,
|
| 109 | + infix_dims, |
| 110 | + is_dict_like, |
| 111 | + is_duck_array, |
| 112 | + is_duck_dask_array, |
117 | 113 | is_scalar,
|
118 | 114 | maybe_wrap_array,
|
119 | 115 | )
|
|
124 | 120 | broadcast_variables,
|
125 | 121 | calculate_dimensions,
|
126 | 122 | )
|
127 |
| -from xarray.namedarray.utils import infix_dims, is_dict_like |
| 123 | +from xarray.namedarray.parallelcompat import get_chunked_array_type, guess_chunkmanager |
| 124 | +from xarray.namedarray.pycompat import array_type, is_chunked_array |
128 | 125 | from xarray.plot.accessor import DatasetPlotAccessor
|
129 | 126 | from xarray.util.deprecation_helpers import _deprecate_positional_args
|
130 | 127 |
|
|
138 | 135 | from xarray.core.dataarray import DataArray
|
139 | 136 | from xarray.core.groupby import DatasetGroupBy
|
140 | 137 | from xarray.core.merge import CoercibleMapping, CoercibleValue, _MergeResult
|
141 |
| - from xarray.core.parallelcompat import ChunkManagerEntrypoint |
142 | 138 | from xarray.core.resample import DatasetResample
|
143 | 139 | from xarray.core.rolling import DatasetCoarsen, DatasetRolling
|
144 | 140 | from xarray.core.types import (
|
|
164 | 160 | T_Xarray,
|
165 | 161 | )
|
166 | 162 | from xarray.core.weighted import DatasetWeighted
|
| 163 | + from xarray.namedarray.parallelcompat import ChunkManagerEntrypoint |
167 | 164 |
|
168 | 165 |
|
169 | 166 | # list of attributes of pd.DatetimeIndex that are ndarrays of time info
|
@@ -292,6 +289,9 @@ def _maybe_chunk(
|
292 | 289 | chunked_array_type: str | ChunkManagerEntrypoint | None = None,
|
293 | 290 | from_array_kwargs=None,
|
294 | 291 | ):
|
| 292 | + |
| 293 | + from xarray.namedarray.daskmanager import DaskManager |
| 294 | + |
295 | 295 | if chunks is not None:
|
296 | 296 | chunks = {dim: chunks[dim] for dim in var.dims if dim in chunks}
|
297 | 297 |
|
@@ -842,7 +842,9 @@ def load(self, **kwargs) -> Self:
|
842 | 842 | chunkmanager = get_chunked_array_type(*lazy_data.values())
|
843 | 843 |
|
844 | 844 | # evaluate all the chunked arrays simultaneously
|
845 |
| - evaluated_data = chunkmanager.compute(*lazy_data.values(), **kwargs) |
| 845 | + evaluated_data: tuple[np.ndarray[Any, Any], ...] = chunkmanager.compute( |
| 846 | + *lazy_data.values(), **kwargs |
| 847 | + ) |
846 | 848 |
|
847 | 849 | for k, data in zip(lazy_data, evaluated_data):
|
848 | 850 | self.variables[k].data = data
|
|
0 commit comments