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

Commit dfe0cfe

Browse files
committed
fix syntax of lots of API references
1 parent 705fb7b commit dfe0cfe

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

docs/source/data-structures.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Data Structures
2323
DataTree
2424
--------
2525

26-
:py:class:``DataTree`` is xarray's highest-level data structure, able to organise heterogeneous data which
27-
could not be stored inside a single ``Dataset`` object. This includes representing the recursive structure of multiple
26+
:py:class:`DataTree` is xarray's highest-level data structure, able to organise heterogeneous data which
27+
could not be stored inside a single :py:class:`Dataset` object. This includes representing the recursive structure of multiple
2828
`groups`_ within a netCDF file or `Zarr Store`_.
2929

3030
.. _groups: https://www.unidata.ucar.edu/software/netcdf/workshops/2011/groups-types/GroupsIntro.html
@@ -128,8 +128,8 @@ It is at tree construction time that consistency checks are enforced. For instan
128128
Alternatively you can also create a ``DataTree`` object from
129129

130130
- An ``xarray.Dataset`` using ``Dataset.to_node()`` (not yet implemented),
131-
- A dictionary mapping directory-like paths to either ``DataTree`` nodes or data, using ``DataTree.from_dict()``,
132-
- A netCDF or Zarr file on disk with ``open_datatree()``. See :ref:`reading and writing files <io>`.
131+
- A dictionary mapping directory-like paths to either ``DataTree`` nodes or data, using :py:meth:`DataTree.from_dict()`,
132+
- A netCDF or Zarr file on disk with :py:func:`open_datatree()`. See :ref:`reading and writing files <io>`.
133133

134134

135135
DataTree Contents
@@ -152,7 +152,7 @@ We can also access all the data in a single node through a dataset-like view
152152
153153
This demonstrates the fact that the data in any one node is equivalent to the contents of a single ``xarray.Dataset`` object.
154154
The ``DataTree.ds`` property returns an immutable view, but we can instead extract the node's data contents as a new (and mutable)
155-
``xarray.Dataset`` object via ``.to_dataset()``:
155+
``xarray.Dataset`` object via :py:meth:`DataTree.to_dataset()`:
156156

157157
.. ipython:: python
158158
@@ -184,10 +184,10 @@ For example, to create this example datatree from scratch, we could have written
184184
185185
To change the variables in a node of a ``DataTree``, you can use all the standard dictionary
186186
methods, including ``values``, ``items``, ``__delitem__``, ``get`` and
187-
:py:meth:`~xarray.DataTree.update`.
187+
:py:meth:`DataTree.update`.
188188
Note that assigning a ``DataArray`` object to a ``DataTree`` variable using ``__setitem__`` or ``update`` will
189-
:ref:`automatically align<update>` the array(s) to the original node's indexes.
189+
:ref:`automatically align <update>` the array(s) to the original node's indexes.
190190

191-
If you copy a ``DataTree`` using the ``:py:func::copy`` function or the :py:meth:`~xarray.DataTree.copy` it will copy the subtree,
191+
If you copy a ``DataTree`` using the :py:func:`copy` function or the :py:meth:`DataTree.copy` method it will copy the subtree,
192192
meaning that node and children below it, but no parents above it.
193193
Like for ``Dataset``, this copy is shallow by default, but you can copy all the underlying data arrays by calling ``dt.copy(deep=True)``.

docs/source/hierarchical-data.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Working With Hierarchical Data
1414
np.random.seed(123456)
1515
np.set_printoptions(threshold=10)
1616
17+
1718
Why Hierarchical Data?
1819
----------------------
1920

@@ -33,7 +34,7 @@ Often datasets like this cannot easily fit into a single ``xarray.Dataset`` obje
3334
or are more usefully thought of as groups of related ``xarray.Dataset`` objects.
3435
For this purpose we provide the :py:class:`DataTree` class.
3536

36-
This page explains in detail how to understand and use the different features of the :py:class:`DataTree` class for your own heirarchical data needs.
37+
This page explains in detail how to understand and use the different features of the :py:class:`DataTree` class for your own hierarchical data needs.
3738

3839
.. _node relationships:
3940

docs/source/io.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Groups
1717
~~~~~~
1818

1919
Whilst netCDF groups can only be loaded individually as Dataset objects, a whole file of many nested groups can be loaded
20-
as a single ``:py:class::DataTree`` object.
21-
To open a whole netCDF file as a tree of groups use the ``:py:func::open_datatree()`` function.
22-
To save a DataTree object as a netCDF file containing many groups, use the ``:py:meth::DataTree.to_netcdf()`` method.
20+
as a single :py:class:`DataTree` object.
21+
To open a whole netCDF file as a tree of groups use the :py:func:`open_datatree` function.
22+
To save a DataTree object as a netCDF file containing many groups, use the :py:meth:`DataTree.to_netcdf` method.
2323

2424

2525
.. _netcdf.group.warning:
@@ -30,7 +30,7 @@ To save a DataTree object as a netCDF file containing many groups, use the ``:py
3030

3131
In particular in the netCDF data model dimensions are entities that can exist regardless of whether any variable possesses them.
3232
This is in contrast to `xarray's data model <https://docs.xarray.dev/en/stable/user-guide/data-structures.html>`_
33-
(and hence :ref:`datatree's data model<data structures>`) in which the dimensions of a (Dataset/Tree)
33+
(and hence :ref:`datatree's data model <data structures>`) in which the dimensions of a (Dataset/Tree)
3434
object are simply the set of dimensions present across all variables in that dataset.
3535

3636
This means that if a netCDF file contains dimensions but no variables which possess those dimensions,
@@ -43,10 +43,10 @@ Zarr
4343
Groups
4444
~~~~~~
4545

46-
Nested groups in zarr stores can be represented by loading the store as a ``:py:class::DataTree`` object, similarly to netCDF.
47-
To open a whole zarr store as a tree of groups use the ``:py:func::open_datatree()`` function.
48-
To save a DataTree object as a zarr store containing many groups, use the ``:py:meth::DataTree.to_zarr()`` method.
46+
Nested groups in zarr stores can be represented by loading the store as a :py:class:`DataTree` object, similarly to netCDF.
47+
To open a whole zarr store as a tree of groups use the :py:func:`open_datatree` function.
48+
To save a DataTree object as a zarr store containing many groups, use the :py:meth:`DataTree.to_zarr()` method.
4949

5050
.. note::
51-
Note that perfect round-tripping should always be possible with a zarr store (:ref:`unlike for netCDF files<netcdf.group.warning>`),
51+
Note that perfect round-tripping should always be possible with a zarr store (:ref:`unlike for netCDF files <netcdf.group.warning>`),
5252
as zarr does not support "unused" dimensions.

0 commit comments

Comments
 (0)