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

Group.add_nodes() function should be able to get a list of 'pk' or 'uuid' as the argument. #1320

Open
yakutovicha opened this issue Mar 22, 2018 · 1 comment
Assignees
Labels
priority/nice-to-have type/feature request status undecided type/performance Issue related to how quickly AiiDA works

Comments

@yakutovicha
Copy link
Contributor

To export a significant amount of nodes it would be good to NOT load them directly, but rather to provide a list of pk or uuid numbers to the add_nodes() function.

I think rather then doing that:

n = QueryBuilder()
n.append(Node)
flat_list = [item for sublist in n.all() for item in sublist]
some_group.add_nodes(flat_list)

it would be much nicer to do:

n = QueryBuilder()
n.append(Node, project=['id'])
flat_list = [item for sublist in n.all() for item in sublist]
some_group.add_nodes(flat_list)

Calling some_group.add_nodes() for every loaded node is very slow, so I would prefer to avoid this.

@ltalirz
Copy link
Member

ltalirz commented Mar 22, 2018

I don't quite get the need for the sublist here (the desired list of nodes could simply come out of the query by applying the appropriate filters), but I completely agree that it should not be necessary to load a node into memory in order to add it to a group.

@giovannipizzi giovannipizzi added this to the v1.0.0 milestone Dec 3, 2018
@yakutovicha yakutovicha assigned yakutovicha and unassigned lekah and szoupanos Dec 8, 2018
@sphuber sphuber modified the milestones: v1.0.0, v1.1.0 Apr 3, 2019
@sphuber sphuber removed this from the v1.1.0 milestone Feb 28, 2020
@chrisjsewell chrisjsewell added the type/performance Issue related to how quickly AiiDA works label Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/nice-to-have type/feature request status undecided type/performance Issue related to how quickly AiiDA works
Projects
None yet
Development

No branches or pull requests

7 participants