hyped.core.features.reference module

This module provides the classes for referencing nodes within a data flow system.

It includes abstractions for both concrete references, which point to real nodes in a data flow graph, and forward references, which serve as placeholders or unresolved references to be resolved later.

class hyped.core.features.reference.BaseReference[source]

Bases: ABC

Abstract base class for references to nodes within a data flow graph.

Subclasses of BaseReference represent different types of references that can be used to track or resolve elements in data flow graph. Each subclass must implement the get_dtype() method, which provides the data type associated with the reference.

abstractmethod get_dtype() None | DType[source]

Retrieve the data type associated with the reference.

Returns:

The data type corresponding to the reference.

Return type:

DType

class hyped.core.features.reference.ConcreteReference(_node_id: str, _graph: AbstractDataFlowGraph, _builder: None | AbstractDataFlowGraphBuilder)[source]

Bases: BaseReference

Represents a reference to a specific node within a data flow graph.

This class encapsulates the node identifier and the graph instance it belongs to, allowing for precise tracking and interaction with nodes in a data flow graph.

get_dtype() DType[source]

Retrieve the data type associated with the node referenced by this object.

The data type is determined by querying the associated graph.

Returns:

The data type corresponding to the node.

Return type:

DType

class hyped.core.features.reference.ForwardReference(dtype: DType | None = None)[source]

Bases: BaseReference

Represents a forward reference.

A forward reference serves as a placeholder for a node that is not yet resolved. This is often used in cases where the node or feature will be defined or linked at a later stage in the graph construction process.

dtype: DType | None = None

The data type associated with the forward reference.

Defaults to None indicating that the data type of the referenced feature is not clear yet.

get_dtype() None | DType[source]

Retrieve the data type associated with the forward reference.

Returns:

The data type corresponding to the forward reference.

Return type:

None | DType

hyped.core.features.reference.NodeId

Node ID type in the data flow graph.

Represents the identifier for a node within a data flow graph. This is typically a string that uniquely identifies a node, allowing for the tracking and referencing of nodes within the graph structure.