File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -539,7 +539,7 @@ See that the same change (fast-forwarding by adding 10 years to the age of each
539
539
Mapping Custom Functions Over Trees
540
540
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
541
541
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 `.
543
543
You can map any function, so long as it takes `xarray.Dataset ` objects as one (or more) of the input arguments,
544
544
and returns one (or more) xarray datasets.
545
545
@@ -559,10 +559,13 @@ Then calculate the RMS value of these signals:
559
559
560
560
.. ipython :: python
561
561
562
- rms(readings )
562
+ voltages.map_over_subtree(rms )
563
563
564
564
.. _multiple trees :
565
565
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
+
566
569
Operating on Multiple Trees
567
570
---------------------------
568
571
You can’t perform that action at this time.
0 commit comments