JuDFTteam / aiida-kkr

AiiDA plugin of the high-performance density functional theory code JuKKR (www.judft.de) for high-throughput electronic structure calculations.
https://aiida-kkr.readthedocs.io
MIT License
14 stars 10 forks source link

`find_parent_structure` does not work from a KkrimpCalculation node #137

Open Raff-physics opened 1 year ago

Raff-physics commented 1 year ago

Load an example KkrimpCalculation node

$ calc = load_node(...)
$ calc
<CalcJobNode: uuid: a8811c72-1992-4a5f-97fa-c416e2ad03f6 (pk: 495) (aiida.calculations:kkr.kkrimp)>

and run the find_parent_structure function results in the following error

$ find_parent_structure(calc)
Warning: find_parent_structure takes quite long (already searched 200 ancestors). Stop after 1000
Warning: find_parent_structure takes quite long (already searched 400 ancestors). Stop after 1000
Warning: find_parent_structure takes quite long (already searched 600 ancestors). Stop after 1000
Warning: find_parent_structure takes quite long (already searched 800 ancestors). Stop after 1000
Warning: find_parent_structure takes quite long (already searched 1000 ancestors). Stop after 1000

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[25], line 1
----> 1 find_parent_structure(calc)

File /opt/aiida-kkr/aiida_kkr/tools/__init__.py:36, in find_parent_structure(calc_or_remote, return_voro)
     26 """
     27 Traverse the provenance graph upwards to find the input structure
     28 from a KkrCalculation or VoronoiCalculation node or their remote_folder
   (...)
     32 :return struc: parent StructureData node
     33 """
     34 from .find_parent import find_parent_structure
---> 36 struc, voro_calc = find_parent_structure(calc_or_remote)
     38 if return_voro:
     39     return struc, voro_calc

File /opt/aiida-kkr/aiida_kkr/tools/find_parent.py:90, in find_parent_structure(parent_folder)
     88     return struc, parent_folder_tmp
     89 else:
---> 90     raise ValueError('structure not found')

ValueError: structure not found
Raff-physics commented 1 year ago

Used code version of aiida-kkr: -e git+https://github.com/JuDFTteam/aiida-kkr@06e112ca0b7c9c021eba8084a83c8db05bded206#egg=aiida_kkr

PhilippRue commented 1 year ago

TODO: add test case in find_parent test

PhilippRue commented 1 year ago

Fixed find_parent function in pull request #141