generated from njzjz/python-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |