get_family_tree#

get_family_tree(domain, population=None, include_boundaries=None, exclude_boundaries=None, boundary_exclude_distance=0, get_ancestors=True, get_decendants=True)#

Constructs a directed graph of the family tree of the objects in the domain.

Parents are the objects that are used to construct new objects. Children are defined as the resultant objects. Edges are directed from parent to child. Optionally, trees can be constructed about specific objects using a query where flags for selecting only ancestors or descendants can be set.

Parameters:
domainmuspan.domain

A muspan domain object.

populationquery-like, optional

Query to filter specific objects. Acceptable types: Array of object indices, muspan query, or None. Defaults to None.

include_boundariesquery-like, or None, optional

Query defining boundaries of shapes within which objects should be included. Defaults to None, which includes the whole domain.

exclude_boundariesarray-like, query-like, or None, optional

Query defining boundaries of shapes within which objects should be excluded. Defaults to None.

boundary_exclude_distancefloat, optional

Buffer to exclude objects located within boundary_exclude_distance from the boundaries. Defaults to 0.

get_ancestorsbool, optional

Flag to include ancestors in the tree. Defaults to True.

get_decendantsbool, optional

Flag to include descendants in the tree. Defaults to True.

Returns:
networkx.DiGraph

A networkx directed graph of the family tree where nodes represent muspan object ids and edges are parent-child relations.