Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions tests/forcefields/test_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"Nequip": NequipMDMaker,
}


def test_maker_initialization():
# test that makers can be initialized from str or value enum

Expand Down Expand Up @@ -97,9 +98,7 @@ def test_ml_ff_md_maker(
}
unit_cell_structure = sr_ti_o3_structure.copy()
elif ff_name == "DeepMD":
calculator_kwargs = {
"model_path": test_dir / "forcefields" / "deepmd" / "graph.pb"
}
calculator_kwargs = {"model": test_dir / "forcefields" / "deepmd" / "graph.pb"}
unit_cell_structure = sr_ti_o3_structure.copy()

structure = unit_cell_structure.to_conventional() * (2, 2, 2)
Expand Down Expand Up @@ -143,8 +142,10 @@ def test_ml_ff_md_maker(
for step in task_doc.objects["trajectory"].frame_properties
)

with pytest.warns(FutureWarning):
name_to_maker[ff_name]()
# Skip the following test for DeepMD, since it doesn't have concrete implementations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to implement this? Or do you see any hurdles?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the code checks whether the concrete Maker classes raise a FutureWarning, indicating they will be deprecated. As per our earlier discussions, I’ve removed the concrete implementations for DeepMD, so this class no longer exists. Therefore, I’ve addressed this by skipping the test for DeepMD.

if ff_name != "DeepMD":
with pytest.warns(FutureWarning):
name_to_maker[ff_name]()


@pytest.mark.parametrize("traj_file", ["trajectory.json.gz", "atoms.traj"])
Expand Down
Loading