MODULE REFERENCE
relations
anomx.data.base.relationsOptional relational overlays for observation sets.
Graphs and hierarchies are not separate top-level dataset types. They are additional structural dimensions that can be attached to any ObservationSet and consumed by views or models that support them.
classView source ↗
Hierarchy
Hierarchy(links: pd.DataFrame, child_column: str = 'child', parent_column: str = 'parent', metadata: dict[str, Any] = <factory: dict>)Parent-child relationships between entities.
| Parameter | Type | Default |
|---|---|---|
links | pd.DataFrame | required |
child_column | str | 'child' |
parent_column | str | 'parent' |
metadata | dict[str, Any] | <factory: dict> |
Members
linksattribute
links: pd.DataFramechild_columnattribute
child_column: str = 'child'parent_columnattribute
parent_column: str = 'parent'metadataattribute
metadata: dict[str, Any] = field(default_factory=dict)parent_ofmethod
parent_of(child: Any) -> Any | None| Parameter | Type | Default |
|---|---|---|
child | Any | required |
Returns Any | None
children_ofmethod
children_of(parent: Any) -> list[Any]| Parameter | Type | Default |
|---|---|---|
parent | Any | required |
Returns list[Any]
rootsmethod
classView source ↗
RelationSet
RelationSet(edges: pd.DataFrame, source_column: str = 'source', target_column: str = 'target', weight_column: str | None = None, metadata: dict[str, Any] = <factory: dict>)Edge list connecting observations or entities.
| Parameter | Type | Default |
|---|---|---|
edges | pd.DataFrame | required |
source_column | str | 'source' |
target_column | str | 'target' |
weight_column | str | None | None |
metadata | dict[str, Any] | <factory: dict> |
Members
edgesattribute
edges: pd.DataFramesource_columnattribute
source_column: str = 'source'target_columnattribute
target_column: str = 'target'weight_columnattribute
weight_column: str | None = Nonemetadataattribute
metadata: dict[str, Any] = field(default_factory=dict)edge_countproperty
neighborsmethod
neighbors(node: Any) -> list[Any]| Parameter | Type | Default |
|---|---|---|
node | Any | required |
Returns list[Any]