diff --git a/src/quacc/schemas/ase.py b/src/quacc/schemas/ase.py index 3dab3e0b31..3cfb4d6c8c 100644 --- a/src/quacc/schemas/ase.py +++ b/src/quacc/schemas/ase.py @@ -96,7 +96,7 @@ def summarize_run( inputs = { "parameters": final_atoms.calc.parameters, "nid": uri.split(":")[0], - "dir_name": ":".join(uri.split(":")[1:]), + "dir_name": directory, "input_atoms": input_atoms_metadata, "quacc_version": __version__, } @@ -286,7 +286,7 @@ def summarize_vib_run( "nfree": vib.nfree, }, "nid": uri.split(":")[0], - "dir_name": ":".join(uri.split(":")[1:]), + "dir_name": directory, } atoms_metadata = atoms_to_metadata( diff --git a/src/quacc/schemas/vasp.py b/src/quacc/schemas/vasp.py index 812ba7913c..af7e136074 100644 --- a/src/quacc/schemas/vasp.py +++ b/src/quacc/schemas/vasp.py @@ -86,6 +86,7 @@ def vasp_summarize_run( # Fetch all tabulated results from VASP outputs files. Fortunately, emmet # already has a handy function for this vasp_task_doc = TaskDoc.from_directory(dir_path).model_dump() + vasp_task_doc["dir_name"] = dir_path # Check for calculation convergence if check_convergence and vasp_task_doc["state"] != "successful": diff --git a/tests/core/schemas/test_ase.py b/tests/core/schemas/test_ase.py index ebd023ccb7..88d49ca2de 100644 --- a/tests/core/schemas/test_ase.py +++ b/tests/core/schemas/test_ase.py @@ -35,6 +35,7 @@ def test_summarize_run(): assert results["results"]["energy"] == atoms.get_potential_energy() assert "pymatgen_version" in results["builder_meta"] assert results["input_atoms"]["atoms"] == initial_atoms + assert Path(results["dir_name"]).is_dir() def test_summarize_run2(): diff --git a/tests/core/schemas/test_vasp_schema.py b/tests/core/schemas/test_vasp_schema.py index 702f1f6de1..4815062cee 100644 --- a/tests/core/schemas/test_vasp_schema.py +++ b/tests/core/schemas/test_vasp_schema.py @@ -1,5 +1,6 @@ import logging import os +from pathlib import Path from shutil import copytree, move import pytest @@ -58,6 +59,7 @@ def test_vasp_summarize_run(run1, monkeypatch): assert results["nsites"] == len(atoms) assert results["atoms"] == atoms assert results["output"]["energy"] == -33.15807349 + assert Path(results["dir_name"]).is_dir() # Make sure default dir works cwd = os.getcwd()