how to get parent calculation node

14 views
Skip to first unread message

Witty Yonng

unread,
Apr 17, 2023, 9:06:46 PM4/17/23
to aiidausers
Hello everyone,

As I know, we can use "node.inputs.parent_folder" to get parent_folder, but how can we get parent calculation node so that we can easily check the data stored in it?

Best,
Witty

mbe...@gmail.com

unread,
Apr 23, 2023, 3:52:50 AM4/23/23
to aiidausers

Hello again Witty, 👋

You most certainly can! Simply use the .creator attribute. So in your case node.inputs.parent_folder.creator should get you what you need.

Here’s a more complete example, assuming you’ve loaded the code, structure and required imports:

# First run builder = PwBaseWorkChain.get_builder_from_protocol(code=code, structure=structure) results, node = run_get_node(builder) # Restart restart_builder = PwBaseWorkChain.get_builder_from_protocol(code=code, structure=structure) parameters = restart_builder.pw.parameters.get_dict() parameters['ELECTRONS']['startingpot'] = 'file' restart_builder.pw.parameters = orm.Dict(parameters) restart_builder.pw.parent_folder = node.outputs.remote_folder restart_results, restart_node = run_get_node(restart_builder) restart_node.inputs.pw.parent_folder.creator

Hope that helps! 🚀

Best,
Marnik

Reply all
Reply to author
Forward
0 new messages