You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/2020_Intro_Week/sections/workflows_adv.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,9 @@ They consist of two parts: a positive integer, called the exit status, and a mes
18
18
If the exit status is zero, which is the default, the process is said to have terminated nominally and *finished successfully*.
19
19
A non-zero exit status is often used to communicate that there was some kind of a problem during the execution of the process and in that case it is said to be *failed*.
20
20
However, the severity of the problem can vary and a non-zero exit status can also be used to just give a warning and does not necessarily mean the process suffered a critical error.
21
-
Still, in AiiDA, a non-zero exit status technically marks a process as failed and the :meth:`~aiida.orm.nodes.process.ProcessNode.is_failed` property will return `True`.
21
+
Still, in AiiDA, a non-zero exit status technically marks a process as failed and the `~aiida.orm.nodes.process.ProcessNode.is_failed`` property will return `True`.
22
22
23
-
Exit codes can be defined using the :meth:`~aiida.engine.processes.process_spec.ProcessSpec.exit_code` method during the process specification in the :meth:`~aiida.engine.processes.process.Process.define` method.
23
+
Exit codes can be defined using the :meth:`~aiida.engine.processes.process_spec.ProcessSpec.exit_code` method during the process specification in the `~aiida.engine.processes.process.Process.define` method.
24
24
It takes three arguments: the exit status, an exit label for easy reference and the exit message.
25
25
Take the ``MultiplyAddWorkChain`` as an example:
26
26
@@ -362,7 +362,7 @@ To "register" a process handler for a base restart work chain implementation, yo
362
362
363
363
The method name can be anything as long as it is a valid Python method name and does not overlap with one of the base work chain's methods.
364
364
For better readability, it is, however, recommended to have the method name start with ``handle_``.
365
-
In this example, we want to specifically check for a particular failure mode of the ``ArithmeticAddCalculation``, so we compare the :meth:`~aiida.orm.nodes.process.process.ProcessNode.exit_status` of the node with that of the spec of the process.
365
+
In this example, we want to specifically check for a particular failure mode of the ``ArithmeticAddCalculation``, so we compare the `~aiida.orm.nodes.process.process.ProcessNode.exit_status` of the node with that of the spec of the process.
366
366
If the exit code matches, we know that the problem was due to the sum being negative.
367
367
Fixing this fictitious problem for this example is as simple as making sure that the inputs are all positive, which we can do by taking the absolute value of them.
368
368
We assign the new values to the ``self.ctx.inputs`` just as where we defined the original inputs in the ``setup`` step.
0 commit comments