Skip to content

Commit

Permalink
tests: check examples
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz committed Aug 23, 2024
1 parent da805bc commit fc105a6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies = [
"deepmd-kit[torch]>=3.0.0b2",
"mace-torch>=0.3.5",
"e3nn",
"dargs",
]
requires-python = ">=3.9"
readme = "README.md"
Expand All @@ -45,6 +46,7 @@ repository = "https://github.com/njzjz/deepmd_mace"
test = [
'pytest',
'pytest-cov',
"dargs>=0.4.8",
]

[tool.scikit-build]
Expand Down
28 changes: 28 additions & 0 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""Test examples."""

import json
from pathlib import Path

import pytest
from dargs.check import check
from deepmd.utils.argcheck import gen_args

from deepmd_mace.argcheck import mace_model_args # noqa: F401

example_path = Path(__file__).parent.parent / "examples"

examples = (
example_path / "water" / "mace" / "input.json",
example_path / "dprc" / "mace" / "input.json",
)


@pytest.mark.parametrize("example", examples)
def test_examples(example: Path) -> None:
"""Check whether examples meet arguments."""
with example.open("r") as f:
data = json.load(f)
check(
gen_args(),
data,
)

0 comments on commit fc105a6

Please sign in to comment.