Skip to content

Commit dd4fa23

Browse files
authored
Add debugging guidance
Show how to load a failed workflow to debug a task schema script.
1 parent 46d1c14 commit dd4fa23

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

docs/source/user/getting_started/errors.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,22 @@
6969
we can see it requires hpcflow version 0.2.0a147. The specification of this dependency has since been updated
7070
such that current releases of MatFlow specify a particular version of hpcFlow.
7171
So, to get the correct version of hpcflow (for the case above), you can do: ``pip install hpcflow-new2==0.2.0a147``.
72+
73+
74+
Debugging
75+
##########
76+
77+
Sometimes it is necessary to debug a task schema.
78+
This is often easier done outside of {{ app_name }}, and one approach is to use a failed workflow run to extract the inputs
79+
that were passed to the task schema, and run the rest of the code in a python script.
80+
This can be achieved like this:
81+
82+
.. code-block:: python
83+
84+
import matflow as mf
85+
wk = mf.Workflow("./path_to_failed_workflow/")
86+
inputs = wk.tasks.failed_task_name.elements[0].iterations[0].action_runs[0].get_py_script_func_kwargs()
87+
output = failed_task_name(**inputs)
88+
89+
For this approach you will need to define the functions in the `failed_task_schema` script locally, i.e. copy them from {{ app_name }}.
90+

0 commit comments

Comments
 (0)