Workflow References¶
build_nomad_workflow()
¶
summary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workflow_metadata
|
dict[str, str]
|
description. Defaults to {}. |
{}
|
node_attributes
|
NodeAttributes
|
description. Defaults to {}. |
{}
|
workflow_graph
|
DiGraph
|
description. Defaults to None. |
None
|
write_to_yaml
|
bool
|
description. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
DiGraph
|
nx.DiGraph: description |
nodes_to_graph()
¶
Builds a workflow graph (nx.DiGraph) from a NodeAttributesUniverse of node attributes as specified below.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_attributes_universe
|
NodeAttributesUniverse
|
A NodeAttributesUniverse object containing the node |
required |
Returns:
Type | Description |
---|---|
DiGraph
|
nx.DiGraph: description |
NodeAttributes¶
Bases: BaseModel
NodeAttributes represents the attributes of a node in the NOMAD workflow graph.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
A free-form string describing this node, which will be used as a label in the NOMAD workflow graph visualizer. |
type |
Literal['input', 'output', 'workflow', 'task']
|
Specifies the type of node. Must be one of the specified options.
|
entry_type |
Literal['simulation']
|
Specifies the type of node in terms of tasks or workflows recognized by NOMAD. Functionally, this attribute is used to create default inputs and outputs that are required for properly creating the edge visualizations in the NOMAD GUI. |
path_info |
dict
|
Information for generating the NOMAD archive section paths (i.e., connections between nodes in terms of the NOMAD MetaInfo sections).
|
inputs |
list[dict]
|
A list of input nodes to be added to the graph with in_edges to the parent node.
|
outputs |
list[dict]
|
A list of output nodes to be added to the graph with out_edges from the parent node.
|
in_edge_nodes |
list[int]
|
A list of integers specifying the node keys which contain in-edges to this node. |
out_edge_nodes |
list[int]
|
A list of integers specifying the node keys which contain out-edges to this node. |
get(key, default=None)
¶
Allows dictionary-like access to the attributes of the NodeAttributes class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str
|
The attribute name to retrieve. |
required |
default
|
Any
|
The default value to return if the attribute is not found. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The value of the attribute if it exists, otherwise the default value. |