Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let verdi graph generate fold workflow nodes #2282

Open
3 tasks
ltalirz opened this issue Dec 4, 2018 · 3 comments
Open
3 tasks

let verdi graph generate fold workflow nodes #2282

ltalirz opened this issue Dec 4, 2018 · 3 comments
Labels
type/feature request status undecided

Comments

@ltalirz
Copy link
Member

ltalirz commented Dec 4, 2018

One of the simplest way to explain the purpose of workflows in AiiDA is that they group sets of calculations.

A very straightforward way of visualizing this is to take the data trail of a workflow and make two graphs

  • One graph showing the complete data provenance (no workflow nodes)
  • One graph showing the workflow node(s) folded in

I.e. I am looking for

  • a switch to hide workflow nodes (and their links)
  • a switch for folding in workflow nodes, i.e. replacing anything that happens inside a workflow by the workflow node with its inputs and outputs
  • a way to control the level of folding in nested workflows

This feature requires some thought, but I believe it is absolutely crucial when explaining AiiDA to new users, and it will become more and more important as we will increasingly start seeing workflows discussed in presentations.

@ltalirz ltalirz added the type/feature request status undecided label Dec 4, 2018
@ltalirz ltalirz added this to the v1.1.0 milestone Dec 4, 2018
@ConradJohnston
Copy link
Contributor

This is interesting. So when you say 'the level of folding', do you mean level as in the sense of there being potentially nested workflows?

@ltalirz
Copy link
Member Author

ltalirz commented Dec 7, 2018

do you mean level as in the sense of there being potentially nested workflows?

Indeed - updated the description to make this clearer.

@ltalirz
Copy link
Member Author

ltalirz commented Nov 7, 2019

To continue this thought:

As a first step, I propose to add a command line option --collapse to verdi node graph generate where one can pass IDs of workflow nodes to be collapsed.

The logic for collapsing a given workflow node is as follows:

  • start traversing the descendants of the Workflow Node until you hit a node that is directly returned by the workflow
  • all nodes visited this way, except for the final returned nodes are marked to be hidden and will not appear in the final graph

One way to implement this would be to do a database query (or a set of queries) to get the UUIDs of the nodes that are to be hidden, and then feed a list of these uuids to the graph creation so that these nodes are not actually added to the graphviz graph.

Note: It is still important to traverse these nodes when creating the graphviz representation - e.g. consider the case where the graph is created "upwards" (starting from descendants of the workflow to be hidden).

I'll be working on this here: https://github.com/ltalirz/aiida_core/tree/fold-nodes

Mentioning @chrisjsewell , the graphvizard ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature request status undecided
Projects
None yet
Development

No branches or pull requests

3 participants