Skip to content

Feature graphs

uptimely.spec.feature_graph provides dependency analysis and subgraph selection. Graph rendering belongs to uptimely.explorer.graph_render, not this package.

graph

uptimely.spec.feature_graph.graph exposes the complete feature graph and feature-level subgraphs.

Describe the feature dependency graph and resolve dependencies for requested outputs.

NodeMeta module-attribute

NodeMeta = models.FunctionNode | models.FeatureNode

GraphBase

Shared helpers for system and subset feature dependency graphs.

graph instance-attribute

graph: Graph

input_names property

input_names: list[str]

Source-provided inputs required by functions in this graph.

feature_input_names property

feature_input_names: list[str]

Raw features required by functions but not produced by one.

output_names property

output_names: list[str]

Names of features exposed by this graph.

feature_output_names property

feature_output_names: list[str]

Names of features exposed by this graph.

intermediate_names property

intermediate_names: set[str]

Names of features considered intermediate for this graph.

feature_intermediate_names property

feature_intermediate_names: set[str]

Names of features considered intermediate for this graph.

feature_names property

feature_names: set[str]

Names of all features produced by graph functions.

topology

topology(item_type: str, skip_input: bool = False) -> list[list[str | NodeMeta | Node]]

Feature names grouped by dependency level.

print_graph

print_graph() -> str

Visualize the feature dependency graph.

print

print() -> None

FeatureGraph

Bases: GraphBase

Global dependency graph built from all feature mappings.

functions instance-attribute

functions: list[FunctionTemplate] = []

spec instance-attribute

spec = spec

graph instance-attribute

graph = self._create_graph()

subset

subset(output_names: list[str] | None = None) -> SubGraph

Create the minimal SubGraph needed to vectorize the requested outputs.

SubGraph

Bases: GraphBase

Function call subset graph extracted from the global system graph.

graph instance-attribute

graph = graph

Node is the graph library's node type, re-exported from uptimely.spec.feature_graph. NodeMeta describes the feature or function metadata carried by a node.

models

uptimely.spec.feature_graph.models defines the metadata attached to feature and function nodes.

FeatureNode dataclass

Display metadata for a feature name and its logical metadata.

name instance-attribute

name: str

data_type class-attribute instance-attribute

data_type: str | None = None

entity class-attribute instance-attribute

entity: str | None = None

is_input class-attribute instance-attribute

is_input: bool = False

is_output class-attribute instance-attribute

is_output: bool = False

is_source_input class-attribute instance-attribute

is_source_input: bool = False

node_id property

node_id: str

Stable graph identifier for this feature.

is_intermediate property

is_intermediate: bool

Whether this feature is both produced and consumed by the graph.

to_render_data

to_render_data(node_type: str) -> dict[str, object]

Return display metadata for rendering this feature node.

FunctionNode dataclass

Display metadata for one declared function template.

name instance-attribute

name: str

features instance-attribute

features: tuple[str, ...]

entity instance-attribute

entity: str | None

mapping_id class-attribute instance-attribute

mapping_id: str | None = None

function class-attribute instance-attribute

function: FunctionTemplate | None = dataclasses.field(default=None, compare=False, hash=False)

node_id property

node_id: str

Stable graph identifier for this function definition.

to_render_data

to_render_data(node_type: str = 'function') -> dict[str, object]

Return display metadata for rendering this function node.