From c3fd98ce97354eb843c24eb205ca24a8a6540e83 Mon Sep 17 00:00:00 2001 From: ruoxi Date: Mon, 27 Feb 2023 16:19:38 -0800 Subject: [PATCH 1/3] fix reduced formula Fixed the handling of O-H containing compositions, where the string 'HO' was replaced by 'OH' directly in the formula. This will cause some materials, e.g. HSbO2, to have the wrong reduced formula of SbOH2. --- pymatgen/core/ion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymatgen/core/ion.py b/pymatgen/core/ion.py index 3d5408af759..b1d4f85283d 100644 --- a/pymatgen/core/ion.py +++ b/pymatgen/core/ion.py @@ -147,7 +147,7 @@ def get_reduced_formula_and_factor(self, iupac_ordering: bool = False, hydrates: d = {k: int(round(v)) for k, v in comp.get_el_amt_dict().items()} (formula, factor) = reduce_formula(d, iupac_ordering=iupac_ordering) - if "HO" in formula: + if "HO" in formula and self.composition['H'] == self.composition['O']: formula = formula.replace("HO", "OH") if nH2O > 0: From 1da9dda299ae110d0c9f39c7553ad9d46d06f1c1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 28 Feb 2023 00:23:52 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pymatgen/core/ion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymatgen/core/ion.py b/pymatgen/core/ion.py index b1d4f85283d..0ddc9b9d8ab 100644 --- a/pymatgen/core/ion.py +++ b/pymatgen/core/ion.py @@ -147,7 +147,7 @@ def get_reduced_formula_and_factor(self, iupac_ordering: bool = False, hydrates: d = {k: int(round(v)) for k, v in comp.get_el_amt_dict().items()} (formula, factor) = reduce_formula(d, iupac_ordering=iupac_ordering) - if "HO" in formula and self.composition['H'] == self.composition['O']: + if "HO" in formula and self.composition["H"] == self.composition["O"]: formula = formula.replace("HO", "OH") if nH2O > 0: From af6f727f077b0f0204130600e93b1178eeecc2f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 10:02:41 +0000 Subject: [PATCH 3/3] Bump pandas from 1.4.4 to 2.0.1 Bumps [pandas](https://github.com/pandas-dev/pandas) from 1.4.4 to 2.0.1. - [Release notes](https://github.com/pandas-dev/pandas/releases) - [Commits](https://github.com/pandas-dev/pandas/compare/v1.4.4...v2.0.1) --- updated-dependencies: - dependency-name: pandas dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index bdf17d40bb8..8e6f477d82e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ tabulate==0.8.10 matplotlib==3.5.2 palettable==3.3.0 spglib==2.0.1 -pandas==1.4.4 +pandas==2.0.1 networkx==2.8.8 plotly==5.11.0 beautifulsoup4==4.11.1