4
4
import textwrap
5
5
6
6
from xarray .core .dataset import Dataset
7
- from xarray .core .datatree_mapping import map_over_subtree
7
+ from xarray .core .datatree_mapping import map_over_datasets
8
8
9
9
"""
10
10
Module which specifies the subset of xarray.Dataset's API which we wish to copy onto DataTree.
17
17
_MAPPED_DOCSTRING_ADDENDUM = (
18
18
"This method was copied from :py:class:`xarray.Dataset`, but has been altered to "
19
19
"call the method on the Datasets stored in every node of the subtree. "
20
- "See the `map_over_subtree ` function for more details."
20
+ "See the `map_over_datasets ` function for more details."
21
21
)
22
22
23
23
# TODO equals, broadcast_equals etc.
@@ -174,7 +174,7 @@ def _wrap_then_attach_to_cls(
174
174
target_cls_dict , source_cls , methods_to_set , wrap_func = None
175
175
):
176
176
"""
177
- Attach given methods on a class, and optionally wrap each method first. (i.e. with map_over_subtree ).
177
+ Attach given methods on a class, and optionally wrap each method first. (i.e. with map_over_datasets ).
178
178
179
179
Result is like having written this in the classes' definition:
180
180
```
@@ -206,7 +206,7 @@ def method_name(self, *args, **kwargs):
206
206
)
207
207
target_cls_dict [method_name ] = wrapped_method
208
208
209
- if wrap_func is map_over_subtree :
209
+ if wrap_func is map_over_datasets :
210
210
# Add a paragraph to the method's docstring explaining how it's been mapped
211
211
orig_method_docstring = orig_method .__doc__
212
212
@@ -277,7 +277,7 @@ class MappedDatasetMethodsMixin:
277
277
target_cls_dict = vars (),
278
278
source_cls = Dataset ,
279
279
methods_to_set = _ALL_DATASET_METHODS_TO_MAP ,
280
- wrap_func = map_over_subtree ,
280
+ wrap_func = map_over_datasets ,
281
281
)
282
282
283
283
@@ -291,7 +291,7 @@ class MappedDataWithCoords:
291
291
target_cls_dict = vars (),
292
292
source_cls = Dataset ,
293
293
methods_to_set = _DATA_WITH_COORDS_METHODS_TO_MAP ,
294
- wrap_func = map_over_subtree ,
294
+ wrap_func = map_over_datasets ,
295
295
)
296
296
297
297
@@ -305,5 +305,5 @@ class DataTreeArithmeticMixin:
305
305
target_cls_dict = vars (),
306
306
source_cls = Dataset ,
307
307
methods_to_set = _ARITHMETIC_METHODS_TO_MAP ,
308
- wrap_func = map_over_subtree ,
308
+ wrap_func = map_over_datasets ,
309
309
)
0 commit comments