Node Module¶
NodeManager(adapter: Any, project: ProjectSummary, node_id: str)
¶
Node manager for a specific node within a project.
Provides node-specific operations like editing parameters, metadata, and properties without requiring project and node context on each method call.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adapter
|
Any
|
adapter adapter (FluidizeSDK or Localadapter) |
required |
project
|
ProjectSummary
|
The project this node belongs to |
required |
node_id
|
str
|
The ID of the node this manager is bound to |
required |
id: str
property
¶
Get the node ID.
Returns:
Type | Description |
---|---|
str
|
The ID of the node this manager is bound to |
data: Any
property
¶
Get the node's data.
Returns:
Type | Description |
---|---|
Any
|
The data of the graph node |
get_node() -> GraphNode
¶
Get the complete graph node data.
Returns:
Type | Description |
---|---|
GraphNode
|
GraphNode containing the node data |
Raises:
Type | Description |
---|---|
ValueError
|
If the node is not found in the project graph |
exists() -> bool
¶
Check if this node exists in the project graph.
Returns:
Type | Description |
---|---|
bool
|
True if the node exists, False otherwise |
delete() -> None
¶
Delete this node from the project graph and filesystem.
update_position(x: float, y: float) -> GraphNode
¶
Update the node's position in the graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
New x coordinate |
required |
y
|
float
|
New y coordinate |
required |
Returns:
Type | Description |
---|---|
GraphNode
|
The updated graph node |
get_metadata() -> nodeMetadata_simulation
¶
Get the node's metadata from metadata.yaml.
Returns:
Type | Description |
---|---|
nodeMetadata_simulation
|
The node's metadata |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If metadata file doesn't exist |
ValueError
|
If metadata file is invalid |
update_metadata(**kwargs: Any) -> nodeMetadata_simulation
¶
Update specific fields in the node's metadata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Fields to update (e.g., name="New Name", description="New desc") |
{}
|
Returns:
Type | Description |
---|---|
nodeMetadata_simulation
|
The updated metadata |
Raises:
Type | Description |
---|---|
AttributeError
|
If trying to update a field that doesn't exist |
save_metadata(metadata: nodeMetadata_simulation) -> None
¶
Save metadata object to the node's metadata.yaml file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata
|
nodeMetadata_simulation
|
The metadata object to save |
required |
get_properties() -> nodeProperties_simulation
¶
Get the node's properties from properties.yaml.
Returns:
Type | Description |
---|---|
nodeProperties_simulation
|
The node's properties |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If properties file doesn't exist |
ValueError
|
If properties file is invalid |
update_properties(**kwargs: Any) -> nodeProperties_simulation
¶
Update specific fields in the node's properties.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Fields to update (e.g., container_image="new:tag", should_run=False) |
{}
|
Returns:
Type | Description |
---|---|
nodeProperties_simulation
|
The updated properties |
Raises:
Type | Description |
---|---|
AttributeError
|
If trying to update a field that doesn't exist |
save_properties(properties: nodeProperties_simulation) -> None
¶
Save properties object to the node's properties.yaml file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
properties
|
nodeProperties_simulation
|
The properties object to save |
required |
get_parameters_model() -> nodeParameters_simulation
¶
Get the node's parameters model from parameters.json.
Returns:
Type | Description |
---|---|
nodeParameters_simulation
|
The node's parameters model |
Raises:
Type | Description |
---|---|
FileNotFoundError
|
If parameters file doesn't exist |
ValueError
|
If parameters file is invalid |
get_parameters() -> list[Parameter]
¶
Get the node's parameters list from parameters.json.
Returns:
Type | Description |
---|---|
list[Parameter]
|
List of Parameter objects for the node |
get_parameter(name: str) -> Optional[Parameter]
¶
Get a specific parameter by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the parameter to retrieve |
required |
Returns:
Type | Description |
---|---|
Optional[Parameter]
|
The parameter if found, None otherwise |
update_parameter(parameter: Parameter) -> Parameter
¶
Update or add a parameter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameter
|
Parameter
|
The parameter to update/add |
required |
Returns:
Type | Description |
---|---|
Parameter
|
The updated parameter |
set_parameters(parameters: list[Parameter]) -> list[Parameter]
¶
Replace all parameters with the provided list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters
|
list[Parameter]
|
List of parameters to set |
required |
Returns:
Type | Description |
---|---|
list[Parameter]
|
The list of parameters that were set |
remove_parameter(name: str) -> bool
¶
Remove a parameter by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the parameter to remove |
required |
Returns:
Type | Description |
---|---|
bool
|
True if parameter was removed, False if it didn't exist |
show_parameters() -> str
¶
Get a formatted string display of all parameters.
Returns:
Type | Description |
---|---|
str
|
A formatted string displaying the parameters |
get_node_directory() -> UPath
¶
Get the filesystem path to this node's directory.
Returns:
Type | Description |
---|---|
UPath
|
Path to the node's directory |
get_metadata_path() -> UPath
¶
Get the filesystem path to this node's metadata.yaml file.
Returns:
Type | Description |
---|---|
UPath
|
Path to the metadata file |
get_properties_path() -> UPath
¶
Get the filesystem path to this node's properties.yaml file.
Returns:
Type | Description |
---|---|
UPath
|
Path to the properties file |
get_parameters_path() -> UPath
¶
Get the filesystem path to this node's parameters.json file.
Returns:
Type | Description |
---|---|
UPath
|
Path to the parameters file |
validate() -> dict[str, Any]
¶
Validate the node's files and structure.
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Dictionary containing validation results with keys: |
dict[str, Any]
|
|
dict[str, Any]
|
|
dict[str, Any]
|
|
dict[str, Any]
|
|
dict[str, Any]
|
|
dict[str, Any]
|
|
to_dict() -> dict[str, Any]
¶
Convert the complete node information to a dictionary.
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Dictionary containing node graph data, metadata, properties, and parameters |