aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
431 stars 187 forks source link

Small change in the behavior of `verdi group list` #4572

Open ramirezfranciscof opened 3 years ago

ramirezfranciscof commented 3 years ago

After using groups to organize my nodes, I find that the verdi group list may be improved by the following small changes:

Example:

$ verdi group list
  PK  Label                              Type string    User                         Node count
----  --------------------------------   -------------  -------------------------  ------------
   1  structures/3ddb_2020/all           core           myname@mail.com                   24901
   3  structures/3ddb_2020/electrides    core           myname@mail.com                      45
   2  workflows/restartgen/0started      core           myname@mail.com                       0
   4  workflows/restartgen/finished      core           myname@mail.com                       0

$ verdi group list struct
  PK  Label                              Type string    User                         Node count
----  --------------------------------   -------------  -------------------------  ------------
   1  structures/3ddb_2020/all           core           myname@mail.com                   24901
   3  structures/3ddb_2020/electrides    core           myname@mail.com                      45

EDIT: Also, enable autocomplete as in verdi group show

chrisjsewell commented 3 years ago

Allow to include the "begining" of the label as an argument and filter results accordingly (ease of just listing the groups you are interested in, specially if you have a lot of groups).

Especially for this, but also for the others, I would also look at verdi group path ls (also linking to #3914)

chrisjsewell commented 3 years ago

perhaps we even just merge them in some way

chrisjsewell commented 3 years ago

List the count of nodes by default

I'd say not by default, because it would be slower, but indeed it would be helpful 👍

sphuber commented 3 years ago

List the count of nodes by default

I would be careful with this. For bigger projects with groups with many nodes, this can give considerable slow down that make the command very annoying to use

ramirezfranciscof commented 3 years ago

Especially for this, but also for the others, I would also look at verdi group path ls (also linking to #3914)

perhaps we even just merge them in some way

I believe it is still valuable to have both, and as long as these are just user accessibility options with not too much maintainance required, I don't see any drawback (contrary to maintainig two database backends, for example). Although I see how verdi group path ls would be better for very long projects or if you have many projects or groups, for the ammount of groups I am currently handling it is still more confortable to just list the full path with one command rather than needing to do the ls through a folder-like structure.

I'd say not by default, because it would be slower, but indeed it would be helpful 👍

I would be careful with this. For bigger projects with groups with many nodes, this can give considerable slow down that make the command very annoying to use

Ah, good point, I didn't think of performance because it always shows it quickly for me (although my database is still under the 1MM nodes). Yeah, maybe that could go away.

sphuber commented 2 years ago

I would note that the last feature request is already there, but one should use the -s/--startswith option. That leaves essentially ordering by label instead of pk by default. Even though there is the -O/--order-by option, I think the label is a more sensible default.