Open chrisjsewell opened 3 years ago
I'm very supportive of this.
I would ponder though - what would you expect a graph to look like if there's something like a while_
step in define
?
It may be that you can't go that far without an example or reference (intermediate) result and at this point I think there's overlap with the aiida-testing project where the caching mechanism is exploited.
In workchains we have the
define
method, which states the inputs, outputs, and logic flow (aka outline), and you can document it with https://github.com/aiidateam/aiida-core/blob/dca50f47a340ffa14302d7bd0714ba86227b4b57/aiida/sphinxext/process.py#L48To visualise an exising provenance graph, we also have https://github.com/aiidateam/aiida-core/blob/dca50f47a340ffa14302d7bd0714ba86227b4b57/aiida/tools/visualization/graph.py#L349
However, what we cannot do is create an automated graph visualisation of a Workchain's (recursive) logic flow (without running it). I think this would be nice, to be able to quickly visualise what a workchain does.
To do this you would need to be able to somehow identify and load nested Workchains/CalcJob, e.g. with
you would need to step through the outline methods, identify that
add
contains the submission ofArithmeticAddCalculation
, and load up this class to analyse itsdefine
method, ... (potentially recursively if the submitted process is also a WorkChain)Not trivial but I think worth considering