aiida.restapi.translator.nodes.process package¶
Subpackages¶
Submodules¶
Translator for process node
-
class
aiida.restapi.translator.nodes.process.process.
ProcessTranslator
(**kwargs)[source]¶ Bases:
aiida.restapi.translator.nodes.node.NodeTranslator
Translator relative to resource ‘data’ and aiida class ~aiida.orm.nodes.data.data.Data
-
class
ProcessNode
(backend=None, user=None, computer=None, **kwargs)¶ Bases:
aiida.orm.utils.mixins.Sealable
,aiida.orm.nodes.node.Node
Base class for all nodes representing the execution of a process
This class and its subclasses serve as proxies in the database, for actual Process instances being run. The Process instance in memory will leverage an instance of this class (the exact sub class depends on the sub class of Process) to persist important information of its state to the database. This serves as a way for the user to inspect the state of the Process during its execution as well as a permanent record of its execution in the provenance graph, after the execution has terminated.
-
CHECKPOINT_KEY
= 'checkpoints'¶
-
EXCEPTION_KEY
= 'exception'¶
-
EXIT_MESSAGE_KEY
= 'exit_message'¶
-
EXIT_STATUS_KEY
= 'exit_status'¶
-
PROCESS_LABEL_KEY
= 'process_label'¶
-
PROCESS_PAUSED_KEY
= 'paused'¶
-
PROCESS_STATE_KEY
= 'process_state'¶
-
PROCESS_STATUS_KEY
= 'process_status'¶
-
__abstractmethods__
= frozenset({})¶
-
__module__
= 'aiida.orm.nodes.process.process'¶
-
__str__
()¶ Return str(self).
-
_abc_impl
= <_abc_data object>¶
-
_cachable
= False¶
-
_get_objects_to_hash
()¶ Return a list of objects which should be included in the hash.
-
_hash_ignored_inputs
= ['CALL_CALC', 'CALL_WORK']¶
-
_logger
= <Logger aiida.orm.nodes.process.process.ProcessNode (REPORT)>¶
-
_plugin_type_string
= 'process.process.ProcessNode.'¶
-
_query_type_string
= 'process.process.'¶
-
_unstorable_message
= 'only Data, WorkflowNode, CalculationNode or their subclasses can be stored'¶
-
_updatable_attributes
= ('sealed', 'paused', 'checkpoints', 'exception', 'exit_message', 'exit_status', 'process_label', 'process_state', 'process_status')¶
-
property
called
¶ Return a list of nodes that the process called
- Returns
list of process nodes called by this process
-
property
called_descendants
¶ Return a list of all nodes that have been called downstream of this process
This will recursively find all the called processes for this process and its children.
-
property
caller
¶ Return the process node that called this process node, or None if it does not have a caller
- Returns
process node that called this process node instance or None
-
property
checkpoint
¶ Return the checkpoint bundle set for the process
- Returns
checkpoint bundle if it exists, None otherwise
-
delete_checkpoint
()¶ Delete the checkpoint bundle set for the process
-
property
exception
¶ Return the exception of the process or None if the process is not excepted.
If the process is marked as excepted yet there is no exception attribute, an empty string will be returned.
- Returns
the exception message or None
-
property
exit_message
¶ Return the exit message of the process
- Returns
the exit message
-
property
exit_status
¶ Return the exit status of the process
- Returns
the exit status, an integer exit code or None
-
get_builder_restart
()¶ Return a ProcessBuilder that is ready to relaunch the process that created this node.
The process class will be set based on the process_type of this node and the inputs of the builder will be prepopulated with the inputs registered for this node. This functionality is very useful if a process has completed and you want to relaunch it with slightly different inputs.
- Returns
~aiida.engine.processes.builder.ProcessBuilder instance
-
property
is_excepted
¶ Return whether the process has excepted
Excepted means that during execution of the process, an exception was raised that was not caught.
- Returns
True if during execution of the process an exception occurred, False otherwise
- Return type
bool
-
property
is_failed
¶ Return whether the process has failed
Failed means that the process terminated nominally but it had a non-zero exit status.
- Returns
True if the process has failed, False otherwise
- Return type
bool
-
property
is_finished
¶ Return whether the process has finished
Finished means that the process reached a terminal state nominally. Note that this does not necessarily mean successfully, but there were no exceptions and it was not killed.
- Returns
True if the process has finished, False otherwise
- Return type
bool
-
property
is_finished_ok
¶ Return whether the process has finished successfully
Finished successfully means that it terminated nominally and had a zero exit status.
- Returns
True if the process has finished successfully, False otherwise
- Return type
bool
-
property
is_killed
¶ Return whether the process was killed
Killed means the process was killed directly by the user or by the calling process being killed.
- Returns
True if the process was killed, False otherwise
- Return type
bool
-
property
is_terminated
¶ Return whether the process has terminated
Terminated means that the process has reached any terminal state.
- Returns
True if the process has terminated, False otherwise
- Return type
bool
-
property
is_valid_cache
¶ Return whether the node is valid for caching
- Returns
True if this process node is valid to be used for caching, False otherwise
-
property
logger
¶ Get the logger of the Calculation object, so that it also logs to the DB.
- Returns
LoggerAdapter object, that works like a logger, but also has the ‘extra’ embedded
-
pause
()¶ Mark the process as paused by setting the corresponding attribute.
This serves only to reflect that the corresponding Process is paused and so this method should not be called by anyone but the Process instance itself.
-
property
paused
¶ Return whether the process is paused
- Returns
True if the Calculation is marked as paused, False otherwise
-
property
process_class
¶ Return the process class that was used to create this node.
- Returns
Process class
- Raises
ValueError – if no process type is defined, it is an invalid process type string or cannot be resolved to load the corresponding class
-
property
process_label
¶ Return the process label
- Returns
the process label
-
property
process_state
¶ Return the process state
- Returns
the process state instance of ProcessState enum
-
property
process_status
¶ Return the process status
The process status is a generic status message e.g. the reason it might be paused or when it is being killed
- Returns
the process status
-
set_checkpoint
(checkpoint)¶ Set the checkpoint bundle set for the process
- Parameters
state – string representation of the stepper state info
-
set_exception
(exception)¶ Set the exception of the process
- Parameters
exception – the exception message
-
set_exit_message
(message)¶ Set the exit message of the process, if None nothing will be done
- Parameters
message – a string message
-
set_exit_status
(status)¶ Set the exit status of the process
- Parameters
state – an integer exit code or None, which will be interpreted as zero
-
set_process_label
(label)¶ Set the process label
- Parameters
label – process label string
-
set_process_state
(state)¶ Set the process state
- Parameters
state – value or instance of ProcessState enum
-
set_process_status
(status)¶ Set the process status
The process status is a generic status message e.g. the reason it might be paused or when it is being killed. If status is None, the corresponding attribute will be deleted.
- Parameters
status – string process status
-
set_process_type
(process_type_string)¶ Set the process type string.
- Parameters
process_type – the process type string identifying the class using this process node as storage.
-
unpause
()¶ Mark the process as unpaused by removing the corresponding attribute.
This serves only to reflect that the corresponding Process is unpaused and so this method should not be called by anyone but the Process instance itself.
-
validate_incoming
(source, link_type, link_label)¶ Validate adding a link of the given type from a given node to ourself.
Adding an input link to a ProcessNode once it is stored is illegal because this should be taken care of by the engine in one go. If a link is being added after the node is stored, it is most likely not by the engine and it should not be allowed.
- Parameters
source – the node from which the link is coming
link_type – the link type
link_label – the link label
- Raises
TypeError – if source is not a Node instance or link_type is not a LinkType enum
ValueError – if the proposed link is invalid
-
-
__label__
= 'process'¶
-
__module__
= 'aiida.restapi.translator.nodes.process.process'¶
-
_aiida_class
¶
-
_aiida_type
= 'process.ProcessNode'¶
-
_result_type
= 'process'¶
-
class