From ebfc7a0a87d1d50d36e4b0564261392a17cbbe83 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Sun, 15 Sep 2024 19:48:47 -0400 Subject: [PATCH 1/8] improve and test PmgVaspPspDirError msg in PotcarSingle.from_symbol_and_functional --- src/pymatgen/io/vasp/inputs.py | 4 +--- tests/io/vasp/test_inputs.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/pymatgen/io/vasp/inputs.py b/src/pymatgen/io/vasp/inputs.py index d8deb7da7e7..e153cd0b1a2 100644 --- a/src/pymatgen/io/vasp/inputs.py +++ b/src/pymatgen/io/vasp/inputs.py @@ -2277,9 +2277,7 @@ def from_symbol_and_functional( functional_subdir = SETTINGS.get("PMG_VASP_PSP_SUB_DIRS", {}).get(functional, cls.functional_dir[functional]) PMG_VASP_PSP_DIR = SETTINGS.get("PMG_VASP_PSP_DIR") if PMG_VASP_PSP_DIR is None: - raise PmgVaspPspDirError( - f"No POTCAR for {symbol} with {functional=} found. Please set the PMG_VASP_PSP_DIR in .pmgrc.yaml." - ) + raise PmgVaspPspDirError("Set PMG_VASP_PSP_DIR= in .pmgrc.yaml (needed to find POTCARs)") if not os.path.isdir(PMG_VASP_PSP_DIR): raise FileNotFoundError(f"{PMG_VASP_PSP_DIR=} does not exist.") diff --git a/tests/io/vasp/test_inputs.py b/tests/io/vasp/test_inputs.py index b56cab1d3e6..cf4f6ea7940 100644 --- a/tests/io/vasp/test_inputs.py +++ b/tests/io/vasp/test_inputs.py @@ -28,6 +28,7 @@ Incar, Kpoints, KpointsSupportedModes, + PmgVaspPspDirError, Poscar, Potcar, PotcarSingle, @@ -1211,7 +1212,16 @@ def test_from_symbol_and_functional_raises(self): # test FileNotFoundError on non-existent PMG_VASP_PSP_DIR in SETTINGS PMG_VASP_PSP_DIR = "missing-dir" symbol, functional = "Fe", "PBE_64" - with ( + with ( # test PMG_VASP_PSP_DIR not set in SETTINGS + patch.dict(SETTINGS, PMG_VASP_PSP_DIR=None), + pytest.raises( + PmgVaspPspDirError, + match=re.escape("Set PMG_VASP_PSP_DIR= in .pmgrc.yaml (needed to find POTCARs)"), + ), + ): + PotcarSingle.from_symbol_and_functional(symbol, functional) + + with ( # test FileNotFoundError on non-existent PMG_VASP_PSP_DIR in SETTINGS patch.dict(SETTINGS, PMG_VASP_PSP_DIR=PMG_VASP_PSP_DIR), pytest.raises(FileNotFoundError, match=f"{PMG_VASP_PSP_DIR=} does not exist."), ): From 96b3284d45301d6484896fae744e4ad20bac166c Mon Sep 17 00:00:00 2001 From: ruoxi yang Date: Mon, 16 Sep 2024 20:09:12 -0700 Subject: [PATCH 2/8] fix phase diagram break from 41e6d99 (#4070) --- src/pymatgen/analysis/phase_diagram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pymatgen/analysis/phase_diagram.py b/src/pymatgen/analysis/phase_diagram.py index 3c96cb2c572..d3edca38b28 100644 --- a/src/pymatgen/analysis/phase_diagram.py +++ b/src/pymatgen/analysis/phase_diagram.py @@ -2972,7 +2972,7 @@ def _create_plotly_element_annotations(self): for d in ["xref", "yref"]: annotation.pop(d) # Scatter3d cannot contain xref, yref if self._dim == 3: - annotation.update(x=x, y=y) + annotation.update(x=y, y=x) if entry.composition.is_element: z = 0.9 * self._min_energy # place label 10% above base From b373410ed1f18fca6c229f684917dbec3ea991dd Mon Sep 17 00:00:00 2001 From: Shyue Ping Ong Date: Mon, 16 Sep 2024 20:15:54 -0700 Subject: [PATCH 3/8] Updated changelog. --- docs/CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/CHANGES.md b/docs/CHANGES.md index 041c6fc3b4b..d4313f4c186 100644 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -6,6 +6,10 @@ nav_order: 4 # Changelog +## v2024.9.17 + +- Emergency release to fix broken phase diagram plotting due to completely unnecessary refactoring. (Thanks @yang-ruoxi for fixing.) + ## v2024.9.10 💥 **Breaking**: NumPy/Cython integer type changed from `np.long`/`np.int_` to int64 on Windows to align with NumPy 2.x, [changing the default integer type to int64 on Windows 64-bit systems](https://numpy.org/doc/stable/release/2.0.0-notes.html) in favor of the platform-dependent `np.int_` type. From 150f816c55be80dd146cb20ebbf5f930633c8aeb Mon Sep 17 00:00:00 2001 From: Shyue Ping Ong Date: Mon, 16 Sep 2024 20:19:30 -0700 Subject: [PATCH 4/8] Update docs --- docs/modules.html | 64 +- docs/pymatgen.alchemy.html | 142 +- ...ymatgen.analysis.chemenv.connectivity.html | 148 +- ...onments.coordination_geometries_files.html | 16 +- ...sis.chemenv.coordination_environments.html | 752 +++-- docs/pymatgen.analysis.chemenv.html | 16 +- docs/pymatgen.analysis.chemenv.utils.html | 304 +- docs/pymatgen.analysis.diffraction.html | 90 +- docs/pymatgen.analysis.elasticity.html | 184 +- docs/pymatgen.analysis.ferroelectricity.html | 58 +- docs/pymatgen.analysis.gb.html | 16 +- docs/pymatgen.analysis.html | 1686 +++++------ docs/pymatgen.analysis.interfaces.html | 118 +- docs/pymatgen.analysis.magnetism.html | 142 +- docs/pymatgen.analysis.solar.html | 34 +- ...ymatgen.analysis.structure_prediction.html | 72 +- docs/pymatgen.analysis.topological.html | 24 +- docs/pymatgen.analysis.xas.html | 38 +- docs/pymatgen.apps.battery.html | 238 +- docs/pymatgen.apps.borg.html | 64 +- docs/pymatgen.apps.html | 16 +- docs/pymatgen.cli.html | 72 +- docs/pymatgen.command_line.html | 180 +- docs/pymatgen.core.html | 2508 +++++++++-------- docs/pymatgen.electronic_structure.html | 1100 +++----- docs/pymatgen.entries.html | 260 +- docs/pymatgen.ext.html | 96 +- docs/pymatgen.html | 64 +- docs/pymatgen.io.abinit.html | 727 +++-- docs/pymatgen.io.aims.html | 342 ++- docs/pymatgen.io.aims.sets.html | 162 +- docs/pymatgen.io.cp2k.html | 604 ++-- docs/pymatgen.io.exciting.html | 38 +- docs/pymatgen.io.feff.html | 172 +- docs/pymatgen.io.html | 895 +++--- docs/pymatgen.io.lammps.html | 206 +- docs/pymatgen.io.lobster.html | 342 ++- docs/pymatgen.io.pwmat.html | 138 +- docs/pymatgen.io.qchem.html | 152 +- docs/pymatgen.io.vasp.html | 1268 +++++---- docs/pymatgen.io.xtb.html | 24 +- docs/pymatgen.optimization.html | 24 +- docs/pymatgen.phonon.html | 276 +- docs/pymatgen.symmetry.html | 313 +- docs/pymatgen.transformations.html | 267 +- docs/pymatgen.util.html | 216 +- docs/pymatgen.util.testing.html | 28 +- docs/pymatgen.vis.html | 110 +- pyproject.toml | 2 +- 49 files changed, 7075 insertions(+), 7733 deletions(-) diff --git a/docs/modules.html b/docs/modules.html index c3d429ad453..6446d709e47 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,15 +1,13 @@ - + - pymatgen — pymatgen 2024.8.9 documentation - - - - - + pymatgen — pymatgen 2024.9.17 documentation + + +