Skip to content

Commit

Permalink
add test for MLPhononMaker
Browse files Browse the repository at this point in the history
  • Loading branch information
naik-aakash committed Jan 26, 2024
1 parent 431d1f2 commit 6929a97
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/auto/test_auto_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from unittest import mock
from pymatgen.core.structure import Structure
from autoplex.auto.jobs import get_phonon_ml_calculation_jobs, get_iso_atom, dft_phonopy_gen_data, dft_random_gen_data
from autoplex.auto.jobs import get_phonon_ml_calculation_jobs, get_iso_atom, dft_phonopy_gen_data, dft_random_gen_data, MLPhononMaker
from atomate2.common.schemas.phonons import PhononBSDOSDoc

from jobflow import run_locally
Expand All @@ -27,6 +27,23 @@ def test_get_phonon_ml_calculation_jobs(test_dir, clean_dir, memory_jobstore):
)
assert isinstance(ml_phonon_bs_doc, PhononBSDOSDoc)


def test_ml_phonon_maker(test_dir, clean_dir, memory_jobstore):
potential_file_dir = test_dir / "fitting" / "ref_files" / "gap.xml"
path_to_struct = test_dir / "fitting" / "ref_files" / "POSCAR"
structure = Structure.from_file(path_to_struct)

gap_phonon_jobs = MLPhononMaker(
ml_dir=potential_file_dir, min_length=20
).make(structure=structure)

responses = run_locally(
gap_phonon_jobs, create_folders=True, ensure_success=True, store=memory_jobstore
)

ml_phonon_bs_doc = responses[gap_phonon_jobs.jobs[-1].output.uuid][1].output
assert isinstance(ml_phonon_bs_doc, PhononBSDOSDoc)

def test_get_iso_atom(vasp_test_dir, mock_vasp, clean_dir, memory_jobstore):
structure_list = [
Structure(
Expand Down

0 comments on commit 6929a97

Please sign in to comment.