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

Commit

Permalink
Merge branch 'docs_manipulating_trees' of https://github.com/TomNicho…
Browse files Browse the repository at this point in the history
…las/datatree into docs_manipulating_trees
  • Loading branch information
TomNicholas committed Oct 24, 2023
2 parents d79e46a + bffdb7b commit 898a8fb
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions docs/source/hierarchical-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -545,14 +545,14 @@ We can check if any two trees are isomorphic using the :py:meth:`DataTree.isomor
.. ipython:: python
:okexcept:
dt1 = DataTree.from_dict({'a': None, 'a/b': None})
dt2 = DataTree.from_dict({'a': None})
dt1 = DataTree.from_dict({"a": None, "a/b": None})
dt2 = DataTree.from_dict({"a": None})
dt1.isomorphic(dt2)
dt3 = DataTree.from_dict({'a': None, 'b': None})
dt3 = DataTree.from_dict({"a": None, "b": None})
dt1.isomorphic(dt3)
dt4 = DataTree.from_dict({'A': None, 'A/B': xr.Dataset({'foo': 1})})
dt4 = DataTree.from_dict({"A": None, "A/B": xr.Dataset({"foo": 1})})
dt1.isomorphic(dt4)
If the trees are not isomorphic a :py:class:`~TreeIsomorphismError` will be raised.
Expand All @@ -570,15 +570,21 @@ we can do arithmetic between them.
{
"/oscilloscope1": xr.Dataset(
{
"current": ('time', signal_generator(time_stamps1, f=2, A=1.2, phase=1)),
"current": (
"time",
signal_generator(time_stamps1, f=2, A=1.2, phase=1),
),
},
coords={'time': time_stamps1},
coords={"time": time_stamps1},
),
"/oscilloscope2": xr.Dataset(
{
"current": ('time', signal_generator(time_stamps2, f=1.6, A=1.6, phase=0.7)),
"current": (
"time",
signal_generator(time_stamps2, f=1.6, A=1.6, phase=0.7),
),
},
coords={'time': time_stamps2},
coords={"time": time_stamps2},
),
}
)
Expand Down

0 comments on commit 898a8fb

Please sign in to comment.