Skip to content

Commit

Permalink
map_over_subtree -> map_over_datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed Oct 15, 2024
1 parent 7dbc817 commit c7d8060
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xarray/core/datatree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ def groups(self):

def _unary_op(self, f, *args, **kwargs) -> DataTree:
# TODO do we need to any additional work to avoid duplication etc.? (Similar to aggregations)
return self.map_over_subtree(f, *args, **kwargs) # type: ignore[return-value]
return self.map_over_datasets(f, *args, **kwargs) # type: ignore[return-value]

def _binary_op(self, other, f, reflexive=False, join=None) -> DataTree:
from xarray.core.dataset import Dataset
Expand All @@ -1507,7 +1507,7 @@ def _binary_op(self, other, f, reflexive=False, join=None) -> DataTree:
reflexive=reflexive,
join=join,
)
return map_over_subtree(ds_binop)(self, other)
return map_over_datasets(ds_binop)(self, other)

def _inplace_binary_op(self, other, f) -> Self:
from xarray.core.groupby import GroupBy
Expand Down

0 comments on commit c7d8060

Please sign in to comment.