Skip to content

Commit 0ec494e

Browse files
committed
add deprecation
1 parent ff6bc64 commit 0ec494e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_phonons.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ def test_calc_phonons():
4040
assert "phonon" in phonons.results
4141

4242

43+
def test_force_consts_to_hdf5_deprecation():
44+
"""Test calculating phonons from ASE atoms object."""
45+
struct = read(DATA_PATH / "NaCl.cif")
46+
struct.calc = choose_calculator(arch="mace_mp", model=MODEL_PATH)
47+
with pytest.warns(FutureWarning, match="--force_consts_to_hdf5 is deprecated."):
48+
phonons = Phonons(
49+
struct=struct,
50+
force_consts_to_hdf5=True,
51+
)
52+
53+
phonons.calc_force_constants(write_force_consts=True)
54+
assert "phonon" in phonons.results
55+
56+
4357
def test_optimize(tmp_path):
4458
"""Test optimizing structure before calculation."""
4559
log_file = tmp_path / "phonons.log"

0 commit comments

Comments
 (0)