Skip to content

Commit 65a7d24

Browse files
authored
Add Pathlike methods to api docs xarray-contrib/datatree#287
* move from_dict to creation methods * add section for pathlib-like interface * add suggestions for missing pathlib-like api
1 parent d030502 commit 65a7d24

File tree

1 file changed

+29
-3
lines changed
  • xarray/datatree_/docs/source

1 file changed

+29
-3
lines changed

xarray/datatree_/docs/source/api.rst

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ DataTree
1010
Creating a DataTree
1111
-------------------
1212

13+
Methods of creating a datatree.
14+
1315
.. autosummary::
1416
:toctree: generated/
1517

1618
DataTree
19+
DataTree.from_dict
1720

1821
Tree Attributes
1922
---------------
@@ -66,7 +69,7 @@ This interface echoes that of ``xarray.Dataset``.
6669
DataTree.is_empty
6770
DataTree.is_hollow
6871

69-
Dictionary interface
72+
Dictionary Interface
7073
--------------------
7174

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

108+
Pathlib-like Interface
109+
----------------------
110+
111+
``DataTree`` objects deliberately echo some of the API of `pathlib.PurePath`.
112+
113+
.. autosummary::
114+
:toctree: generated/
115+
116+
DataTree.name
117+
DataTree.parent
118+
DataTree.parents
119+
DataTree.relative_to
120+
121+
Missing:
122+
123+
..
124+
125+
``DataTree.glob``
126+
``DataTree.joinpath``
127+
``DataTree.with_name``
128+
``DataTree.walk``
129+
``DataTree.rename``
130+
``DataTree.replace``
131+
105132
DataTree Contents
106133
-----------------
107134

@@ -276,13 +303,12 @@ Plotting
276303
I/O
277304
===
278305

279-
Create or
306+
Open a datatree from an on-disk store or serialize the tree.
280307

281308
.. autosummary::
282309
:toctree: generated/
283310

284311
open_datatree
285-
DataTree.from_dict
286312
DataTree.to_dict
287313
DataTree.to_netcdf
288314
DataTree.to_zarr

0 commit comments

Comments
 (0)