@pytest.mark.skipif((not os.environ.get('lmp', False)), reason='lmp not found in environment: Please install LAMMPS and set the $lmp env. variable to point to the executatble.')
@pytest.mark.parametrize('bodies', body_list)
@pytest.mark.parametrize('multihyps', multi_list)
def test_lmp_predict(all_lmp, all_gp, all_mgp, bodies, multihyps):
    '\n    test the lammps implementation\n    '
    prefix = f'{bodies}{multihyps}'
    mgp_model = all_mgp[prefix]
    gp_model = all_gp[prefix]
    lmp_calculator = all_lmp[prefix]
    ase_calculator = FLARE_Calculator(gp_model, mgp_model, par=False, use_mapping=True)
    np.random.seed(1)
    cell = (np.diag(np.array([1, 1, 1])) * 4)
    nenv = 10
    unique_species = gp_model.training_statistics['species']
    cutoffs = gp_model.cutoffs
    (struc_test, f) = get_random_structure(cell, unique_species, nenv)
    ase_atoms_flare = struc_test.to_ase_atoms()
    ase_atoms_flare = FLARE_Atoms.from_ase_atoms(ase_atoms_flare)
    ase_atoms_flare.set_calculator(ase_calculator)
    ase_atoms_lmp = deepcopy(struc_test).to_ase_atoms()
    ase_atoms_lmp.set_calculator(lmp_calculator)
    try:
        lmp_en = ase_atoms_lmp.get_potential_energy()
        flare_en = ase_atoms_flare.get_potential_energy()
        lmp_stress = ase_atoms_lmp.get_stress()
        flare_stress = ase_atoms_flare.get_stress()
        lmp_forces = ase_atoms_lmp.get_forces()
        flare_forces = ase_atoms_flare.get_forces()
    except Exception as e:
        os.chdir(curr_path)
        print(e)
        raise e
    os.chdir(curr_path)
    print('energy', (lmp_en - flare_en), flare_en)
    assert np.isclose(lmp_en, flare_en, atol=0.001)
    print('force', (lmp_forces - flare_forces), flare_forces)
    assert np.isclose(lmp_forces, flare_forces, atol=0.001).all()
    print('stress', (lmp_stress - flare_stress), flare_stress)
    assert np.isclose(lmp_stress, flare_stress, atol=0.001).all()
    clean(prefix=prefix)
test the lammps implementation
@pytest.mark.skipif((not os.environ.get('lmp', False)), reason='lmp not found in environment: Please install LAMMPS and set the $lmp env. variable to point to the executatble.')
@pytest.mark.parametrize('bodies', body_list)
@pytest.mark.parametrize('multihyps', multi_list)
def test_lmp_predict(all_lmp, all_gp, all_mgp, bodies, multihyps):
    '\n    \n    '
    prefix = f'{bodies}{multihyps}'
    mgp_model = all_mgp[prefix]
    gp_model = all_gp[prefix]
    lmp_calculator = all_lmp[prefix]
    ase_calculator = FLARE_Calculator(gp_model, mgp_model, par=False, use_mapping=True)
    np.random.seed(1)
    cell = (np.diag(np.array([1, 1, 1])) * 4)
    nenv = 10
    unique_species = gp_model.training_statistics['species']
    cutoffs = gp_model.cutoffs
    (struc_test, f) = get_random_structure(cell, unique_species, nenv)
    ase_atoms_flare = struc_test.to_ase_atoms()
    ase_atoms_flare = FLARE_Atoms.from_ase_atoms(ase_atoms_flare)
    ase_atoms_flare.set_calculator(ase_calculator)
    ase_atoms_lmp = deepcopy(struc_test).to_ase_atoms()
    ase_atoms_lmp.set_calculator(lmp_calculator)
    try:
        lmp_en = ase_atoms_lmp.get_potential_energy()
        flare_en = ase_atoms_flare.get_potential_energy()
        lmp_stress = ase_atoms_lmp.get_stress()
        flare_stress = ase_atoms_flare.get_stress()
        lmp_forces = ase_atoms_lmp.get_forces()
        flare_forces = ase_atoms_flare.get_forces()
    except Exception as e:
        os.chdir(curr_path)
        print(e)
        raise e
    os.chdir(curr_path)
    print('energy', (lmp_en - flare_en), flare_en)
    assert np.isclose(lmp_en, flare_en, atol=0.001)
    print('force', (lmp_forces - flare_forces), flare_forces)
    assert np.isclose(lmp_forces, flare_forces, atol=0.001).all()
    print('stress', (lmp_stress - flare_stress), flare_stress)
    assert np.isclose(lmp_stress, flare_stress, atol=0.001).all()
    clean(prefix=prefix)