diff --git a/CHANGES.md b/CHANGES.md index bb9ab0b5860..7a703e7c88b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,12 @@ nav_order: 4 ## v2023.10.4 -- Bug fixes for MPRester and packaged data. +### 🐛 Bug Fixes + +- Fix missing `potcar_summary_stats.json.gz` in `setup.package_data` by @janosh in +- Bug fixes for MPRester and packaged data by @shyuep + +**Full Changelog**: ## v2023.10.3 @@ -67,12 +72,66 @@ nav_order: 4 **Full Changelog**: +### 🛠 Enhancements + +- Add an input arg check for `Kpoints.automatic_density_by_lengths` by @Andrew-S-Rosen in + +### 🏥 Package Health + +- Remove pydantic < 2 from `setup.py` and bump monty in `requirements.txt` by @Andrew-S-Rosen in +- Move `py.typed` to package root by @Andrew-S-Rosen in +- Consistent casing `setup->setUp` across test classes by @janosh in + +**Full Changelog**: + ## v2023.9.2 -- VaspInputSets now allow structure to be None for stateless initialization. -- MatPESStaticSet designed for generating PES data. (@SophiaRuan, @JiQi535) -- Breaking: Bump minimum Python version to 3.9, in line with numpy. -- Add `properties` to Structure and Molecule, with ASE adaptor support (@gpetretto, @Andrew-S-Rosen) +- Add `Lattice` property `params_dict` by @janosh in +- Generate SupercellTransformation from minimum boundary distance by @JiQi535 in +- More concise `test_from_boundary_distance` by @janosh in +- Breaking: remove deprecated keyword `properties` from `Species` by @janosh in +- Typo in Docs for PeriodicsSite by @jmmshn in +- Fix `Vasprun.converged_electronic` check if `ALGO=CHI` in `INCAR` by @janosh in +- Breaking: Have plot methods return `plt.Axes` object, not `matplotlib` module by @janosh in +- Fix `ruff` D212 by @janosh in +- Fix some Kpoints generated using wrong mesh types by @matthewkuner in +- read `mag` from OSZICAR by @chiang-yuan in +- Use `numpy.testing.assert_allclose` over `assert np.allclose` by @janosh in +- Don't let tests pollute the `pymatgen` repo by @janosh in +- Update `compatibility.md` by @mbercx in +- Google-style doc string return types by @janosh in +- Quasi-RRHO Thermochemistry Analysis Module by @arepstein in +- Add keyword `check_occu: bool = True` to `CifParser.get_structures()` by @jonathanjdenney in +- Fix bug in feff inputs.py by @kaifengZheng in +- Cancel concurrent CI runs to save budget by @janosh in +- Fix `Procar.get_projection_on_elements` for structures with multiple same-element ionic sites by @Na-Kawa in +- Fix `TestMPScanStaticSet.test_as_from_dict()` by @janosh in +- Bump activesupport from 7.0.6 to 7.0.7.2 in /docs by @dependabot in +- Fix `TestMPStaticSet` using `MPRelaxSet` in `test_user_incar_kspacing` and `test_kspacing_override` by @janosh in +- Fix `nelectrons` not updating when replacing species in `Molecule` by @janosh in +- Add `properties` to Structure and Molecule by @gpetretto in +- Fix `CifParser.get_structures(check_occu=False)` by @janosh in +- Add `PotcarSingle.__repr__` by @janosh in +- `__str__` to `__repr__` by @janosh in +- Ion: handle dissolved gas formulas by @rkingsbury in +- Add VASP input set `MatPESStaticSet` by @SophiaRuan in +- Fix `test_valid_magmom_struct()` error message regex by @janosh in +- fix tests of MatPESStaticSet by @SophiaRuan in +- Breaking: bump minimum Python version to 3.9 by @janosh in +- Breaking: Update `AseAtomsAdaptor` to handle `Structure.properties`/`Molecule.properties` by @Andrew-S-Rosen in +- Slightly relax the constraint satisfy condition of get_primitive_structure() by @fyalcin in +- [WIP] add custodian modified incar settings to incar and modify tests by @SophiaRuan in +- Add keyword `bandgap_tol: float = 1e-4` to `MPScanRelaxSet` by @janosh in +- `np.(arange->linspace)` in `io/vasp/optics.py` `get_delta`, `get_setp` and `epsilon_imag` by @LucasGVerga in +- MatPESStaticSet restore GGA tag removal if xc_functional.upper() == "R2SCAN" by @janosh in +- Bump pypa/cibuildwheel from 2.14.1 to 2.15.0 by @dependabot in +- Bump cython from 3.0.0 to 3.0.2 by @dependabot in +- Bump scipy from 1.11.1 to 1.11.2 by @dependabot in +- Bump plotly from 5.11.0 to 5.16.1 by @dependabot in +- Bump joblib from 1.3.1 to 1.3.2 by @dependabot in +- Bump mp-api from 0.33.3 to 0.35.1 by @dependabot in +- xyz.**iter**() -> iter(xyz) by @janosh in +- Deprecate overlooked `from/as_..._string` methods by @janosh in ## v2023.8.10 diff --git a/docs/CHANGES.md b/docs/CHANGES.md index bb9ab0b5860..6efd1d591b8 100644 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -8,7 +8,12 @@ nav_order: 4 ## v2023.10.4 -- Bug fixes for MPRester and packaged data. +### 🐛 Bug Fixes + +- Fix missing `potcar_summary_stats.json.gz` in `setup.package_data` by @janosh in +- Bug fixes for MPRester and packaged data by @shyuep + +**Full Changelog**: ## v2023.10.3 @@ -67,12 +72,77 @@ nav_order: 4 **Full Changelog**: +### 🛠 Enhancements + +- Add an input arg check for `Kpoints.automatic_density_by_lengths` by @Andrew-S-Rosen in + +### 🏥 Package Health + +- Remove pydantic < 2 from `setup.py` and bump monty in `requirements.txt` by @Andrew-S-Rosen in +- Move `py.typed` to package root by @Andrew-S-Rosen in +- Consistent casing `setup->setUp` across test classes by @janosh in + +**Full Changelog**: + ## v2023.9.2 -- VaspInputSets now allow structure to be None for stateless initialization. -- MatPESStaticSet designed for generating PES data. (@SophiaRuan, @JiQi535) -- Breaking: Bump minimum Python version to 3.9, in line with numpy. -- Add `properties` to Structure and Molecule, with ASE adaptor support (@gpetretto, @Andrew-S-Rosen) +- Add `Lattice` property `params_dict` by @janosh in +- Generate SupercellTransformation from minimum boundary distance by @JiQi535 in +- More concise `test_from_boundary_distance` by @janosh in +- Breaking: remove deprecated keyword `properties` from `Species` by @janosh in +- Typo in Docs for PeriodicsSite by @jmmshn in +- Fix `Vasprun.converged_electronic` check if `ALGO=CHI` in `INCAR` by @janosh in +- Breaking: Have plot methods return `plt.Axes` object, not `matplotlib` module by @janosh in +- Fix `ruff` D212 by @janosh in +- Fix some Kpoints generated using wrong mesh types by @matthewkuner in +- read `mag` from OSZICAR by @chiang-yuan in +- Use `numpy.testing.assert_allclose` over `assert np.allclose` by @janosh in +- Don't let tests pollute the `pymatgen` repo by @janosh in +- Update `compatibility.md` by @mbercx in +- Google-style doc string return types by @janosh in +- Quasi-RRHO Thermochemistry Analysis Module by @arepstein in +- Add keyword `check_occu: bool = True` to `CifParser.get_structures()` by @jonathanjdenney in +- Fix bug in feff inputs.py by @kaifengZheng in +- Cancel concurrent CI runs to save budget by @janosh in +- Fix `Procar.get_projection_on_elements` for structures with multiple same-element ionic sites by @Na-Kawa in +- Fix `TestMPScanStaticSet.test_as_from_dict()` by @janosh in +- Bump activesupport from 7.0.6 to 7.0.7.2 in /docs by @dependabot in +- Fix `TestMPStaticSet` using `MPRelaxSet` in `test_user_incar_kspacing` and `test_kspacing_override` by @janosh in +- Fix `nelectrons` not updating when replacing species in `Molecule` by @janosh in +- Add `properties` to Structure and Molecule by @gpetretto in +- Fix `CifParser.get_structures(check_occu=False)` by @janosh in +- Add `PotcarSingle.__repr__` by @janosh in +- `__str__` to `__repr__` by @janosh in +- Ion: handle dissolved gas formulas by @rkingsbury in +- Add VASP input set `MatPESStaticSet` by @SophiaRuan in +- Fix `test_valid_magmom_struct()` error message regex by @janosh in +- fix tests of MatPESStaticSet by @SophiaRuan in +- Breaking: bump minimum Python version to 3.9 by @janosh in +- Breaking: Update `AseAtomsAdaptor` to handle `Structure.properties`/`Molecule.properties` by @Andrew-S-Rosen in +- Slightly relax the constraint satisfy condition of get_primitive_structure() by @fyalcin in +- [WIP] add custodian modified incar settings to incar and modify tests by @SophiaRuan in +- Add keyword `bandgap_tol: float = 1e-4` to `MPScanRelaxSet` by @janosh in +- `np.(arange->linspace)` in `io/vasp/optics.py` `get_delta`, `get_setp` and `epsilon_imag` by @LucasGVerga in +- MatPESStaticSet restore GGA tag removal if xc_functional.upper() == "R2SCAN" by @janosh in +- Bump pypa/cibuildwheel from 2.14.1 to 2.15.0 by @dependabot in +- Bump cython from 3.0.0 to 3.0.2 by @dependabot in +- Bump scipy from 1.11.1 to 1.11.2 by @dependabot in +- Bump plotly from 5.11.0 to 5.16.1 by @dependabot in +- Bump joblib from 1.3.1 to 1.3.2 by @dependabot in +- Bump mp-api from 0.33.3 to 0.35.1 by @dependabot in +- xyz.**iter**() -> iter(xyz) by @janosh in +- Deprecate overlooked `from/as_..._string` methods by @janosh in + +## New Contributors + +- @mbercx made their first contribution in +- @jonathanjdenney made their first contribution in +- @kaifengZheng made their first contribution in +- @Na-Kawa made their first contribution in +- @SophiaRuan made their first contribution in +- @LucasGVerga made their first contribution in + +**Full Changelog**: ## v2023.8.10 diff --git a/pymatgen/analysis/chemenv/coordination_environments/strategy_files/ImprovedConfidenceCutoffDefaultParameters.json b/pymatgen/analysis/chemenv/coordination_environments/strategy_files/ImprovedConfidenceCutoffDefaultParameters.json deleted file mode 100644 index d48f0002bc4..00000000000 --- a/pymatgen/analysis/chemenv/coordination_environments/strategy_files/ImprovedConfidenceCutoffDefaultParameters.json +++ /dev/null @@ -1 +0,0 @@ -{"voronoi_parameters_fractions": 0.5, "csm_cutoffs": {"I:12": 2.0, "SBT:8": 2.0, "BO_3:8": 2.0, "MI:10": 2.0, "BS_2:10": 2.0, "BS_1:10": 2.0, "C:12": 2.0, "SC:12": 2.0, "HA:12": 2.0, "TS:3": 2.0, "PP:10": 2.0, "BO_1:8": 2.0, "DD:8": 2.0, "H:11": 2.0, "DI:11": 2.0, "TT:12": 2.0, "TO_2:9": 2.0, "TC:9": 2.0, "L:2": 2.0, "TT_2:9": 2.0, "TT_1:9": 2.0, "O:6": 2.0, "SS:9": 2.0, "ET:7": 2.0, "TO_3:9": 2.0, "PB:7": 2.0, "PP:6": 2.0, "BO_2:8": 2.0, "PP:5": 2.0, "ST:7": 2.0, "TO_1:9": 2.0, "TT_3:9": 2.0, "TY:3": 2.0, "TL:3": 2.0, "SA:8": 2.0, "TI:9": 2.0, "SBSA:10": 2.0, "DDPN:8": 2.0, "A:2": 2.0, "HB:8": 2.0, "PCPA:11": 2.0, "C:8": 2.0, "SMA:9": 2.0, "T:5": 2.0, "T:4": 2.0, "T:6": 2.0, "SS:4": 2.0, "AC:12": 2.0, "PA:10": 2.0, "TBT:8": 2.0, "PBP:12": 2.0, "HP:12": 2.0, "FO:7": 2.0, "S:4": 2.0, "HD:9": 2.0, "S:1": 2.0, "SY:4": 2.0, "S:5": 2.0}} diff --git a/setup.py b/setup.py index 0fad1c325d1..717d42d5e66 100644 --- a/setup.py +++ b/setup.py @@ -24,10 +24,7 @@ setup( name="pymatgen", - packages=find_namespace_packages( - include=["pymatgen.*", "pymatgen.analysis.*", "pymatgen.io.*", "pymatgen.ext.*", "cmd_line"], - exclude=["pymatgen.*.tests", "pymatgen.*.*.tests", "pymatgen.*.*.*.tests"], - ), + packages=find_namespace_packages(include=["pymatgen.*", "pymatgen.**.*", "cmd_line"]), version="2023.10.4", python_requires=">=3.9", install_requires=[ diff --git a/tasks.py b/tasks.py index 07e661d330d..63db3865901 100644 --- a/tasks.py +++ b/tasks.py @@ -228,7 +228,6 @@ def release(ctx, version=None, nodoc=False): ctx.run("rm -f dist/*.*", warn=True) ctx.run("python setup.py sdist bdist_wheel", warn=True) - check_egg_sources_txt_for_completeness() ctx.run("twine upload --skip-existing dist/*.whl", warn=True) ctx.run("twine upload --skip-existing dist/*.tar.gz", warn=True) # post_discourse(ctx, warn=True) @@ -249,24 +248,3 @@ def open_doc(ctx): def lint(ctx): for cmd in ["ruff", "mypy", "black", "pylint"]: ctx.run(f"{cmd} pymatgen") - - -def check_egg_sources_txt_for_completeness(): - """Check that all source and data files in pymatgen/ are listed in pymatgen.egg-info/SOURCES.txt.""" - src_txt = "pymatgen.egg-info/SOURCES.txt" - if not os.path.exists(src_txt): - raise FileNotFoundError(f"{src_txt} not found. Run `pip install .` to create") - - with open(src_txt) as file: - sources = file.read() - - for src_file in sources.splitlines(): - if not os.path.exists(src_file): - raise ValueError(f"{src_file} does not exist!") - - for ext in ("py", "json", "json.gz", "yaml", "csv"): - for filepath in glob(f"pymatgen/**/*.{ext}", recursive=True): - if "/tests/" in filepath or "dao" in filepath: - continue - if filepath not in sources: - raise ValueError(f"{filepath} not found in {src_txt}") diff --git a/tests/test_pkg.py b/tests/test_pkg.py new file mode 100644 index 00000000000..cc859741c92 --- /dev/null +++ b/tests/test_pkg.py @@ -0,0 +1,31 @@ +from __future__ import annotations + +import os +from glob import glob + +import pytest + +src_txt_path = "pymatgen.egg-info/SOURCES.txt" +src_txt_missing = not os.path.isfile(src_txt_path) + + +@pytest.mark.skipif(src_txt_missing, reason=f"{src_txt_path} not found. Run `pip install .` to create") +def test_egg_sources_txt_is_complete(): + """Check that all source and data files in pymatgen/ are listed in pymatgen.egg-info/SOURCES.txt.""" + + with open(src_txt_path) as file: + sources = file.read() + + # check that all files listed in SOURCES.txt exist + for src_file in sources.splitlines(): + assert os.path.exists(src_file), f"{src_file!r} does not exist!" + + # check that all files in pymatgen/ are listed in SOURCES.txt + for ext in ("py", "json", "json.gz", "yaml", "csv"): + for filepath in glob(f"pymatgen/**/*.{ext}", recursive=True): + if "/tests/" in filepath or filepath.endswith("dao.py"): + continue + if filepath not in sources: + raise ValueError( + f"{filepath} not found in {src_txt_path}. check setup.py package_data for outdated inclusion rules." + )