Compiler and plans¶
uptimely.compiler turns spec into portable execution plans. Its plan
subpackage owns the plan models and JSON serialization.
compiler¶
uptimely.compiler.compiler provides the compilation entry point.
Compile spec into portable execution plans.
Compiler
¶
Turn a Spec instance or JSON path into a portable execution plan.
callable_node¶
uptimely.compiler.callable_node represents a callable in the compilation graph.
CallableNode
dataclass
¶
One fragment, calculation, or sink function invocation.
args
class-attribute
instance-attribute
¶
args: dict[str, object] = dataclasses.field(default_factory=dict, compare=False, hash=False)
row_context
class-attribute
instance-attribute
¶
row_context: RowContext | None = dataclasses.field(default=None, compare=False, hash=False)
to_render_data
¶
to_render_data(node_type: str = 'callable') -> dict[str, object]
Return display metadata for rendering this callable node.
execution_graph¶
uptimely.compiler.execution_graph organizes callable dependencies.
Describe callable invocation dependencies and resolve call ordering.
CallableGraph
¶
Dependency graph built from callable invocations and their feature dependencies.
collapse_input_dataset_id
¶
collapse_input_dataset_id(node: CallableNode) -> str
Infer the input dataset from a collapse node's spec binding.
dataset_for
¶
dataset_for(node: CallableNode) -> spec.Dataset
Return a node's dataset from the validated entity-scoped index.
mapping_for
¶
mapping_for(node: CallableNode) -> spec.Mapping
Return the declaration that produced a callable node.
topology
¶
topology() -> list[list[callable_node_module.CallableNode]]
Return callables grouped by dependency level (topological order).
subset
¶
subset(features: list[str]) -> CallableGraph
Return the dependency closure needed to produce selected features.
dependencies
¶
dependencies(node: CallableNode) -> list[callable_node_module.CallableNode]
Return callables that directly produce the node's dependencies.
get_callable_order
¶
get_callable_order() -> list[callable_node_module.CallableNode]
Return callables in execution order (topological sort).
plan.models¶
uptimely.compiler.plan.models defines the portable plan and its callables.
Portable execution-plan data transfer objects.
Callable
dataclass
¶
One executable function invocation in a portable plan.
arguments
class-attribute
instance-attribute
¶
arguments: dict[str, Any] = dataclasses.field(default_factory=dict)
dependency_ids
class-attribute
instance-attribute
¶
dependency_ids: list[str] = dataclasses.field(default_factory=list)
output_features
class-attribute
instance-attribute
¶
output_features: list[str] = dataclasses.field(default_factory=list)
input_features
class-attribute
instance-attribute
¶
input_features: list[str] = dataclasses.field(default_factory=list)
function_id
property
¶
function_id: str
Return the function identifier encoded in this callable's id.
Plan
dataclass
¶
Portable, JSON-serializable execution plan.
from_dict
classmethod
¶
from_dict(payload: dict[str, Any]) -> Plan
Load a portable plan from a decoded JSON object.
ExecutionPlan
dataclass
¶
Portable execution plan with JSON round-trip support.
execution_stages
property
¶
execution_stages: list[list[Callable]]
Return staged callables resolved from stage identifiers.
to_dict
¶
to_dict() -> dict[str, typing.Any]
Return the portable plan as plain JSON-compatible data.
from_json
classmethod
¶
from_json(path: str | Path) -> ExecutionPlan
Load a portable plan without loading or recompiling Spec.
plan.serialization¶
uptimely.compiler.plan.serialization reads and writes plan JSON.