Not able to delete the CalcJobNodes

9 views
Skip to first unread message

Pradip Si

unread,
Jun 6, 2023, 1:57:40 PM6/6/23
to aiidausers
Dear Aiida users,
I am trying to delete all previous calcJobNodes or WorkChainNodes. Even after doing that, it's still showing all the nodes in QueryBuilder. Any suggestions?
Thank you in advance for your time and assistance.

Best regards,
Pradip

from aiida.tools import delete_nodes
delete_nodes(list(range(640206, 640327)), dry_run=False)


Sebastiaan Huber

unread,
Jun 6, 2023, 2:17:51 PM6/6/23
to aiida...@googlegroups.com
Hi Pradip,

I note that in your example you are only deleting a range of pks.
Are you sure those are all the pks in your database?
What is your code for using the QueryBuilder to show there are no nodes left?

If you want to target directly all CalcJobNodes, you could do the following
from aiida.orm import QueryBuilder, CalcJobNode
pks = QueryBuilder().append(CalcJobNode, project='id').all(flat=True)
delete_nodes(pks)

The query first gets all the pks of all CalcJobNodes which it then passes to `delete_nodes`.
Note that this will delete all nodes that are also attached to the calcjobnodes, in order to keep a consistent graph.
For more details, please refer to the documentation: https://aiida.readthedocs.io/projects/aiida-core/en/latest/howto/data.html?highlight=delete_nodes#deleting-data

Regards,

Sebastiaan
--
AiiDA is supported by the NCCR MARVEL (http://nccr-marvel.ch/), funded by the Swiss National Science Foundation, and by the European H2020 MaX Centre of Excellence (http://www.max-centre.eu/).
 
Before posting your first question, please see the posting guidelines at http://www.aiida.net/?page_id=356 .
---
You received this message because you are subscribed to the Google Groups "aiidausers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aiidausers+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aiidausers/6a423a81-5867-47f3-8bca-dc06f0437c98n%40googlegroups.com.

Pradip Si

unread,
Jun 6, 2023, 2:50:01 PM6/6/23
to aiida...@googlegroups.com
Hi,
I followed your suggestions. But still the nodes are showing.
################
delete_nodes(pks)
Report: 330 Node(s) marked for deletion
Report: This was a dry run, exiting without deleting anything
#############
Does it run successfully?

Pradip

mail

unread,
Jun 6, 2023, 3:02:58 PM6/6/23
to aiidausers
Hi Pradip,

That was a dry run as the message reported.
To make it actual, you have to specify dry_run=False as you did in your original example.

Regards,

Sebastiaan 


On Jun 6, 2023 at 8:50 PM, Pradip Si <pradip...@gmail.com> wrote:

Hi,
I followed your suggestions. But still the nodes are showing.
################
delete_nodes(pks)
Report: 330 Node(s) marked for deletion
Report: This was a dry run, exiting without deleting anything
#############
Does it run successfully?

Pradip

On Tue, Jun 6, 2023 at 1:17 PM Sebastiaan Huber <ma...@sphuber.net> wrote:

--
AiiDA is supported by the NCCR MARVEL (http://nccr-marvel.ch/), funded by the Swiss National Science Foundation, and by the European H2020 MaX Centre of Excellence (http://www.max-centre.eu/).
 
Before posting your first question, please see the posting guidelines at http://www.aiida.net/?page_id=356 .
---
You received this message because you are subscribed to the Google Groups "aiidausers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aiidausers+...@googlegroups.com.

Pradip Si

unread,
Jun 6, 2023, 3:12:16 PM6/6/23
to aiida...@googlegroups.com
Thanks. But for some reason the nodes are still appearing. I need to do something with the latest CalcJobNodes and anyway I can change my code to do that. If you have any other suggestions please let me know.

Pradip

Sebastiaan Huber

unread,
Jun 7, 2023, 3:48:09 AM6/7/23
to aiida...@googlegroups.com
Hi Pradip,

Unfortunately you are not providing enough information to make a guess of what might be going on.
I would recommend you open an issue on the Github repo: https://github.com/aiidateam/aiida-core/issues/new/choose
And then explain in great detail exactly what you are doing.
What commands are you running, what is their output and explain as best as possible why you think things are not working as expected.

Regards,

Sebastiaan
Reply all
Reply to author
Forward
0 new messages