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

Commit

Permalink
Add Pathlike methods to api docs (#287)
Browse files Browse the repository at this point in the history
* move from_dict to creation methods

* add section for pathlib-like interface

* add suggestions for missing pathlib-like api
  • Loading branch information
TomNicholas authored Jan 19, 2024
1 parent 8fbf2be commit 14d6b6d
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ DataTree
Creating a DataTree
-------------------

Methods of creating a datatree.

.. autosummary::
:toctree: generated/

DataTree
DataTree.from_dict

Tree Attributes
---------------
Expand Down Expand Up @@ -66,7 +69,7 @@ This interface echoes that of ``xarray.Dataset``.
DataTree.is_empty
DataTree.is_hollow

Dictionary interface
Dictionary Interface
--------------------

``DataTree`` objects also have a dict-like interface mapping keys to either ``xarray.DataArray``s or to child ``DataTree`` nodes.
Expand Down Expand Up @@ -102,6 +105,30 @@ For manipulating, traversing, navigating, or mapping over the tree structure.
DataTree.match
DataTree.filter

Pathlib-like Interface
----------------------

``DataTree`` objects deliberately echo some of the API of `pathlib.PurePath`.

.. autosummary::
:toctree: generated/

DataTree.name
DataTree.parent
DataTree.parents
DataTree.relative_to

Missing:

..
``DataTree.glob``
``DataTree.joinpath``
``DataTree.with_name``
``DataTree.walk``
``DataTree.rename``
``DataTree.replace``

DataTree Contents
-----------------

Expand Down Expand Up @@ -276,13 +303,12 @@ Plotting
I/O
===

Create or
Open a datatree from an on-disk store or serialize the tree.

.. autosummary::
:toctree: generated/

open_datatree
DataTree.from_dict
DataTree.to_dict
DataTree.to_netcdf
DataTree.to_zarr
Expand Down

0 comments on commit 14d6b6d

Please sign in to comment.