Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the MLP tests #2120

Merged
merged 6 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 0 additions & 4 deletions tests/core/recipes/mlp_recipes/test_core_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def _set_dtype(size, type_="float"):
torch.set_default_dtype(getattr(torch, f"float{size}"))


@pytest.mark.xfail(strict=False)
@pytest.mark.parametrize("method", methods)
def test_static_job(tmp_path, monkeypatch, method):
monkeypatch.chdir(tmp_path)
Expand All @@ -66,7 +65,6 @@ def test_static_job(tmp_path, monkeypatch, method):
assert output["atoms"] == atoms


@pytest.mark.xfail(strict=False)
@pytest.mark.parametrize("method", methods)
def test_relax_job(tmp_path, monkeypatch, method):
monkeypatch.chdir(tmp_path)
Expand All @@ -90,7 +88,6 @@ def test_relax_job(tmp_path, monkeypatch, method):
assert output["atoms"].get_volume() == pytest.approx(atoms.get_volume())


@pytest.mark.xfail(strict=False)
def test_relax_job_dispersion(tmp_path, monkeypatch):
monkeypatch.chdir(tmp_path)

Expand All @@ -105,7 +102,6 @@ def test_relax_job_dispersion(tmp_path, monkeypatch):
assert output["atoms"].get_volume() == pytest.approx(atoms.get_volume())


@pytest.mark.xfail(strict=False)
@pytest.mark.parametrize("method", methods)
def test_relax_cell_job(tmp_path, monkeypatch, method):
monkeypatch.chdir(tmp_path)
Expand Down
4 changes: 0 additions & 4 deletions tests/core/recipes/mlp_recipes/test_phonon_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,16 @@ def _set_dtype(size, type_="float"):
torch.set_default_dtype(getattr(torch, f"float{size}"))


@pytest.mark.xfail(strict=False)
def test_phonon_flow(tmp_path, monkeypatch):
monkeypatch.chdir(tmp_path)
_set_dtype(64)
atoms = bulk("Cu")
output = phonon_flow(atoms, method="m3gnet", min_lengths=5.0)
assert output["results"]["force_constants"].shape == (8, 8, 3, 3)
assert len(output["results"]["thermal_properties"]["temperatures"]) == 101


@pytest.mark.xfail(strict=False)
def test_phonon_flow_dispersion(tmp_path, monkeypatch):
monkeypatch.chdir(tmp_path)
_set_dtype(64)
atoms = bulk("Cu")
output = phonon_flow(
atoms,
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements-mlp.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
chgnet==0.3.5
matgl==1.1.1
matgl @ git+https://github.com/materialsvirtuallab/matgl.git
mace-torch==0.3.4
torch-dftd==0.4.0
Loading