Skip to content

Commit

Permalink
Added Group.tree method (zarr-developers#2433)
Browse files Browse the repository at this point in the history
* Added Group.tree method

* fixup

* Fixup

* remove repr_tree.ipynb

---------

Co-authored-by: Davis Bennett <[email protected]>
  • Loading branch information
TomAugspurger and d-v-b authored Nov 13, 2024
1 parent e49647b commit 89e1d4f
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 1,395 deletions.
14 changes: 10 additions & 4 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ representation of the hierarchy, e.g.::

>>> root.tree()
/
└── foo
└── bar
├── baz (10000, 10000) int32
└── quux (10000, 10000) int32
└── foo
└── bar
├── baz (10000, 10000) int32
└── quux (10000, 10000) int32

The :func:`zarr.convenience.open` function provides a convenient way to create or
re-open a group stored in a directory on the file-system, with sub-groups stored in
Expand Down Expand Up @@ -424,6 +424,12 @@ Groups also have the :func:`zarr.hierarchy.Group.tree` method, e.g.::
├── bar (1000000,) int64
└── baz (1000, 1000) float32


.. note::

:func:`zarr.Group.tree` requires the optional `rich <https://rich.readthedocs.io/en/stable/>`_
dependency. It can be installed with the ``[tree]`` extra.

If you're using Zarr within a Jupyter notebook (requires
`ipytree <https://github.com/QuantStack/ipytree>`_), calling ``tree()`` will generate an
interactive tree representation, see the `repr_tree.ipynb notebook
Expand Down
Loading

0 comments on commit 89e1d4f

Please sign in to comment.