Skip to content

Commit 1abc459

Browse files
authored
Bump phonopy to apply fix for NumPy 2 in Windows (#4227)
* install phonopy from git repo dev branch * unskip failing tests * remove python < 3.10 check * bump phonopy to test windows np2 fix
1 parent 3be22d0 commit 1abc459

File tree

3 files changed

+1
-18
lines changed

3 files changed

+1
-18
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ optional = [
107107
"hiphive>=1.3.1",
108108
"jarvis-tools>=2020.7.14",
109109
"matplotlib>=3.8",
110-
"phonopy>=2.23",
110+
"phonopy>=2.33.3",
111111
"seekpath>=2.0.1",
112112
]
113113
# tblite only support Python 3.12+ through conda-forge

tests/io/test_phonopy.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import os
4-
import platform
54
from pathlib import Path
65
from unittest import TestCase
76

@@ -124,10 +123,6 @@ def test_structure_conversion(self):
124123
assert struct_pmg_round_trip.site_properties["magmom"] == struct_pmg.site_properties["magmom"]
125124

126125

127-
@pytest.mark.skipif(
128-
platform.system() == "Windows" and int(np.__version__[0]) >= 2,
129-
reason="cannot run NP2 on windows, see PR 4224",
130-
)
131126
@pytest.mark.skipif(Phonopy is None, reason="Phonopy not present")
132127
class TestGetDisplacedStructures(PymatgenTest):
133128
def test_get_displaced_structures(self):
@@ -160,10 +155,6 @@ def test_get_displaced_structures(self):
160155
assert os.path.isfile("test.yaml")
161156

162157

163-
@pytest.mark.skipif(
164-
platform.system() == "Windows" and int(np.__version__[0]) >= 2,
165-
reason="cannot run NP2 on windows, see PR 4224",
166-
)
167158
@pytest.mark.skipif(Phonopy is None, reason="Phonopy not present")
168159
class TestPhonopyFromForceConstants(TestCase):
169160
def setUp(self) -> None:

tests/util/test_typing.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
from __future__ import annotations
44

5-
import sys
65
from pathlib import Path
76
from types import GenericAlias
87
from typing import TYPE_CHECKING, get_args
98

10-
import pytest
11-
129
from pymatgen.core import Composition, DummySpecies, Element, Species
1310
from pymatgen.entries import Entry
1411
from pymatgen.util.typing import CompositionLike, EntryLike, PathLike, PbcLike, SpeciesLike
@@ -20,8 +17,6 @@
2017
__date__ = "2022-10-20"
2118
__email__ = "[email protected]"
2219

23-
skip_below_py310 = pytest.mark.skipif(sys.version_info < (3, 10), reason="requires python 3.10 or higher")
24-
2520

2621
def _type_str(some_type: Any) -> str:
2722
return str(some_type).replace("typing.", "").replace("pymatgen.core.periodic_table.", "")
@@ -48,15 +43,13 @@ def test_entry_like():
4843
assert Entry.__name__ in str(EntryLike)
4944

5045

51-
@skip_below_py310
5246
def test_species_like():
5347
assert isinstance("H", SpeciesLike)
5448
assert isinstance(Element("H"), SpeciesLike)
5549
assert isinstance(Species("H+"), SpeciesLike)
5650
assert isinstance(DummySpecies("X"), SpeciesLike)
5751

5852

59-
@skip_below_py310
6053
def test_composition_like():
6154
assert isinstance("H", CompositionLike)
6255
assert isinstance(Element("H"), CompositionLike)
@@ -71,7 +64,6 @@ def test_pbc_like():
7164
assert get_args(PbcLike) == (bool, bool, bool)
7265

7366

74-
@skip_below_py310
7567
def test_pathlike():
7668
assert isinstance("path/to/file", PathLike)
7769
assert isinstance(Path("path/to/file"), PathLike)

0 commit comments

Comments
 (0)