The current interface is:
verdi node graph generate ROOT_NODE [OUTPUT_FILE]
That is, currently, only a single root node can be specified. But it is perfectly reasonable to want to specify multiple root nodes.
To this end, this pull request was submitted and merged. It adds the -N/--nodes
option that now allows users to specify multiple root nodes. The original ROOT_NODE
argument was deprecated.
But maybe an even better design would be to change the interface to
verdi node graph generate ROOT_NODES
That is, allow for one or multiple root nodes as positional arguments and the output file can be specified through an option (e.g., --output-file
). The advantage is that this is more in line with other commands that take multiple nodes as input. They are almost always specified as arguments, with the notable exception being verdi archive create
. The only downside is that this would be breaking backwards compatibility, whereas the current solution merely deprecates the old behavior.
So, the question is, which solution do you find more intuitive:
Option-based
verdi node graph generate 100
verdi node graph generate 100 output.aiida
verdi node graph generate -N 100 101 102
verdi node graph generate -N 100 101 102 -- output.aiida
Argument-based
verdi node graph generate 100
verdi node graph generate 100 --output output.aiida
verdi node graph generate 100 101 102
verdi node graph generate 100 101 102 --output output.aiida
Even though the argument-based approach would be breaking some use cases, I think it is the better solution and would vote for adopting that over the current option-based approach. Please voice your opinions below on what you think is the best solution.