Skip to content

Commit

Permalink
Fix finding parent structure for KkrimpCalculation
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippRue committed Nov 8, 2023
1 parent 9e46c4b commit 7e61ce8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aiida_kkr/tools/find_parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ def get_remote(parent_folder):
try:
parent_folder_tmp = parent_folder_tmp0.get_incoming().get_node_by_label('remote_folder')
except NotExistent:
parent_folder_tmp = parent_folder_tmp0
try:
# check if GFhost_folder is there, this is the case for a KkrimpCalculation
parent_folder_tmp = parent_folder_tmp0.get_incoming().get_node_by_label('GFhost_folder')
except NotExistent:
parent_folder_tmp = parent_folder_tmp0
return parent_folder_tmp


Expand Down
15 changes: 15 additions & 0 deletions tests/tools/test_find_parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ def test_find_parent_structure():
assert voro_parent.uuid == '559b9d9b-3525-402e-9b24-ecd8b801853c'


def test_find_structure_kkrimp():
"""
find parent structure from a KkrimpCalculation
"""
# import_with_migration('files/db_dump_kkrimp_out.tar.gz')
kkrimp_calc = load_node('eab8db1b-2cc7-4b85-a524-0df4ff2b7da6')

# now find voronoi parent and structure
struc, voro_parent = find_parent_structure(kkrimp_calc)

# check result
assert struc.uuid == 'e51ee6a1-bd27-4901-9612-7bac256bf117'
assert voro_parent.uuid == '559b9d9b-3525-402e-9b24-ecd8b801853c'


def test_get_calc_from_remote():
"""
find parent calc from remote
Expand Down

0 comments on commit 7e61ce8

Please sign in to comment.