DataTree#
Creating a DataTree#
Methods of creating a DataTree
.
|
A tree-like hierarchical collection of xarray objects. |
|
Create a datatree from a dictionary of data objects, organised by paths into the tree. |
Tree Attributes#
Attributes relating to the recursive tree-like structure of a DataTree
.
Parent of this node. |
|
Child nodes of this node, stored under a mapping via their names. |
|
The name of this node. |
|
Return the file-like path from the root to this node. |
|
Root node of the tree |
|
Whether this node is the tree root. |
|
Whether this node is a leaf node. |
|
All leaf nodes. |
|
Level of this node. |
|
Maximum level of this tree. |
|
Number of nodes at this level in the tree. |
|
Iterate over all nodes in this tree, including both self and all descendants. |
|
Iterate over relative paths and node pairs for all nodes in this tree. |
|
Child nodes and all their child nodes. |
|
Nodes with the same parent as this node. |
|
All parent nodes and their parent nodes, starting with the closest. |
|
All parent nodes and their parent nodes, starting with the closest. |
|
All parent nodes and their parent nodes, starting with the most distant. |
|
Return all groups in the tree, given as a tuple of path-like strings. |
|
Mapping of xarray Index objects used for label based indexing. |
Data Contents#
Interface to the data objects (optionally) stored inside a single DataTree
node.
This interface echoes that of xarray.Dataset
.
Mapping from dimension names to lengths. |
|
Mapping from dimension names to lengths. |
|
Dictionary of DataArray objects corresponding to data variables |
|
An immutable Dataset-like view onto the data in this node. |
|
Dictionary of xarray.DataArray objects corresponding to coordinate variables |
|
Dictionary of global attributes on this node object. |
|
Dictionary of global encoding attributes on this node object. |
|
Mapping of pandas.Index objects used for label based indexing. |
|
An immutable Dataset-like view onto the data in this node. |
|
|
Return the data in this node as a new xarray.Dataset object. |
Whether or not there are any variables in this node. |
|
Whether or not there are any metadata attributes in this node. |
|
False if node contains any data or attrs. |
|
True if only leaf nodes contain data. |
|
Mapping from group paths to a mapping of chunksizes. |
Dictionary Interface#
DataTree
objects also have a dict-like interface mapping keys to either xarray.DataArray
s or to child DataTree
nodes.
|
Access child nodes, variables, or coordinates stored anywhere in this tree. |
|
Add either a child node or an array to the tree, at any position. |
|
Remove a variable or child node from this datatree node. |
|
Update this node's children and / or variables. |
|
Access child nodes, variables, or coordinates stored in this node. |
Tree Manipulation#
For manipulating, traversing, navigating, or mapping over the tree structure.
Detach this node from its parent. |
|
|
True if other node is in the same tree as this node. |
|
Compute the relative path from this node to node other. |
Iterate up the tree, starting from the current node. |
|
Find the first common ancestor of two nodes in the same tree. |
|
|
Apply a function to every dataset in this subtree, returning a new tree which stores the results. |
|
Apply |
|
Return nodes with paths matching pattern. |
|
Filter nodes according to a specified condition. |
|
Filter a datatree like another datatree. |
Pathlib-like Interface#
DataTree
objects deliberately echo some of the API of pathlib.PurePath
.
The name of this node. |
|
Parent of this node. |
|
All parent nodes and their parent nodes, starting with the closest. |
|
|
Compute the relative path from this node to node other. |
DataTree Contents#
Manipulate the contents of all nodes in a DataTree
simultaneously.
|
Returns a copy of this subtree. |
DataTree Node Contents#
Manipulate the contents of a single DataTree
node.
|
Assign new data variables or child nodes to a DataTree, returning a new object with all the original items in addition to the new ones. |
|
Drop child nodes from this node. |
DataTree Operations#
Apply operations over multiple DataTree
objects.
|
Applies a function to every dataset in one or more DataTree objects with the same structure (ie.., that are isomorphic), returning new trees which store the results. |
|
Iterate over subtrees grouped by relative paths in breadth-first order. |
Comparisons#
Compare one DataTree
object to another.
|
Two DataTrees are considered isomorphic if the set of paths to their descendent nodes are the same. |
|
Two DataTrees are equal if they have isomorphic node structures, with matching node names, and if they have matching variables and coordinates, all of which are equal. |
|
Like equals, but also checks attributes on all datasets, variables and coordinates, and requires that any inherited coordinates at the tree root are also inherited on the other tree. |
Indexing#
Index into all nodes in the subtree simultaneously.
|
Returns a new data tree with each array indexed along the specified dimension(s). |
|
Returns a new data tree with each array indexed by tick labels along the specified dimension(s). |
Aggregation#
Aggregate data in all nodes in the subtree simultaneously.
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
|
Reduce this DataTree's data by applying |
ndarray methods#
Methods copied from numpy.ndarray
objects, here applying to the data in all nodes in the subtree.
|
Returns the indices that would sort this array. |
Complex-conjugate all elements. |
|
|
a.conj() |
|