Skip to content

Commit

Permalink
split examples test based on whether thee model needs to use data.pos…
Browse files Browse the repository at this point in the history
… or not
  • Loading branch information
allaffa committed Nov 26, 2024
1 parent 8ff2553 commit 52d8d5a
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,33 @@
"PAINN",
],
)
@pytest.mark.parametrize("example", ["qm9", "md17", "LennardJones"])
@pytest.mark.parametrize("example", ["qm9", "md17"])
@pytest.mark.mpi_skip()
def pytest_examples(example, model_type):
def pytest_examples_energy(example, model_type):
path = os.path.join(os.path.dirname(__file__), "..", "examples", example)
file_path = os.path.join(path, example + ".py")

# Add the --model_type argument for the subprocess call
return_code = subprocess.call(["python", file_path, "--model_type", model_type])

# Check the file ran without error.
assert return_code == 0


@pytest.mark.parametrize(
"model_type",
[
"PNAPlus",
"SchNet",
"DimeNet",
"EGNN",
"PNAEq",
"PAINN",
],
)
@pytest.mark.parametrize("example", ["LennardJones"])
@pytest.mark.mpi_skip()
def pytest_examples_grad_forces(example, model_type):
path = os.path.join(os.path.dirname(__file__), "..", "examples", example)
file_path = os.path.join(path, example + ".py")

Expand Down

0 comments on commit 52d8d5a

Please sign in to comment.