haive.core.graph.node.registry¶
Node registry for managing and accessing nodes.
This module provides a registry for node configurations, allowing nodes to be registered, looked up, and managed throughout the application.
Classes¶
Registry for node configurations and types. |
Module Contents¶
- class haive.core.graph.node.registry.NodeRegistry[source]¶
Bases:
haive.core.registry.base.AbstractRegistry
[haive.core.graph.node.config.NodeConfig
]Registry for node configurations and types.
This registry keeps track of all registered node configurations and implements the AbstractRegistry interface from the Haive framework.
It provides methods for: - Registering node configurations - Looking up nodes by ID, name, or type - Listing all nodes or nodes of a specific type - Registering custom node types
Initialize the registry with empty storage.
- find_by_id(id)[source]¶
Find a node configuration by ID.
- Parameters:
id (str) – Node ID
- Returns:
Node configuration if found, None otherwise
- Return type:
- find_by_name(name)[source]¶
Find a node configuration by name (searches all types).
- Parameters:
name (str) – Node name
- Returns:
Node configuration if found, None otherwise
- Return type:
- get(item_type, name)[source]¶
Get a node configuration by type and name.
- Parameters:
item_type (haive.core.graph.node.types.NodeType) – Node type
name (str) – Node name
- Returns:
Node configuration if found, None otherwise
- Return type:
- get_all(item_type)[source]¶
Get all nodes of a specific type.
- Parameters:
item_type (haive.core.graph.node.types.NodeType) – Node type
- Returns:
Dictionary mapping node names to configurations
- Return type:
- list(item_type)[source]¶
List all node names of a specific type.
- Parameters:
item_type (haive.core.graph.node.types.NodeType) – Node type
- Returns:
List of node names
- Return type:
- register(item)[source]¶
Register a node configuration.
- Parameters:
item (haive.core.graph.node.config.NodeConfig) – Node configuration to register
- Returns:
The registered node configuration
- Return type:
- register_custom_node_type(name, config_class)[source]¶
Register a custom node configuration class.
- Parameters:
name (str) – Name of the custom node type
config_class (type[haive.core.graph.node.config.NodeConfig]) – Custom NodeConfig class
- Return type:
None