From 2ca9d02a60e57c8149b70480eb6be5b90f45354b Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 12:37:34 +0800 Subject: [PATCH 01/26] explicitly test 3.13 in test workflow --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28a19a3cca7..02ff54fb187 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,11 +35,11 @@ jobs: resolution: highest extras: ci,optional - os: windows-latest - python: "3.10" + python: "3.12" resolution: highest extras: ci,optional,numpy-v1 # Test NP1 on Windows (quite buggy ATM) - os: ubuntu-latest - python: ">3.10" + python: "3.13" resolution: lowest-direct extras: ci,optional - os: macos-latest From 47b4cde2ba2338ea4c1e48112c105d1eb0c4c5c2 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 12:38:30 +0800 Subject: [PATCH 02/26] add 3.13 classifier --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e136b4b52e6..81677621571 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering :: Chemistry", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Physics", From bb4554d36eccc21fdc68f773b529ae06abe28217 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 12:39:51 +0800 Subject: [PATCH 03/26] drop install for openff-toolkit for now --- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 271d06eff91..539c5a11165 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/setup-python@v5 name: Install Python with: - python-version: "3.12" + python-version: "3.13" - name: Build sdist run: | @@ -72,7 +72,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Get build artifacts uses: actions/download-artifact@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 02ff54fb187..9ed06248f68 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: # Maximize CI coverage of different platforms and python versions while minimizing the # total number of jobs. We run all pytest splits with the oldest supported python # version (currently 3.10) on windows (seems most likely to surface errors) and with - # newest version (currently 3.12) on ubuntu (to get complete coverage on unix). + # newest version (currently 3.13) on ubuntu (to get complete coverage on unix). config: - os: windows-latest python: "3.10" @@ -71,7 +71,8 @@ jobs: - name: Install ubuntu-only conda dependencies if: matrix.config.os == 'ubuntu-latest' run: | - micromamba install -n pmg -c conda-forge bader enumlib openff-toolkit packmol pygraphviz tblite --yes + micromamba install -n pmg -c conda-forge bader enumlib packmol pygraphviz tblite --yes + # TODO: openff-toolkit doesn't support Python 3.13 yet - name: Install pymatgen and dependencies via uv run: | From 36613595c940f7b0a1d148c2c7be58bb95f290bc Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 12:49:03 +0800 Subject: [PATCH 04/26] bump chgnet to support numpy 2 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 81677621571..18023830daa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,7 @@ ase = ["ase>=3.23.0"] tblite = ["tblite[ase]>=0.3.0; python_version<'3.12'"] vis = ["vtk>=6.0.0"] abinit = ["netcdf4>=1.7.1"] -mlp = ["chgnet>=0.3.8", "matgl>=1.1.3"] +mlp = ["chgnet>=0.4.0", "matgl>=1.1.3"] electronic_structure = ["fdint>=2.0.2"] ci = ["pytest-cov>=4", "pytest-split>=0.8", "pytest>=8"] docs = ["invoke", "sphinx", "sphinx_markdown_builder", "sphinx_rtd_theme"] @@ -104,7 +104,7 @@ optional = [ # BoltzTraP2 build fails on Windows GitHub runners "BoltzTraP2>=24.9.4 ; platform_system != 'Windows'", "chemview>=0.6", - "chgnet>=0.3.8", + "chgnet>=0.4.0", "f90nml>=1.1.2", "galore>=0.6.1", "h5py>=3.11.0", From 7a8d6ffdea82f19335a98f8b9915f8b545cfbe9a Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 12:49:13 +0800 Subject: [PATCH 05/26] loose torch pin --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ed06248f68..97b9f387236 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,7 +83,7 @@ jobs: # TODO1 (use uv over pip) uv install torch is flaky, track #3826 # TODO2 (pin torch version): DGL library (matgl) doesn't support torch > 2.2.1, # see: https://discuss.dgl.ai/t/filenotfounderror-cannot-find-dgl-c-graphbolt-library/4302 - pip install torch==2.2.1 + pip install torch<=2.2.1 uv pip install --editable '.[${{ matrix.config.extras }}]' --resolution=${{ matrix.config.resolution }} From f3176b48cb687a0fa69006df3a96dd454bda3a8d Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 13:34:08 +0800 Subject: [PATCH 06/26] try to remove manual install of torch --- .github/workflows/test.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97b9f387236..505538d68e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -80,11 +80,6 @@ jobs: pip install uv - # TODO1 (use uv over pip) uv install torch is flaky, track #3826 - # TODO2 (pin torch version): DGL library (matgl) doesn't support torch > 2.2.1, - # see: https://discuss.dgl.ai/t/filenotfounderror-cannot-find-dgl-c-graphbolt-library/4302 - pip install torch<=2.2.1 - uv pip install --editable '.[${{ matrix.config.extras }}]' --resolution=${{ matrix.config.resolution }} - name: Install optional Ubuntu dependencies From 02fbe6aadf14f1da3e861f45483bfb92a7a3eb4e Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 13:36:47 +0800 Subject: [PATCH 07/26] bump github action version --- .github/workflows/jekyll-gh-pages.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index 91f17b3ea39..b21ea67fa6c 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Pages - uses: actions/configure-pages@v3 + uses: actions/configure-pages@v5 - name: Build with Jekyll uses: actions/jekyll-build-pages@v1 @@ -36,7 +36,7 @@ jobs: destination: ./_site - name: Upload artifact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 deploy: environment: @@ -47,4 +47,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v4 From 249821b1d8d6972b007e435131eba327543c5e1f Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 13:38:35 +0800 Subject: [PATCH 08/26] revert bump of chgnet version --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 18023830daa..81677621571 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,7 @@ ase = ["ase>=3.23.0"] tblite = ["tblite[ase]>=0.3.0; python_version<'3.12'"] vis = ["vtk>=6.0.0"] abinit = ["netcdf4>=1.7.1"] -mlp = ["chgnet>=0.4.0", "matgl>=1.1.3"] +mlp = ["chgnet>=0.3.8", "matgl>=1.1.3"] electronic_structure = ["fdint>=2.0.2"] ci = ["pytest-cov>=4", "pytest-split>=0.8", "pytest>=8"] docs = ["invoke", "sphinx", "sphinx_markdown_builder", "sphinx_rtd_theme"] @@ -104,7 +104,7 @@ optional = [ # BoltzTraP2 build fails on Windows GitHub runners "BoltzTraP2>=24.9.4 ; platform_system != 'Windows'", "chemview>=0.6", - "chgnet>=0.4.0", + "chgnet>=0.3.8", "f90nml>=1.1.2", "galore>=0.6.1", "h5py>=3.11.0", From 2673ce15a1d44fc7e802d432e0b610fe3e68cbb9 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 13:53:19 +0800 Subject: [PATCH 09/26] bump chgnet to 0.4.0 to support np2 --- pyproject.toml | 4 ++-- tests/core/test_structure.py | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 81677621571..18023830daa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,7 @@ ase = ["ase>=3.23.0"] tblite = ["tblite[ase]>=0.3.0; python_version<'3.12'"] vis = ["vtk>=6.0.0"] abinit = ["netcdf4>=1.7.1"] -mlp = ["chgnet>=0.3.8", "matgl>=1.1.3"] +mlp = ["chgnet>=0.4.0", "matgl>=1.1.3"] electronic_structure = ["fdint>=2.0.2"] ci = ["pytest-cov>=4", "pytest-split>=0.8", "pytest>=8"] docs = ["invoke", "sphinx", "sphinx_markdown_builder", "sphinx_rtd_theme"] @@ -104,7 +104,7 @@ optional = [ # BoltzTraP2 build fails on Windows GitHub runners "BoltzTraP2>=24.9.4 ; platform_system != 'Windows'", "chemview>=0.6", - "chgnet>=0.3.8", + "chgnet>=0.4.0", "f90nml>=1.1.2", "galore>=0.6.1", "h5py>=3.11.0", diff --git a/tests/core/test_structure.py b/tests/core/test_structure.py index 05ad8e9df50..cf1d7caadf8 100644 --- a/tests/core/test_structure.py +++ b/tests/core/test_structure.py @@ -1711,8 +1711,6 @@ def test_calculate_ase(self): assert not hasattr(calculator, "dynamics") assert self.cu_structure == struct_copy, "original structure was modified" - @pytest.mark.skip(reason="chgnet is failing with Numpy 1, see #3992") - @pytest.mark.skipif(int(np.__version__[0]) >= 2, reason="chgnet is not built against NumPy 2.0") def test_relax_chgnet(self): pytest.importorskip("chgnet") struct_copy = self.cu_structure.copy() @@ -1736,8 +1734,6 @@ def test_relax_chgnet(self): assert custom_relaxed.calc.results.get("energy") == approx(-6.0151076, abs=1e-4) assert custom_relaxed.volume == approx(40.044794644, abs=1e-4) - @pytest.mark.skip(reason="chgnet is failing with Numpy 1, see #3992") - @pytest.mark.skipif(int(np.__version__[0]) >= 2, reason="chgnet is not built against NumPy 2.0") def test_calculate_chgnet(self): pytest.importorskip("chgnet") struct = self.get_structure("Si") From dc4725341713cb6f45316623e3ebade9f5b856bf Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 13:54:40 +0800 Subject: [PATCH 10/26] migrate deprecated config --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a8967994f5..1bfad798af4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: rev: v2.3.0 hooks: - id: codespell - stages: [commit, commit-msg] + stages: [pre-commit, commit-msg] exclude_types: [html] additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11 exclude: src/pymatgen/analysis/aflow_prototypes.json From 300f4e414b7de422f85157c484f4bfcb76070595 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 13:56:13 +0800 Subject: [PATCH 11/26] pin python < 3.13 for chgnet and matgl --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 18023830daa..8bee412ed27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,7 @@ ase = ["ase>=3.23.0"] tblite = ["tblite[ase]>=0.3.0; python_version<'3.12'"] vis = ["vtk>=6.0.0"] abinit = ["netcdf4>=1.7.1"] -mlp = ["chgnet>=0.4.0", "matgl>=1.1.3"] +mlp = ["chgnet>=0.4.0; python_version<'3.13'", "matgl>=1.1.3; python_version<'3.13'"] electronic_structure = ["fdint>=2.0.2"] ci = ["pytest-cov>=4", "pytest-split>=0.8", "pytest>=8"] docs = ["invoke", "sphinx", "sphinx_markdown_builder", "sphinx_rtd_theme"] @@ -104,12 +104,12 @@ optional = [ # BoltzTraP2 build fails on Windows GitHub runners "BoltzTraP2>=24.9.4 ; platform_system != 'Windows'", "chemview>=0.6", - "chgnet>=0.4.0", + "chgnet>=0.4.0; python_version<'3.13'", "f90nml>=1.1.2", "galore>=0.6.1", "h5py>=3.11.0", "jarvis-tools>=2020.7.14", - "matgl>=1.1.3", + "matgl>=1.1.3; python_version<'3.13'", "matplotlib>=3.8", "netCDF4>=1.6.5", "phonopy>=2.23", From 464defe6931276efb3315715b03d39aad0f13f8d Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 14:06:18 +0800 Subject: [PATCH 12/26] try to exclude some python313 incompatible packages --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8bee412ed27..3da28da3203 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,7 +93,7 @@ ase = ["ase>=3.23.0"] # https://github.com/tblite/tblite/issues/175 tblite = ["tblite[ase]>=0.3.0; python_version<'3.12'"] vis = ["vtk>=6.0.0"] -abinit = ["netcdf4>=1.7.1"] +abinit = ["netcdf4>=1.7.1; python_version<'3.13'"] mlp = ["chgnet>=0.4.0; python_version<'3.13'", "matgl>=1.1.3; python_version<'3.13'"] electronic_structure = ["fdint>=2.0.2"] ci = ["pytest-cov>=4", "pytest-split>=0.8", "pytest>=8"] @@ -111,7 +111,7 @@ optional = [ "jarvis-tools>=2020.7.14", "matgl>=1.1.3; python_version<'3.13'", "matplotlib>=3.8", - "netCDF4>=1.6.5", + "netcdf4>=1.6.5; python_version<'3.13'", "phonopy>=2.23", "seekpath>=2.0.1", # tblite only support Python 3.12+ through conda-forge @@ -120,7 +120,7 @@ optional = [ "openbabel-wheel>=3.1.1.20", "tblite[ase]>=0.3.0; platform_system=='Linux' and python_version<'3.12'", ] -numba = ["numba>=0.55"] +numba = ["numba>=0.55; python_version<'3.13'"] numpy-v1 = ["numpy>=1.25.0,<2"] # Test NP1 on Windows (quite buggy ATM) [project.scripts] From d01bf59fb344c72e27e19faba733209f83e1953b Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 14:28:04 +0800 Subject: [PATCH 13/26] should work for python 3.13 now --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3da28da3203..b9828e00639 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,7 +102,8 @@ optional = [ "ase>=3.23.0", "beautifulsoup4", # BoltzTraP2 build fails on Windows GitHub runners - "BoltzTraP2>=24.9.4 ; platform_system != 'Windows'", + # TODO: BoltzTraP2 depends on netcdf4 which doesn't support Python 3.13 yet + "BoltzTraP2>=24.9.4 ; platform_system != 'Windows' and python_version<'3.13'", "chemview>=0.6", "chgnet>=0.4.0; python_version<'3.13'", "f90nml>=1.1.2", @@ -116,7 +117,7 @@ optional = [ "seekpath>=2.0.1", # tblite only support Python 3.12+ through conda-forge # https://github.com/tblite/tblite/issues/175 - "hiphive>=1.3.1", + "hiphive>=1.3.1; python_version<'3.13'", "openbabel-wheel>=3.1.1.20", "tblite[ase]>=0.3.0; platform_system=='Linux' and python_version<'3.12'", ] From 16caa145d2231496079f4ac4f3446dd96a7aad8a Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 14:30:46 +0800 Subject: [PATCH 14/26] revert migrated changes --- .github/workflows/jekyll-gh-pages.yml | 6 +++--- .pre-commit-config.yaml | 2 +- tests/core/test_structure.py | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index b21ea67fa6c..91f17b3ea39 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Pages - uses: actions/configure-pages@v5 + uses: actions/configure-pages@v3 - name: Build with Jekyll uses: actions/jekyll-build-pages@v1 @@ -36,7 +36,7 @@ jobs: destination: ./_site - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v2 deploy: environment: @@ -47,4 +47,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1bfad798af4..2a8967994f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: rev: v2.3.0 hooks: - id: codespell - stages: [pre-commit, commit-msg] + stages: [commit, commit-msg] exclude_types: [html] additional_dependencies: [tomli] # needed to read pyproject.toml below py3.11 exclude: src/pymatgen/analysis/aflow_prototypes.json diff --git a/tests/core/test_structure.py b/tests/core/test_structure.py index cf1d7caadf8..05ad8e9df50 100644 --- a/tests/core/test_structure.py +++ b/tests/core/test_structure.py @@ -1711,6 +1711,8 @@ def test_calculate_ase(self): assert not hasattr(calculator, "dynamics") assert self.cu_structure == struct_copy, "original structure was modified" + @pytest.mark.skip(reason="chgnet is failing with Numpy 1, see #3992") + @pytest.mark.skipif(int(np.__version__[0]) >= 2, reason="chgnet is not built against NumPy 2.0") def test_relax_chgnet(self): pytest.importorskip("chgnet") struct_copy = self.cu_structure.copy() @@ -1734,6 +1736,8 @@ def test_relax_chgnet(self): assert custom_relaxed.calc.results.get("energy") == approx(-6.0151076, abs=1e-4) assert custom_relaxed.volume == approx(40.044794644, abs=1e-4) + @pytest.mark.skip(reason="chgnet is failing with Numpy 1, see #3992") + @pytest.mark.skipif(int(np.__version__[0]) >= 2, reason="chgnet is not built against NumPy 2.0") def test_calculate_chgnet(self): pytest.importorskip("chgnet") struct = self.get_structure("Si") From 5fb01a7abbd109f30d0394873f4618c4d411eb30 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 16:23:41 +0800 Subject: [PATCH 15/26] NEED CONFIRM: bump numpy to 1.26.2 to support python 3.13 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b9828e00639..be7d59cef2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,7 @@ dependencies = [ "uncertainties>=3.1.4", # NumPy documentation suggests pinning the current major version as the C API is used # https://numpy.org/devdocs/dev/depending_on_numpy.html#runtime-dependency-version-ranges - "numpy>=1.25.0,<3", + "numpy>=1.26.2,<3", ] version = "2024.10.3" From 960a44b28559b7784234aff0d09a5b3428dca7d6 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 16:27:49 +0800 Subject: [PATCH 16/26] bump h5py to support python 3.13 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index be7d59cef2a..628e00e3592 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -108,7 +108,7 @@ optional = [ "chgnet>=0.4.0; python_version<'3.13'", "f90nml>=1.1.2", "galore>=0.6.1", - "h5py>=3.11.0", + "h5py>=3.12.1", "jarvis-tools>=2020.7.14", "matgl>=1.1.3; python_version<'3.13'", "matplotlib>=3.8", From a8a765a22ce4eb33f03ed192e9b937563224893a Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 10 Oct 2024 16:31:17 +0800 Subject: [PATCH 17/26] bump scipy to support python 3.13 --- pyproject.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 628e00e3592..1e007d4da91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,10 +65,7 @@ dependencies = [ "pybtex>=0.24.0", "requests>=2.32", "ruamel.yaml>=0.17.0", - "scipy>=1.13.0", - # scipy<1.14.1 is incompatible with NumPy 2.0 on Windows - # https://github.com/scipy/scipy/issues/21052 - "scipy>=1.14.1; platform_system == 'Windows'", + "scipy>=1.14.1", "spglib>=2.5.0", "sympy>=1.2", "tabulate>=0.9", From 0f02418f6a30316e973a0b911cb455b8461f8dad Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Tue, 19 Nov 2024 21:37:39 +0800 Subject: [PATCH 18/26] remove duplicate from merging --- pyproject.toml | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4a8ba373ec7..9848cdcd9fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ Python Materials Genomics is a robust materials analysis code that defines core and molecules with support for many electronic structure codes. It is currently the core analysis code powering the Materials Project (https://materialsproject.org).""" readme = "README.md" -requires-python = ">=3.10,<3.13" +requires-python = ">=3.10,<3.14" keywords = [ "ABINIT", "VASP", @@ -88,18 +88,11 @@ Pypi = "https://pypi.org/project/pymatgen" # 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"] ase = ["ase>=3.23.0"] -# tblite only support Python 3.12+ through conda-forge -# https://github.com/tblite/tblite/issues/175 -tblite = ["tblite[ase]>=0.3.0; python_version<'3.12'"] -vis = ["vtk>=6.0.0"] -abinit = ["netcdf4>=1.7.1; python_version<'3.13'"] -mlp = ["chgnet>=0.4.0; python_version<'3.13'", "matgl>=1.1.3; python_version<'3.13'"] -electronic_structure = ["fdint>=2.0.2"] ci = ["pytest-cov>=4", "pytest-split>=0.8", "pytest>=8"] docs = ["invoke", "sphinx", "sphinx_markdown_builder", "sphinx_rtd_theme"] electronic_structure = ["fdint>=2.0.2"] -mlp = ["chgnet>=0.3.8", "matgl>=1.1.3"] -numba = ["numba>=0.55"] +mlp = ["chgnet>=0.4.0; python_version<'3.13'", "matgl>=1.1.3; python_version<'3.13'"] +numba = ["numba>=0.55; python_version<'3.13'"] numpy-v1 = ["numpy>=1.25.0,<2"] # Test NP1 on Windows (quite buggy ATM) optional = [ "pymatgen[abinit,ase,mlp,tblite]", @@ -108,24 +101,20 @@ optional = [ # TODO: BoltzTraP2 depends on netcdf4 which doesn't support Python 3.13 yet "BoltzTraP2>=24.9.4 ; platform_system != 'Windows' and python_version<'3.13'", "chemview>=0.6", - "chgnet>=0.4.0; python_version<'3.13'", "f90nml>=1.1.2", "galore>=0.6.1", "h5py>=3.12.1", + "hiphive>=1.3.1; python_version<'3.13'", "jarvis-tools>=2020.7.14", - "matgl>=1.1.3; python_version<'3.13'", "matplotlib>=3.8", - "netcdf4>=1.6.5; python_version<'3.13'", + "openbabel-wheel>=3.1.1.20", "phonopy>=2.23", "seekpath>=2.0.1", - # tblite only support Python 3.12+ through conda-forge - # https://github.com/tblite/tblite/issues/175 - "hiphive>=1.3.1; python_version<'3.13'", - "openbabel-wheel>=3.1.1.20", - "tblite[ase]>=0.3.0; platform_system=='Linux' and python_version<'3.12'", ] -numba = ["numba>=0.55; python_version<'3.13'"] -numpy-v1 = ["numpy>=1.25.0,<2"] # Test NP1 on Windows (quite buggy ATM) +# tblite only support Python 3.12+ through conda-forge +# https://github.com/tblite/tblite/issues/175 +tblite = [ "tblite[ase]>=0.3.0; platform_system=='Linux' and python_version<'3.12'"] +vis = ["vtk>=6.0.0"] [project.scripts] pmg = "pymatgen.cli.pmg:main" From 687effa8da1135c6f1ceac8f7a13af962d6a991f Mon Sep 17 00:00:00 2001 From: Haoyu Yang Date: Wed, 20 Nov 2024 22:18:53 +0800 Subject: [PATCH 19/26] clean up comments --- pyproject.toml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9848cdcd9fc..4f9a9631125 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,10 @@ dependencies = [ "pybtex>=0.24.0", "requests>=2.32", "ruamel.yaml>=0.17.0", - "scipy>=1.14.1", + # scipy<1.14.1 is incompatible with NumPy 2.0 on Windows + # https://github.com/scipy/scipy/issues/21052 + "scipy>=1.13.0", + "scipy>=1.14.1; platform_system == 'Windows'", "spglib>=2.5.0", "sympy>=1.3", # PR #4116 "tabulate>=0.9", @@ -73,7 +76,7 @@ dependencies = [ "uncertainties>=3.1.4", # NumPy documentation suggests pinning the current major version as the C API is used # https://numpy.org/devdocs/dev/depending_on_numpy.html#runtime-dependency-version-ranges - "numpy>=1.26.2,<3", + "numpy>=1.25.0,<3", # TODO: only numpy>=1.26.2 supports Python 3.13 ] version = "2024.11.13" @@ -103,8 +106,8 @@ optional = [ "chemview>=0.6", "f90nml>=1.1.2", "galore>=0.6.1", - "h5py>=3.12.1", - "hiphive>=1.3.1; python_version<'3.13'", + "h5py>=3.11.0", # h5py>=3.12.1 supports Python 3.13 + "hiphive>=1.3.1; python_version<'3.13'", # TODO: no Python 3.13 support "jarvis-tools>=2020.7.14", "matplotlib>=3.8", "openbabel-wheel>=3.1.1.20", From cb0adc9b5153d27e930c145f3a77853fb2a682db Mon Sep 17 00:00:00 2001 From: Haoyu Yang Date: Wed, 20 Nov 2024 22:26:30 +0800 Subject: [PATCH 20/26] skip netcdf4 for python3.13 as 1.6.5 cannot be installed --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4f9a9631125..3544f15c7eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,8 +88,8 @@ 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"] +# PR4128: netcdf4 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; python_version<'3.13'"] ase = ["ase>=3.23.0"] ci = ["pytest-cov>=4", "pytest-split>=0.8", "pytest>=8"] docs = ["invoke", "sphinx", "sphinx_markdown_builder", "sphinx_rtd_theme"] From ccda40d65e05eb53e4e841284f0c1dd7daacf4f3 Mon Sep 17 00:00:00 2001 From: Haoyu Yang Date: Wed, 20 Nov 2024 22:31:01 +0800 Subject: [PATCH 21/26] make wheel build quiet --- .github/workflows/test.yml | 2 +- pyproject.toml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bfc44b37917..4208356e266 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -82,7 +82,7 @@ jobs: # Install from wheels to test the content uv pip install build - python -m build --wheel + python -m build --wheel -C--quiet uv pip install dist/*.whl uv pip install pymatgen[${{ matrix.config.extras }}] --resolution=${{ matrix.config.resolution }} diff --git a/pyproject.toml b/pyproject.toml index 3544f15c7eb..7ab3287a861 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,6 +89,7 @@ Pypi = "https://pypi.org/project/pymatgen" [project.optional-dependencies] # PR4128: netcdf4 1.7.1.post[1/2]/1.7.2 cause CI error +# TODO: netcdf4==1.6.5 (current only version left) cannot be installed for Python 3.13 abinit = ["netcdf4>=1.6.5,!=1.7.1.post1,!=1.7.1.post2,!=1.7.2; python_version<'3.13'"] ase = ["ase>=3.23.0"] ci = ["pytest-cov>=4", "pytest-split>=0.8", "pytest>=8"] @@ -96,7 +97,7 @@ docs = ["invoke", "sphinx", "sphinx_markdown_builder", "sphinx_rtd_theme"] electronic_structure = ["fdint>=2.0.2"] mlp = ["chgnet>=0.4.0; python_version<'3.13'", "matgl>=1.1.3; python_version<'3.13'"] numba = ["numba>=0.55; python_version<'3.13'"] -numpy-v1 = ["numpy>=1.25.0,<2"] # Test NP1 on Windows (quite buggy ATM) +numpy-v1 = ["numpy>=1.25.0,<2"] # Test NP1 on Windows (buggy at this moment) optional = [ "pymatgen[abinit,ase,mlp,tblite]", "beautifulsoup4", @@ -116,7 +117,7 @@ optional = [ ] # tblite only support Python 3.12+ through conda-forge # https://github.com/tblite/tblite/issues/175 -tblite = [ "tblite[ase]>=0.3.0; platform_system=='Linux' and python_version<'3.12'"] +tblite = ["tblite[ase]>=0.3.0; platform_system=='Linux' and python_version<'3.12'"] vis = ["vtk>=6.0.0"] [project.scripts] From 0f9d2a1fd9063dbb0cfafabfa693b66a8bff8126 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 21 Nov 2024 10:31:46 +0800 Subject: [PATCH 22/26] test openff-toolkit --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4208356e266..0ba5d9b3d12 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,7 +71,8 @@ jobs: - name: Install ubuntu-only conda dependencies if: matrix.config.os == 'ubuntu-latest' run: | - micromamba install -n pmg -c conda-forge bader enumlib packmol pygraphviz tblite --yes + micromamba install -n pmg -c conda-forge --yes \ + bader enumlib packmol pygraphviz tblite openff-toolkit # TODO: openff-toolkit doesn't support Python 3.13 yet - name: Install pymatgen and dependencies via uv From 18175dbf59ae4eda0eb20400df666e1df4362704 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 21 Nov 2024 10:36:30 +0800 Subject: [PATCH 23/26] still cannot install openff-toolkit --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ba5d9b3d12..66a84784ee7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,8 @@ jobs: if: matrix.config.os == 'ubuntu-latest' run: | micromamba install -n pmg -c conda-forge --yes \ - bader enumlib packmol pygraphviz tblite openff-toolkit + bader enumlib packmol pygraphviz tblite + # openff-toolkit # TODO: openff-toolkit doesn't support Python 3.13 yet - name: Install pymatgen and dependencies via uv From e3f69e58594dc6ec16cffb6917502d7162f808a9 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 21 Nov 2024 10:41:47 +0800 Subject: [PATCH 24/26] clean up comment --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7ab3287a861..bf4a287636d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ Python Materials Genomics is a robust materials analysis code that defines core and molecules with support for many electronic structure codes. It is currently the core analysis code powering the Materials Project (https://materialsproject.org).""" readme = "README.md" -requires-python = ">=3.10,<3.14" +requires-python = ">=3.10,<=3.13" keywords = [ "ABINIT", "VASP", @@ -76,7 +76,7 @@ dependencies = [ "uncertainties>=3.1.4", # NumPy documentation suggests pinning the current major version as the C API is used # https://numpy.org/devdocs/dev/depending_on_numpy.html#runtime-dependency-version-ranges - "numpy>=1.25.0,<3", # TODO: only numpy>=1.26.2 supports Python 3.13 + "numpy>=1.25.0,<3", ] version = "2024.11.13" @@ -107,8 +107,8 @@ optional = [ "chemview>=0.6", "f90nml>=1.1.2", "galore>=0.6.1", - "h5py>=3.11.0", # h5py>=3.12.1 supports Python 3.13 - "hiphive>=1.3.1; python_version<'3.13'", # TODO: no Python 3.13 support + "h5py>=3.11.0", + "hiphive>=1.3.1; python_version<'3.13'", "jarvis-tools>=2020.7.14", "matplotlib>=3.8", "openbabel-wheel>=3.1.1.20", From cf318dee6b63525911fa1610ec2c23cdcd949246 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 12 Dec 2024 12:42:22 +0800 Subject: [PATCH 25/26] remove manual torch install --- .github/workflows/test.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d1b1ac4062..08f0ec66db1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -82,10 +82,6 @@ jobs: - name: Install pymatgen and dependencies via uv run: | micromamba activate pmg - # TODO1 (use uv over pip) uv install torch is flaky, track #3826 - # TODO2 (pin torch version): DGL library (matgl) doesn't support torch > 2.2.1, - # see: https://discuss.dgl.ai/t/filenotfounderror-cannot-find-dgl-c-graphbolt-library/4302 - pip install torch==2.2.1 # Install from wheels to test the content uv build --wheel --no-build-logs From 54bbc6bcf8cadc6010a2f0b582ea21a0d6001279 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Fri, 20 Dec 2024 10:51:10 +0800 Subject: [PATCH 26/26] fix python version pin --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3b5d1fa3313..f8d4b18e021 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ Python Materials Genomics is a robust materials analysis code that defines core and molecules with support for many electronic structure codes. It is currently the core analysis code powering the Materials Project (https://materialsproject.org).""" readme = "README.md" -requires-python = ">=3.10,<=3.13" +requires-python = ">=3.10,<3.14" keywords = [ "ABINIT", "VASP",