Skip to content

Commit caddde5

Browse files
committed
pin matplotlib<3.9.1 as temp fix for windows CI
see matplotlib/matplotlib#28551
1 parent 0f8b8fd commit caddde5

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ optional = [
106106
"h5py>=3.11.0",
107107
"jarvis-tools>=2020.7.14",
108108
"matgl>=1.1.1",
109+
# TODO: track https://github.com/matplotlib/matplotlib/issues/28551
110+
"matplotlib>=3.8,<3.9.1",
109111
"netCDF4>=1.6.5",
110112
"phonopy>=2.23",
111113
"seekpath>=2.0.1",

src/pymatgen/io/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ def __setitem__(self, key: PathLike, value: str | InputFile) -> None:
177177
def __delitem__(self, key: PathLike) -> None:
178178
del self.inputs[key]
179179

180-
# enable dict merge
181180
def __or__(self, other: dict | Self) -> Self:
181+
# enable dict merge operator | for InputSet
182182
if isinstance(other, dict):
183183
other = type(self)(other)
184184
if not isinstance(other, type(self)):

src/pymatgen/util/provenance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def __init__(
256256
if not all(sys.getsizeof(h) < MAX_HNODE_SIZE for h in history):
257257
raise ValueError(f"One or more history nodes exceeds the maximum size limit of {MAX_HNODE_SIZE} bytes")
258258

259-
self.created_at = created_at or datetime.now(tz=timezone.utc)
259+
self.created_at = created_at or f"{datetime.now(tz=timezone.utc):%Y-%m-%d %H:%M:%S.%f%z}"
260260

261261
def as_dict(self):
262262
"""Get MSONable dict."""

tests/util/test_provenance.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
__date__ = "2/14/13"
2121

2222

23-
class StructureNLCase(TestCase):
23+
class TestStructureNL(TestCase):
2424
def setUp(self):
2525
# set up a Structure
2626
self.struct = Structure(np.eye(3, 3) * 3, ["Fe"], [[0, 0, 0]])
@@ -214,8 +214,14 @@ def test_as_from_dict(self):
214214
{"_my_data": "string"},
215215
[self.valid_node, self.valid_node2],
216216
)
217-
b = StructureNL.from_dict(struct_nl.as_dict())
218-
assert struct_nl == b
217+
round_trip_from_dict = StructureNL.from_dict(struct_nl.as_dict())
218+
needed_attrs = ("structure", "authors", "projects", "references", "remarks", "data", "history", "created_at")
219+
for attr in needed_attrs:
220+
print(f"{attr}={getattr(struct_nl, attr)}")
221+
print(f"{getattr(round_trip_from_dict, attr)=}")
222+
print(f"{round_trip_from_dict=}")
223+
print(f"{struct_nl=}")
224+
assert struct_nl == round_trip_from_dict
219225
# complicated objects in the 'data' and 'nodes' field
220226
complicated_node = {
221227
"name": "complicated node",
@@ -231,15 +237,15 @@ def test_as_from_dict(self):
231237
{"_my_data": {"structure": self.s2}},
232238
[complicated_node, self.valid_node],
233239
)
234-
b = StructureNL.from_dict(struct_nl.as_dict())
240+
round_trip_from_dict = StructureNL.from_dict(struct_nl.as_dict())
235241
assert (
236-
struct_nl == b
242+
struct_nl == round_trip_from_dict
237243
), "to/from dict is broken when object embedding is used! Apparently MontyEncoding is broken..."
238244

239245
# Test molecule
240246
mol_nl = StructureNL(self.mol, self.hulk, references=self.pmg)
241-
b = StructureNL.from_dict(mol_nl.as_dict())
242-
assert mol_nl == b
247+
round_trip_from_dict = StructureNL.from_dict(mol_nl.as_dict())
248+
assert mol_nl == round_trip_from_dict
243249

244250
def test_from_structures(self):
245251
s1 = Structure(np.eye(3) * 5, ["Fe"], [[0, 0, 0]])

0 commit comments

Comments
 (0)