Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.

Commit fc16a41

Browse files
committed
fix broken example of map_over_subtree
1 parent ea6ccb9 commit fc16a41

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/source/hierarchical-data.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ See that the same change (fast-forwarding by adding 10 years to the age of each
539539
Mapping Custom Functions Over Trees
540540
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
541541

542-
You can map custom computation over each node in a tree using :py:func:`map_over_subtree`.
542+
You can map custom computation over each node in a tree using :py:meth:`DataTree.map_over_subtree`.
543543
You can map any function, so long as it takes `xarray.Dataset` objects as one (or more) of the input arguments,
544544
and returns one (or more) xarray datasets.
545545

@@ -559,10 +559,13 @@ Then calculate the RMS value of these signals:
559559

560560
.. ipython:: python
561561
562-
rms(readings)
562+
voltages.map_over_subtree(rms)
563563
564564
.. _multiple trees:
565565

566+
We can also use the :py:func:`map_over_subtree` decorator to promote a function which accepts datasets into one which
567+
accepts datatrees.
568+
566569
Operating on Multiple Trees
567570
---------------------------
568571

0 commit comments

Comments
 (0)