Commit d054d15c authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Wrapped reference resolution with exception catching to avoid issues when...

Wrapped reference resolution with exception catching to  avoid issues when running in test environment which does not have access to referenced calculations.
parent 1ab5a1ee
...@@ -81,10 +81,15 @@ def parse_without_class(name, backend): ...@@ -81,10 +81,15 @@ def parse_without_class(name, backend):
set_of_forces, phonopy_obj, Relative_Path = Collect_Forces_aims(cell_obj, supercell_matrix, displacement, sym) set_of_forces, phonopy_obj, Relative_Path = Collect_Forces_aims(cell_obj, supercell_matrix, displacement, sym)
Prep_Path = name.split("phonopy-FHI-aims-displacement-") Prep_Path = name.split("phonopy-FHI-aims-displacement-")
Whole_Path = [] Whole_Path = []
for Path in Relative_Path:
abs_path = "%s%s" % (Prep_Path[0], Path) # Try to resolve references as paths relative to the upload root.
rel_path = abs_path.split(nomad.config.fs.staging + "/")[1].split("/", 3)[3] try:
Whole_Path.append(rel_path) for Path in Relative_Path:
abs_path = "%s%s" % (Prep_Path[0], Path)
rel_path = abs_path.split(nomad.config.fs.staging + "/")[1].split("/", 3)[3]
Whole_Path.append(rel_path)
except Exception:
logging.warn("Could not resolve path to a referenced calculation within the upload.")
phonopy_obj.set_forces(set_of_forces) phonopy_obj.set_forces(set_of_forces)
phonopy_obj.produce_force_constants() phonopy_obj.produce_force_constants()
FC2 = phonopy_obj.get_force_constants() FC2 = phonopy_obj.get_force_constants()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment