larch.DataTree
larch.DataTree¶
- class DataTree(graph=None, root_node_name=None, extra_funcs=(), extra_vars=None, cache_dir=None, relationships=(), force_digitization=False, **kwargs)[source]¶
Bases:
sharrow.relationships.DataTree- __init__(graph=None, root_node_name=None, extra_funcs=(), extra_vars=None, cache_dir=None, relationships=(), force_digitization=False, **kwargs)[source]¶
Methods
__init__([graph, root_node_name, ...])add_dataset(name, dataset[, relationships, ...])Add a new Dataset node to this DataTree.
add_items(items)add_relationship(*args, **kwargs)Add a relationship to this DataTree.
altids()Access the altids coordinates as an index.
caseids()Access the caseids coordinates as an index.
copy()digitize_relationships([inplace, redigitize])Convert all label-based relationships into position-based.
dims_detail()Report on the names and sizes of dimensions in all Dataset nodes.
drop_dims(dims[, inplace, ignore_missing_dims])Drop dimensions from root Dataset node.
finditem(item[, maybe_in])get_expr(expression[, engine])Access or evaluate an expression.
get_indexes([position_only, as_dict, ...])get_named_array(mangled_name)get_relationship(parent, child)idco_subtree()namespace_names()query_cases(*args, **kwargs)Return a new DataTree, with a query filter applied to the root Dataset.
replace_datasets([other, validate, redigitize])Replace one or more datasets in the nodes of this tree.
setup_flow(*args, **kwargs)Set up a new Flow for analysis using the structure of this DataTree.
subspaces_iter()Attributes
The _altid_ dimension of the root Dataset.
ALTIDXThe _alt_idx_ dimension of the root Dataset, if defined.
CASEALTThe _casealt_ dimension of the root Dataset, if defined.
The _caseid_ dimension of the root Dataset.
CASEPTRThe _caseptr_ dimension of the root Dataset, if defined.
coordsdcdimsMapping from dimension names to lengths across all dataset nodes.
The size of the _altid_ dimension of the root Dataset.
The size of the _caseid_ dimension of the root Dataset.
Whether all relationships are digital (by position).
root_datasetroot_nodeThe root node for this data tree, which is only ever a parent.
shapebase shape of arrays that will be loaded when using this DataTree.
Direct access to node Dataset objects by name.