Skip to content

Commit

Permalink
extend integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Oct 3, 2024
1 parent 2dd5911 commit 5981fd9
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def convert_lammps_job_dict(job_dict: dict) -> LammpsJob:
generic=GenericInput(
calc_mode=generic_input_dict["calc_mode"],
structure=generic_input_dict["structure"],
temperature=generic_input_dict["temperature"],
temperature=generic_input_dict.get("temperature", None),
n_ionic_steps=generic_input_dict["n_ionic_steps"],
n_print=generic_input_dict["n_print"],
temperature_damping_timescale=generic_input_dict[
Expand Down
54 changes: 49 additions & 5 deletions tests/test_pyiron_atomistics_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ def setUp(self):
self.project = Project("test")

def tearDown(self):
Project("test").remove()
Project("test").remove(enable=True)

def test_sphinx(self):
def test_sphinx_calc_minimize(self):
ureg = UnitRegistry()
job = self.project.create.job.Sphinx("sx")
job = self.project.create.job.Sphinx("sx_mini")
job.structure = self.project.create.structure.ase.bulk("Al", cubic=True)
job.calc_minimize()
job.run()
Expand All @@ -48,9 +48,53 @@ def test_sphinx(self):
job_sphinx = convert_sphinx_job_dict(job_dict[job.job_name])
self.assertEqual(job_sphinx.calculation_output.generic.energy_tot[-1], -228.78315944 * ureg.eV)

def test_lammps(self):
def test_sphinx_calc_static(self):
ureg = UnitRegistry()
job = self.project.create.job.Lammps("lmp")
job = self.project.create.job.Sphinx("sx_static")
job.structure = self.project.create.structure.ase.bulk("Al", cubic=True)
job.run()
job_dict = read_dict_from_hdf(
file_name=job.project_hdf5.file_name,
h5_path="/",
recursive=True,
slash='ignore',
)
job_sphinx = convert_sphinx_job_dict(job_dict[job.job_name])
self.assertEqual(job_sphinx.calculation_output.generic.energy_tot[-1], -228.78315944 * ureg.eV)

def test_lammps_calc_static(self):
ureg = UnitRegistry()
job = self.project.create.job.Lammps("lmp_static")
job.structure = self.project.create.structure.ase.bulk("Al", cubic=True)
job.potential = '2002--Mishin-Y--Ni-Al--LAMMPS--ipr1'
job.run()
job_dict = read_dict_from_hdf(
file_name=job.project_hdf5.file_name,
h5_path="/",
recursive=True,
slash='ignore',
)
job_lammps = convert_lammps_job_dict(job_dict[job.job_name])
self.assertEqual(job_lammps.calculation_output.generic.energy_tot[-1], -9428.45286562 * ureg.eV)

def test_lammps_calc_md(self):
ureg = UnitRegistry()
job = self.project.create.job.Lammps("lmp_md")
job.structure = self.project.create.structure.ase.bulk("Al", cubic=True)
job.potential = '2002--Mishin-Y--Ni-Al--LAMMPS--ipr1'
job.run()
job_dict = read_dict_from_hdf(
file_name=job.project_hdf5.file_name,
h5_path="/",
recursive=True,
slash='ignore',
)
job_lammps = convert_lammps_job_dict(job_dict[job.job_name])
self.assertEqual(job_lammps.calculation_output.generic.energy_tot[-1], -9428.45286562 * ureg.eV)

def test_lammps_calc_minimize(self):
ureg = UnitRegistry()
job = self.project.create.job.Lammps("lmp_mini")
job.structure = self.project.create.structure.ase.bulk("Al", cubic=True)
job.potential = '2002--Mishin-Y--Ni-Al--LAMMPS--ipr1'
job.run()
Expand Down

0 comments on commit 5981fd9

Please sign in to comment.