sisl.viz.Plot
- class sisl.viz.Plot(*args, **kwargs)[source]
Bases:
Workflow
Base class for all plots
Methods
evaluate_input_node
(node)final_node_key
(*args)Returns the key of the final (output) node of the workflow.
find_node_key
(node, *args)Returns the identifier key of a node in this workflow
from_func
([func, context])Builds a node from a function.
from_node_tree
(output_node[, workflow_name])Creates a workflow class from a node.
get
()Returns the up to date output of the workflow.
get_input
(key)get_tree
()is_output_outdated
(evaluated_inputs)Checks if the node needs to be ran
map_inputs
(inputs, func[, only_nodes, exclude])Maps all inputs of the node applying a given function.
merge
(*others, **kwargs)- rtype
recursive_update_inputs
([cls])Updates the inputs of the node recursively.
setup
(*args, **kwargs)Sets up the node based on its initial inputs.
update_inputs
(**inputs)Updates the inputs of the workflow.
update_settings
(*args, **kwargs)- DELETE_KWARG = <object object>
- __call__(*args, **kwargs)
Call self as a function.
- __init__(*args, **kwargs)
- context: NodeContext = NodeContext({}, {}, {}, {'lazy': True, 'lazy_init': None, 'log_level': 'INFO', 'raise_custom_errors': False})
- property default_inputs
- dryrun_nodes: WorkflowNodes
- static evaluate_input_node(node)
- classmethod final_node_key(*args)
Returns the key of the final (output) node of the workflow.
- Return type
- classmethod find_node_key(node, *args)
Returns the identifier key of a node in this workflow
- Return type
- classmethod from_func(func=None, context=None)
Builds a node from a function.
- Parameters
func (function, optional) –
The function to be converted to a node.
If not provided, the return of this method is just a lambda function that expects the function. This is useful if you want to use this method as a decorator while also providing extra arguments (like the context argument).
context (dict, optional) – The context to be used as the default for the node class that will be created.
- classmethod from_node_tree(output_node, workflow_name=None)
Creates a workflow class from a node.
It does so by recursively traversing the tree in the inputs direction until it finds the leaves. All the nodes found are included in the workflow. For each node, inputs that are not nodes are connected to the inputs of the workflow.
- Parameters
output_node (Node) – The final node, that should be connected to the output of the workflow.
workflow_name (str, optional) – The name of the new workflow class. If None, the name of the output node will be used.
- Returns
The newly created workflow class.
- Return type
Workflow
- function: Callable
- get()
Returns the up to date output of the workflow.
It will recompute it if necessary.
- get_input(key)
- get_tree()
- property inputs
- is_output_outdated(evaluated_inputs)
Checks if the node needs to be ran
- logs: str
- map_inputs(inputs, func, only_nodes=False, exclude=())
Maps all inputs of the node applying a given function.
It considers the args and kwargs keys.
- Parameters
inputs (Dict[str, Any]) – The inputs of the node.
func (Callable) – The function to apply to each value.
only_nodes (bool, optional) – Whether to apply the function only to nodes, by default False.
exclude (Sequence[str], optional) – The keys to exclude from the mapping. This means that these keys are returned as they are.
- Return type
- network = <sisl.nodes.workflow.Network object>
- nodes: WorkflowNodes
- recursive_update_inputs(cls=None, **inputs)
Updates the inputs of the node recursively.
This method updates the inputs of the node and all its children.
- Parameters
cls (Optional[Union[Type, Tuple[Type, ...]]], optional) – Only update nodes of this class. If None, update all nodes.
inputs (Dict[str, Any]) – The inputs to update.
- setup(*args, **kwargs)
Sets up the node based on its initial inputs.
- update_inputs(**inputs)
Updates the inputs of the workflow.