Skip to content

Commit

Permalink
Fix TaskDoc.from_directory when dir_name != "." (#873)
Browse files Browse the repository at this point in the history
* Fix issue with using dir_name != ./ in emmet.core.tasks.TaskDoc

* Revert previous change - actual fix is using path relative to dir_name of TaskDoc.from_directory

---------

Co-authored-by: esoteric-ephemera <aaronkaplan@Aarons-MBP.dhcp.lbl.gov>
  • Loading branch information
esoteric-ephemera and esoteric-ephemera committed Nov 1, 2023
1 parent 9c755a3 commit 123e8ea
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions emmet-core/emmet/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,16 +951,17 @@ def _get_task_files(files, suffix=""):
vol_files = []
elph_poscars = []
for file in files:
file_no_path = file.relative_to(path)
if file.match(f"*vasprun.xml{suffix}*"):
vasp_files["vasprun_file"] = file
vasp_files["vasprun_file"] = file_no_path
elif file.match(f"*OUTCAR{suffix}*"):
vasp_files["outcar_file"] = file
vasp_files["outcar_file"] = file_no_path
elif file.match(f"*CONTCAR{suffix}*"):
vasp_files["contcar_file"] = file
vasp_files["contcar_file"] = file_no_path
elif any(file.match(f"*{f}{suffix}*") for f in volumetric_files):
vol_files.append(file)
vol_files.append(file_no_path)
elif file.match(f"*POSCAR.T=*{suffix}*"):
elph_poscars.append(file)
elph_poscars.append(file_no_path)

if len(vol_files) > 0:
# add volumetric files if some were found or other vasp files were found
Expand Down

0 comments on commit 123e8ea

Please sign in to comment.