Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAS-2155 - Merge datatree documentation into main docs. #9033

Merged
merged 76 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
fd8802c
DAS-2155 - Merge datatree documentation into main docs.
owenlittlejohns May 8, 2024
eb23afb
DAS-2155 - Add PR reference to whats-new.rst.
owenlittlejohns May 18, 2024
bf3a1e7
DAS-2155 - Fix DataTree documentation string insertion test.
owenlittlejohns May 18, 2024
2353d17
DAS-2067 - Expose DataTree API in xarray public API.
owenlittlejohns May 21, 2024
8779f8f
DAS-2067 - Clean up DataTree imports in tests.
owenlittlejohns May 21, 2024
e2e88e3
DAS-2155 - Revert typing change to Test_summarize_datatree_children.c…
owenlittlejohns May 21, 2024
f813910
DAS-2155 - Move quick-start information to getting-started-guide.
owenlittlejohns May 21, 2024
c38796f
DAS-2155 - Minor items in documentation.
owenlittlejohns May 23, 2024
0228777
DAS-2155 - Add DataTree related exceptions to public API.
owenlittlejohns May 28, 2024
4f8cc1c
DAS-2155 - Add note regarding DataTree.to_netcdf.
owenlittlejohns May 30, 2024
983de0c
Update doc/getting-started-guide/quick-overview.rst
owenlittlejohns Jun 3, 2024
efb2e6e
Merge branch 'main' into DAS-2155-merge-datatree-docs
owenlittlejohns Jun 14, 2024
30535c3
Merge branch 'main' into DAS-2155-merge-datatree-docs
owenlittlejohns Jun 18, 2024
da6646f
Merge remote-tracking branch 'origin/main' into DAS-2155-merge-datatr…
flamingbear Jul 23, 2024
e146400
Merge branch 'main' into DAS-2155-merge-datatree-docs
flamingbear Jul 23, 2024
b303d62
DAS-2155: Updates imports from benchmark PR.
flamingbear Jul 23, 2024
bf4413b
DAS-2155: Oriol suggestions.
flamingbear Jul 24, 2024
068bab2
DAS-2155: Fix build errors in docs for numpy 2.0
flamingbear Jul 24, 2024
2698681
DAS-2155: First stab at updatating quick-overview.rst for inherited c…
flamingbear Jul 24, 2024
97c183d
DAS-2155: removes erroneous example
flamingbear Jul 25, 2024
2507475
DAS-2155: tidying for inheritance.
flamingbear Jul 26, 2024
032f5cb
DAS-2155: Another first stab at adding a hierarchy structure example.
flamingbear Jul 26, 2024
f3edabb
DAS-2155: Fix typo.
flamingbear Jul 26, 2024
b6e6163
DAS-2155: Reorder, and fix bullet list
flamingbear Jul 26, 2024
9e4b737
DAS-2155: Updates datastructures with extensive (too?) example
flamingbear Jul 26, 2024
3529b87
DAS-2155: Cleans what I can from hierarichal-data.rst.
flamingbear Jul 29, 2024
832215b
Merge remote-tracking branch 'upstream/main' into DAS-2155-merge-data…
flamingbear Jul 29, 2024
87597e9
DAS-2155: Fix bad merge
flamingbear Jul 29, 2024
ee7c3a9
DAS-2155: Cleanup removes ``item`` for references.
flamingbear Jul 29, 2024
421c404
DAS-2155: Replaces a bunch of ``item`` with references.
flamingbear Jul 29, 2024
a9d9d3d
Merge remote-tracking branch 'upstream/main' into DAS-2155-merge-data…
flamingbear Jul 29, 2024
49cc828
DAS-2155: hand merge whats-new.rst
flamingbear Jul 30, 2024
12f685b
Merge remote-tracking branch 'upstream/main' into DAS-2155-merge-data…
flamingbear Jul 30, 2024
fb8eae1
DAS-2155: updates developer meeting notes link. (unrelated)
flamingbear Jul 31, 2024
ec341ad
DAS-2155: These are the changes merged from #9298
flamingbear Jul 31, 2024
6f51cc1
Merge remote-tracking branch 'upstream/main' into DAS-2155-merge-data…
flamingbear Jul 31, 2024
fa459d9
DAS-2155: Format for merge
flamingbear Aug 2, 2024
e957e33
Merge remote-tracking branch 'upstream/main' into DAS-2155-merge-data…
flamingbear Aug 2, 2024
80ebed0
Merge branch 'main' into DAS-2155-merge-datatree-docs
flamingbear Aug 20, 2024
3ce24c5
DAS-2155: Adds open_groups to the API and docs
flamingbear Aug 21, 2024
8b259f1
Merge branch 'main' into DAS-2155-merge-datatree-docs
flamingbear Aug 27, 2024
7612e46
Merge branch 'main' into DAS-2155-merge-datatree-docs
flamingbear Sep 2, 2024
c98be70
DAS-2155: Drop sphinx back even further.
flamingbear Sep 2, 2024
9f2e94a
Merge remote-tracking branch 'upstream/main' into DAS-2155-merge-data…
flamingbear Sep 8, 2024
60d3fae
Merge remote-tracking branch 'upstream/main' into DAS-2155-merge-data…
flamingbear Sep 10, 2024
9cd79b3
Merge remote-tracking branch 'upstream/main' into DAS-2155-merge-data…
flamingbear Sep 11, 2024
508a5c7
DAS-2155: Cleaning up data-structures.rst for new shallow parent updates
flamingbear Sep 11, 2024
7705c87
Merge remote-tracking branch 'upstream/main' into DAS-2155-merge-data…
flamingbear Sep 11, 2024
3f20d34
DAS-2155: fix merge
flamingbear Sep 11, 2024
6bfc31b
DAS-2155: work around sphinx-book-theme/#749
flamingbear Sep 11, 2024
15d16aa
DAS-2155: change datatree.ds -> datatree.dataset
flamingbear Sep 12, 2024
06aa829
DAS-2155: Lots of simpsons fixes for shallow parentage.
flamingbear Sep 12, 2024
e8464b3
DAS-2155: Delete datatree_ directory
flamingbear Sep 12, 2024
c661a58
DAS-2155: remove vestiges of datatree_
flamingbear Sep 12, 2024
bb659f8
DAS-2155: Some wording changes and link fixes
flamingbear Sep 12, 2024
506a575
Merge branch 'main' into DAS-2155-merge-datatree-docs
flamingbear Sep 12, 2024
9ddbfd5
Update doc/getting-started-guide/quick-overview.rst
flamingbear Sep 12, 2024
77e4d0a
Update doc/user-guide/data-structures.rst
flamingbear Sep 12, 2024
bf3a2fd
Update doc/user-guide/data-structures.rst
flamingbear Sep 12, 2024
25543fb
Update doc/getting-started-guide/quick-overview.rst
flamingbear Sep 12, 2024
3f7a639
Update doc/getting-started-guide/quick-overview.rst
flamingbear Sep 12, 2024
4cea57f
remove ordered
flamingbear Sep 12, 2024
43a9ecf
data -> dataset
flamingbear Sep 12, 2024
f5a4993
remove parent from constructor params
flamingbear Sep 12, 2024
47a363c
duplicate word typo
flamingbear Sep 12, 2024
82bf8f3
DAS-2155: Drop detailed note on ordered trees
flamingbear Sep 12, 2024
d3ee632
DAS-2155: removes .to_dataset inherited flag example
flamingbear Sep 12, 2024
1de00ac
explicitly mention dimensions are inherited
flamingbear Sep 12, 2024
f705f4c
better header for Hierarchical data
flamingbear Sep 12, 2024
97261c1
typo
flamingbear Sep 12, 2024
81863e8
Merge branch 'main' into DAS-2155-merge-datatree-docs
flamingbear Sep 12, 2024
d698bdd
DAS-2155: update what's new
flamingbear Sep 12, 2024
50982bd
Merge branch 'main' into DAS-2155-merge-datatree-docs
flamingbear Sep 12, 2024
a1c2f11
DAS-2155: typo
flamingbear Sep 12, 2024
ae8bb71
DAS-2155: Fix earlier bad merge
flamingbear Sep 12, 2024
9e179d2
DAS-2155: Updates to call out inherited coordinates and inherited flag
flamingbear Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ci/requirements/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ dependencies:
- sphinx-copybutton
- sphinx-design
- sphinx-inline-tabs
- sphinx>=5.0
- sphinx=6.2.1 # sphinx-book-theme issue: 749
- sphinxcontrib-srclinks
- sphinxext-opengraph
- sphinxext-rediraffe
- zarr>=2.10
Expand Down
336 changes: 336 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,298 @@ Reshaping and reorganizing
DataArray.sortby
DataArray.broadcast_like

DataTree
========

Creating a DataTree
-------------------

Methods of creating a ``DataTree``.

.. autosummary::
:toctree: generated/

DataTree
DataTree.from_dict

Tree Attributes
---------------

Attributes relating to the recursive tree-like structure of a ``DataTree``.

.. autosummary::
:toctree: generated/

DataTree.parent
DataTree.children
DataTree.name
DataTree.path
DataTree.root
DataTree.is_root
DataTree.is_leaf
DataTree.leaves
DataTree.level
DataTree.depth
DataTree.width
DataTree.subtree
DataTree.descendants
DataTree.siblings
DataTree.lineage
DataTree.parents
DataTree.ancestors
DataTree.groups

Data Contents
-------------

Interface to the data objects (optionally) stored inside a single ``DataTree`` node.
This interface echoes that of ``xarray.Dataset``.

.. autosummary::
:toctree: generated/

DataTree.dims
DataTree.sizes
DataTree.data_vars
DataTree.coords
DataTree.attrs
DataTree.encoding
DataTree.indexes
DataTree.nbytes
DataTree.ds
DataTree.to_dataset
DataTree.has_data
DataTree.has_attrs
DataTree.is_empty
DataTree.is_hollow

Dictionary Interface
--------------------

``DataTree`` objects also have a dict-like interface mapping keys to either ``xarray.DataArray``s or to child ``DataTree`` nodes.
flamingbear marked this conversation as resolved.
Show resolved Hide resolved

.. autosummary::
:toctree: generated/

DataTree.__getitem__
DataTree.__setitem__
DataTree.__delitem__
DataTree.update
DataTree.get
DataTree.items
DataTree.keys
DataTree.values

Tree Manipulation
-----------------

For manipulating, traversing, navigating, or mapping over the tree structure.

.. autosummary::
:toctree: generated/

DataTree.orphan
DataTree.same_tree
DataTree.relative_to
DataTree.iter_lineage
DataTree.find_common_ancestor
DataTree.map_over_subtree
DataTree.pipe
DataTree.match
DataTree.filter

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

``DataTree`` objects deliberately echo some of the API of :py:class:`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
-----------------

Manipulate the contents of all nodes in a ``DataTree`` simultaneously.

.. autosummary::
:toctree: generated/

DataTree.copy
DataTree.assign_coords
DataTree.merge
DataTree.rename
DataTree.rename_vars
DataTree.rename_dims
DataTree.swap_dims
DataTree.expand_dims
DataTree.drop_vars
DataTree.drop_dims
DataTree.set_coords
DataTree.reset_coords

DataTree Node Contents
----------------------

Manipulate the contents of a single ``DataTree`` node.

.. autosummary::
:toctree: generated/

DataTree.assign
DataTree.drop_nodes

Comparisons
-----------

Compare one ``DataTree`` object to another.

.. autosummary::
:toctree: generated/

DataTree.isomorphic
DataTree.equals
DataTree.identical

Indexing
--------

Index into all nodes in the subtree simultaneously.

.. autosummary::
:toctree: generated/

DataTree.isel
DataTree.sel
DataTree.drop_sel
DataTree.drop_isel
DataTree.head
DataTree.tail
DataTree.thin
DataTree.squeeze
DataTree.interp
DataTree.interp_like
DataTree.reindex
DataTree.reindex_like
DataTree.set_index
DataTree.reset_index
DataTree.reorder_levels
DataTree.query

..

Missing:
``DataTree.loc``


Missing Value Handling
----------------------

.. autosummary::
:toctree: generated/

DataTree.isnull
DataTree.notnull
DataTree.combine_first
DataTree.dropna
DataTree.fillna
DataTree.ffill
DataTree.bfill
DataTree.interpolate_na
DataTree.where
DataTree.isin

Computation
-----------

Apply a computation to the data in all nodes in the subtree simultaneously.

.. autosummary::
:toctree: generated/

DataTree.map
DataTree.reduce
DataTree.diff
DataTree.quantile
DataTree.differentiate
DataTree.integrate
DataTree.map_blocks
DataTree.polyfit
DataTree.curvefit

Aggregation
-----------

Aggregate data in all nodes in the subtree simultaneously.

.. autosummary::
:toctree: generated/

DataTree.all
DataTree.any
DataTree.argmax
DataTree.argmin
DataTree.idxmax
DataTree.idxmin
DataTree.max
DataTree.min
DataTree.mean
DataTree.median
DataTree.prod
DataTree.sum
DataTree.std
DataTree.var
DataTree.cumsum
DataTree.cumprod

ndarray methods
---------------

Methods copied from :py:class:`numpy.ndarray` objects, here applying to the data in all nodes in the subtree.

.. autosummary::
:toctree: generated/

DataTree.argsort
DataTree.astype
DataTree.clip
DataTree.conj
DataTree.conjugate
DataTree.round
DataTree.rank

Reshaping and reorganising
--------------------------

Reshape or reorganise the data in all nodes in the subtree.

.. autosummary::
:toctree: generated/

DataTree.transpose
DataTree.stack
DataTree.unstack
DataTree.shift
DataTree.roll
DataTree.pad
DataTree.sortby
DataTree.broadcast_like

IO / Conversion
===============

Expand Down Expand Up @@ -652,6 +944,22 @@ DataArray methods
DataArray.load
DataArray.unify_chunks

DataTree methods
----------------

.. autosummary::
:toctree: generated/

xarray.backends.api.open_datatree
DataTree.to_dict
DataTree.to_netcdf
DataTree.to_zarr

..

Missing:
``open_mfdatatree``

Coordinates objects
===================

Expand Down Expand Up @@ -1071,6 +1379,15 @@ Testing
testing.assert_allclose
testing.assert_chunks_equal

Test that two ``DataTree`` objects are similar.

.. autosummary::
:toctree: generated/

testing.assert_isomorphic
testing.assert_equal
testing.assert_identical

Hypothesis Testing Strategies
=============================

Expand Down Expand Up @@ -1101,6 +1418,18 @@ Exceptions
MergeError
SerializationWarning

DataTree
--------

Exceptions raised when manipulating trees.

.. autosummary::
:toctree: generated/

xarray.core.datatree_mapping.TreeIsomorphismError
xarray.core.treenode.InvalidTreeError
xarray.core.treenode.NotFoundInTreeError

Advanced API
============

Expand All @@ -1110,6 +1439,7 @@ Advanced API
Coordinates
Dataset.variables
DataArray.variable
DataTree.variables
Variable
IndexVariable
as_variable
Expand All @@ -1118,12 +1448,18 @@ Advanced API
Context
register_dataset_accessor
register_dataarray_accessor
xarray.core.extensions.register_datatree_accessor
Dataset.set_close
backends.BackendArray
backends.BackendEntrypoint
backends.list_engines
backends.refresh_engines

..

Missing:
``DataTree.set_close``

Default, pandas-backed indexes built-in Xarray:

indexes.PandasIndex
Expand Down
Loading
Loading