aiida.orm.nodes.process package#
Module with Node sub classes for processes.
Subpackages#
- aiida.orm.nodes.process.calculation package
- Submodules
CalcFunctionNode
CalcFunctionNodeLinks
CalcJobNode
CalcJobNode.CALC_JOB_STATE_KEY
CalcJobNode.IMMIGRATED_KEY
CalcJobNode.REMOTE_WORKDIR_KEY
CalcJobNode.RETRIEVE_LIST_KEY
CalcJobNode.RETRIEVE_TEMPORARY_LIST_KEY
CalcJobNode.SCHEDULER_DETAILED_JOB_INFO_KEY
CalcJobNode.SCHEDULER_JOB_ID_KEY
CalcJobNode.SCHEDULER_LAST_CHECK_TIME_KEY
CalcJobNode.SCHEDULER_LAST_JOB_INFO_KEY
CalcJobNode.SCHEDULER_STATE_KEY
CalcJobNode._CLS_NODE_CACHING
CalcJobNode.__abstractmethods__
CalcJobNode.__module__
CalcJobNode.__parameters__
CalcJobNode.__plugin_type_string
CalcJobNode.__qb_fields__
CalcJobNode.__query_type_string
CalcJobNode._abc_impl
CalcJobNode._hash_ignored_attributes
CalcJobNode._logger
CalcJobNode._tools
CalcJobNode._updatable_attributes
CalcJobNode._validate_retrieval_directive()
CalcJobNode.delete_state()
CalcJobNode.fields
CalcJobNode.get_authinfo()
CalcJobNode.get_description()
CalcJobNode.get_detailed_job_info()
CalcJobNode.get_job_id()
CalcJobNode.get_last_job_info()
CalcJobNode.get_option()
CalcJobNode.get_options()
CalcJobNode.get_parser_class()
CalcJobNode.get_remote_workdir()
CalcJobNode.get_retrieve_list()
CalcJobNode.get_retrieve_temporary_list()
CalcJobNode.get_retrieved_node()
CalcJobNode.get_scheduler_lastchecktime()
CalcJobNode.get_scheduler_state()
CalcJobNode.get_scheduler_stderr()
CalcJobNode.get_scheduler_stdout()
CalcJobNode.get_state()
CalcJobNode.get_transport()
CalcJobNode.is_imported
CalcJobNode.link_label_retrieved
CalcJobNode.res
CalcJobNode.set_detailed_job_info()
CalcJobNode.set_job_id()
CalcJobNode.set_last_job_info()
CalcJobNode.set_option()
CalcJobNode.set_options()
CalcJobNode.set_remote_workdir()
CalcJobNode.set_retrieve_list()
CalcJobNode.set_retrieve_temporary_list()
CalcJobNode.set_scheduler_state()
CalcJobNode.set_state()
CalcJobNode.tools
CalcJobNodeCaching
CalculationNode
CalculationNode.__abstractmethods__
CalculationNode.__module__
CalculationNode.__parameters__
CalculationNode.__plugin_type_string
CalculationNode.__query_type_string
CalculationNode._abc_impl
CalculationNode._cachable
CalculationNode._logger
CalculationNode._storable
CalculationNode._unstorable_message
CalculationNode.fields
CalculationNode.inputs
CalculationNode.outputs
- Submodules
- aiida.orm.nodes.process.workflow package
- Submodules
WorkChainNode
WorkChainNode.STEPPER_STATE_INFO_KEY
WorkChainNode.__abstractmethods__
WorkChainNode.__module__
WorkChainNode.__parameters__
WorkChainNode.__plugin_type_string
WorkChainNode.__query_type_string
WorkChainNode._abc_impl
WorkChainNode._logger
WorkChainNode._updatable_attributes
WorkChainNode.fields
WorkChainNode.set_stepper_state_info()
WorkChainNode.stepper_state_info
WorkflowNode
WorkflowNode._CLS_NODE_LINKS
WorkflowNode.__abstractmethods__
WorkflowNode.__module__
WorkflowNode.__parameters__
WorkflowNode.__plugin_type_string
WorkflowNode.__query_type_string
WorkflowNode._abc_impl
WorkflowNode._logger
WorkflowNode._storable
WorkflowNode._unstorable_message
WorkflowNode.fields
WorkflowNode.inputs
WorkflowNode.outputs
WorkflowNodeLinks
WorkFunctionNode
WorkFunctionNodeLinks
- Submodules
Submodules#
Module with Node sub class for processes.
- class aiida.orm.nodes.process.process.ProcessNode(backend: 'StorageBackend' | None = None, user: User | None = None, computer: Computer | None = None, **kwargs: Any)[source]#
-
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'#
- _CLS_NODE_CACHING#
alias of
ProcessNodeCaching
- _CLS_NODE_LINKS#
alias of
ProcessNodeLinks
- __abstractmethods__ = frozenset({})#
- __annotations__ = {'METADATA_INPUTS_KEY': <class 'str'>, '_CLS_COLLECTION': 'Type[CollectionType]', '__plugin_type_string': 'ClassVar[str]', '__qb_fields__': 'Sequence[QbField]', '__query_type_string': 'ClassVar[str]', '_hash_ignored_attributes': 'Tuple[str, ...]', '_logger': 'Optional[Logger]', '_updatable_attributes': 'Tuple[str, ...]', 'fields': 'QbFields'}#
- __module__ = 'aiida.orm.nodes.process.process'#
- __parameters__ = ()#
- __qb_fields__: Sequence[QbField] = [QbStrField('process_type', dtype=Optional[str], is_attribute=True), QbNumericField('computer_pk', dtype=Optional[int], is_attribute=True), QbStrField('process_label', dtype=Optional[str], is_attribute=True), QbStrField('process_state', dtype=Optional[str], is_attribute=True), QbStrField('process_status', dtype=Optional[str], is_attribute=True), QbNumericField('exit_status', dtype=Optional[int], is_attribute=True), QbStrField('exit_message', dtype=Optional[str], is_attribute=True), QbStrField('exception', dtype=Optional[str], is_attribute=True), QbField('paused', dtype=bool, is_attribute=True)]#
- _abc_impl = <_abc._abc_data object>#
- _unstorable_message = 'only Data, WorkflowNode, CalculationNode or their subclasses can be stored'#
- _updatable_attributes: Tuple[str, ...] = ('sealed', 'paused', 'checkpoints', 'exception', 'exit_message', 'exit_status', 'process_label', 'process_state', 'process_status')#
- property called: List[ProcessNode]#
Return a list of nodes that the process called
- Returns:
list of process nodes called by this process
- property called_descendants: List[ProcessNode]#
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: ProcessNode | None#
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: str | None#
Return the checkpoint bundle set for the process
- Returns:
checkpoint bundle if it exists, None otherwise
- property exception: str | None#
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_code: ExitCode | None#
Return the exit code of the process.
It is reconstituted from the
exit_status
andexit_message
attributes if both of those are defined.- Returns:
The exit code if defined, or
None
.
- property exit_status: int | None#
Return the exit status of the process
- Returns:
the exit status, an integer exit code or None
- fields: QbFields = {'attributes': 'QbDictField(attributes.*) -> Dict[str, Any]', 'computer_pk': 'QbNumericField(attributes.computer_pk) -> Optional[int]', 'ctime': 'QbNumericField(ctime) -> datetime', 'description': 'QbStrField(description) -> str', 'exception': 'QbStrField(attributes.exception) -> Optional[str]', 'exit_message': 'QbStrField(attributes.exit_message) -> Optional[str]', 'exit_status': 'QbNumericField(attributes.exit_status) -> Optional[int]', 'extras': 'QbDictField(extras.*) -> Dict[str, Any]', 'label': 'QbStrField(label) -> str', 'mtime': 'QbNumericField(mtime) -> datetime', 'node_type': 'QbStrField(node_type) -> str', 'paused': 'QbField(attributes.paused) -> bool', 'pk': 'QbNumericField(pk) -> int', 'process_label': 'QbStrField(attributes.process_label) -> Optional[str]', 'process_state': 'QbStrField(attributes.process_state) -> Optional[str]', 'process_status': 'QbStrField(attributes.process_status) -> Optional[str]', 'process_type': 'QbStrField(attributes.process_type) -> Optional[str]', 'repository_metadata': 'QbDictField(repository_metadata) -> Dict[str, Any]', 'sealed': 'QbField(attributes.sealed) -> bool', 'user_pk': 'QbNumericField(user_pk) -> int', 'uuid': 'QbStrField(uuid) -> str'}#
- get_builder_restart() ProcessBuilder [source]#
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
- get_metadata_inputs() Dict[str, Any] | None [source]#
Return the mapping of inputs corresponding to
metadata
ports that were passed to the process.
- property is_excepted: bool#
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:
- property is_failed: bool#
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:
- property is_finished: bool#
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:
- property is_finished_ok: bool#
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:
- property is_killed: bool#
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:
- property is_terminated: bool#
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:
- 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() None [source]#
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: bool#
Return whether the process is paused
- Returns:
True if the Calculation is marked as paused, False otherwise
- property process_class: Type[Process]#
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_state: ProcessState | None#
Return the process state
- Returns:
the process state instance of ProcessState enum
- property process_status: str | None#
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
- classmethod recursive_merge(left: dict[Any, Any], right: dict[Any, Any]) None [source]#
Recursively merge the
right
dictionary into theleft
dictionary.- Parameters:
left – Base dictionary.
right – Dictionary to recurisvely merge on top of
left
dictionary.
- set_checkpoint(checkpoint: str) None [source]#
Set the checkpoint bundle set for the process
- Parameters:
state – string representation of the stepper state info
- set_exception(exception: str) None [source]#
Set the exception of the process
- Parameters:
exception – the exception message
- set_exit_message(message: str | None) None [source]#
Set the exit message of the process, if None nothing will be done
- Parameters:
message – a string message
- set_exit_status(status: None | Enum | int) None [source]#
Set the exit status of the process
- Parameters:
state – an integer exit code or None, which will be interpreted as zero
- set_metadata_inputs(value: Dict[str, Any]) None [source]#
Set the mapping of inputs corresponding to
metadata
ports that were passed to the process.
- set_process_label(label: str) None [source]#
Set the process label
- Parameters:
label – process label string
- set_process_state(state: str | ProcessState | None)[source]#
Set the process state
- Parameters:
state – value or instance of ProcessState enum
- set_process_status(status: str | None) None [source]#
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
- class aiida.orm.nodes.process.process.ProcessNodeCaching(node: Node)[source]#
Bases:
NodeCaching
Interface to control caching of a node instance.
- __annotations__ = {}#
- __module__ = 'aiida.orm.nodes.process.process'#
- _hash_ignored_inputs = ['CALL_CALC', 'CALL_WORK']#
- get_objects_to_hash() List[Any] [source]#
Return a list of objects which should be included in the hash.
- class aiida.orm.nodes.process.process.ProcessNodeLinks(node: Node)[source]#
Bases:
NodeLinks
Interface for links of a node instance.
- __annotations__ = {}#
- __module__ = 'aiida.orm.nodes.process.process'#
- validate_incoming(source: Node, link_type: LinkType, link_label: str) None [source]#
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
- validate_outgoing(target, link_type, link_label)[source]#
Validate adding a link of the given type from ourself to a given node.
Adding an outgoing link from a sealed node is forbidden.
- Parameters:
target – the node to which the link is going
link_type – the link type
link_label – the link label
- Raises:
aiida.common.ModificationNotAllowed – if the source node (self) is sealed