Skip to content

Commit 0200ef4

Browse files
Do not create output directory
1 parent 4e75d32 commit 0200ef4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

test_driver/test_driver.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def _calculate(self, timestep: float, number_sampling_timesteps: int = 100, repe
3030
(MSD) of atoms during the simulation. If the MSD exceeds a given threshold value (msd_threshold), an error is
3131
raised.
3232
33+
All output files are written to the "output" directory.
34+
3335
:param timestep:
3436
Time step in picoseconds.
3537
Should be bigger than zero.
@@ -65,6 +67,7 @@ def _calculate(self, timestep: float, number_sampling_timesteps: int = 100, repe
6567
:raises KIMTestDriverError:
6668
If the crystal melts or vaporizes during the simulation.
6769
If the symmetry of the structure changes.
70+
If the output directory "output" does not exist.
6871
"""
6972
# Set prototype label
7073
self.prototype_label = self._get_nominal_crystal_structure_npt()["prototype-label"]["source-value"]
@@ -128,8 +131,9 @@ def _calculate(self, timestep: float, number_sampling_timesteps: int = 100, repe
128131

129132
atoms_new = atoms_new.repeat(repeat)
130133

131-
# Create output directory for all data files and copy over necessary files.
132-
os.makedirs("output", exist_ok=True)
134+
# Make sure output directory for all data files exists and copy over necessary files.
135+
if not os.path.exists("output"):
136+
raise KIMTestDriverError("Output directory 'output' does not exist.")
133137
test_driver_directory = os.path.dirname(os.path.realpath(__file__))
134138
if os.getcwd() != test_driver_directory:
135139
shutil.copyfile(os.path.join(test_driver_directory, "npt.lammps"), "npt.lammps")

0 commit comments

Comments
 (0)