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

ALTID

The _altid_ dimension of the root Dataset.

ALTIDX

The _alt_idx_ dimension of the root Dataset, if defined.

CASEALT

The _casealt_ dimension of the root Dataset, if defined.

CASEID

The _caseid_ dimension of the root Dataset.

CASEPTR

The _caseptr_ dimension of the root Dataset, if defined.

coords

dc

dims

Mapping from dimension names to lengths across all dataset nodes.

n_alts

The size of the _altid_ dimension of the root Dataset.

n_cases

The size of the _caseid_ dimension of the root Dataset.

relationships_are_digitized

Whether all relationships are digital (by position).

root_dataset

root_node

root_node_name

The root node for this data tree, which is only ever a parent.

shape

base shape of arrays that will be loaded when using this DataTree.

subspaces

Direct access to node Dataset objects by name.