From 362bf543541a30468d51946508f33c553ce15147 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel) YANG" Date: Wed, 11 Dec 2024 22:03:55 +0800 Subject: [PATCH] Fix CI failure: bump `netcdf4`, replace `Namespace` with standard `dict` for `io.abinit.pseudos` (#4223) --- pyproject.toml | 3 +-- src/pymatgen/io/abinit/pseudos.py | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7fba2e4c661..db6f4b52ee6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,8 +87,7 @@ Issues = "https://github.com/materialsproject/pymatgen/issues" Pypi = "https://pypi.org/project/pymatgen" [project.optional-dependencies] -# PR4128: netcdf4 1.7.[0/1] yanked, 1.7.1.post[1/2]/1.7.2 cause CI error -abinit = ["netcdf4>=1.6.5,!=1.7.1.post1,!=1.7.1.post2,!=1.7.2"] +abinit = ["netcdf4>=1.7.2"] ase = ["ase>=3.23.0"] ci = ["pytest-cov>=4", "pytest-split>=0.8", "pytest>=8"] docs = ["invoke", "sphinx", "sphinx_markdown_builder", "sphinx_rtd_theme"] diff --git a/src/pymatgen/io/abinit/pseudos.py b/src/pymatgen/io/abinit/pseudos.py index db9a6d2bb08..3c08a28ded6 100644 --- a/src/pymatgen/io/abinit/pseudos.py +++ b/src/pymatgen/io/abinit/pseudos.py @@ -19,7 +19,7 @@ from xml.etree import ElementTree as ET import numpy as np -from monty.collections import AttrDict, Namespace +from monty.collections import AttrDict from monty.functools import lazy_property from monty.itertools import iterator_from_slice from monty.json import MontyDecoder, MSONable @@ -601,7 +601,9 @@ def _dict_from_lines(lines, key_nums, sep=None) -> dict: if len(lines) != len(key_nums): raise ValueError(f"{lines = }\n{key_nums = }") - kwargs = Namespace() + # TODO: PR 4223: kwargs was using `monty.collections.Namespace`, + # revert to original implementation if needed + kwargs: dict = {} for idx, nk in enumerate(key_nums): if nk == 0: