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

Commit

Permalink
fix broken example of map_over_subtree
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed Oct 27, 2023
1 parent ea6ccb9 commit fc16a41
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/source/hierarchical-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ See that the same change (fast-forwarding by adding 10 years to the age of each
Mapping Custom Functions Over Trees
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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

.. ipython:: python
rms(readings)
voltages.map_over_subtree(rms)
.. _multiple trees:

We can also use the :py:func:`map_over_subtree` decorator to promote a function which accepts datasets into one which
accepts datatrees.

Operating on Multiple Trees
---------------------------

Expand Down

0 comments on commit fc16a41

Please sign in to comment.