Skip to content

Commit

Permalink
skip several tests related to scipy, chgnet, and phonopy
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Aug 5, 2024
1 parent dc1d719 commit b272664
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/analysis/test_piezo_sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import pickle
import sys

import numpy as np
import pytest
Expand Down Expand Up @@ -257,6 +258,7 @@ def test_get_piezo(self):
piezo = get_piezo(self.BEC, self.IST, self.FCM)
assert_allclose(piezo, self.piezo, atol=1e-5)

@pytest.mark.skipif(sys.platform == "win32" and int(np.__version__[0]) >= 2, reason="See https://github.com/conda-forge/phonopy-feedstock/pull/158#issuecomment-2227506701")
def test_rand_piezo(self):
pytest.importorskip("phonopy")
rand_BEC, rand_IST, rand_FCM, _piezo = rand_piezo(
Expand Down
2 changes: 2 additions & 0 deletions tests/core/test_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,7 @@ def test_calculate_ase(self):
assert not hasattr(calculator, "dynamics")
assert self.cu_structure == struct_copy, "original structure was modified"

@pytest.mark.skipif(int(np.__version__[0]) >= 2, reason="chgnet is not built against NumPy 2.0")
def test_relax_chgnet(self):
pytest.importorskip("chgnet")
struct_copy = self.cu_structure.copy()
Expand All @@ -1703,6 +1704,7 @@ def test_relax_chgnet(self):
assert custom_relaxed.calc.results.get("energy") == approx(-6.0151076, abs=1e-4)
assert custom_relaxed.volume == approx(40.044794644, abs=1e-4)

@pytest.mark.skipif(int(np.__version__[0]) >= 2, reason="chgnet is not built against NumPy 2.0")
def test_calculate_chgnet(self):
pytest.importorskip("chgnet")
struct = self.get_structure("Si")
Expand Down
2 changes: 2 additions & 0 deletions tests/io/test_phonopy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import os
import sys
from pathlib import Path
from unittest import TestCase

Expand Down Expand Up @@ -167,6 +168,7 @@ def setUp(self) -> None:
self.supercell_matrix = np.eye(3) * 2
self.force_constants = parse_FORCE_CONSTANTS(fc_file)

@pytest.mark.skipif(sys.platform == "win32" and int(np.__version__[0]) >= 2, reason="See https://github.com/conda-forge/phonopy-feedstock/pull/158#issuecomment-2227506701")
def test_get_phonon_dos_from_fc(self):
dos = get_phonon_dos_from_fc(
self.structure,
Expand Down
3 changes: 3 additions & 0 deletions tests/io/vasp/test_optics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

import sys

import numpy as np
import pytest
import scipy.special
Expand Down Expand Up @@ -51,6 +53,7 @@ def test_optics(self):
assert len(x_val) == len(y_val) == len(text)


@pytest.mark.skipif(sys.platform == "win32" and int(np.__version__[0]) >= 2, reason="Fails on Windows with numpy > 2.0.0, awaiting https://github.com/scipy/scipy/issues/21052 resolution")
def test_delta_func():
x = np.array([0, 1, 2, 3, 4, 5])

Expand Down

0 comments on commit b272664

Please sign in to comment.