From f7f9ad3f4c461df1ccbb368aac2171c0170e9d10 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Mon, 13 Oct 2025 09:18:10 +0200 Subject: [PATCH 1/2] Drop support for Python 3.9 --- .github/workflows/python-tests.yml | 4 ++-- .github/workflows/torch-tests.yml | 2 +- featomic-torch/CHANGELOG.md | 4 ++++ featomic/CHANGELOG.md | 4 ++++ python/featomic/pyproject.toml | 2 +- python/featomic_torch/pyproject.toml | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 7a6dff47e..9cf370bf2 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -19,7 +19,7 @@ jobs: matrix: include: - os: ubuntu-24.04 - python-version: "3.9" + python-version: "3.10" - os: ubuntu-24.04 python-version: "3.13" - os: macos-15 @@ -68,7 +68,7 @@ jobs: name: Python ${{ matrix.python-version }} / check build strategy: matrix: - python-version: ['3.9', '3.13'] + python-version: ['3.10', '3.13'] os: [ubuntu-24.04] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/torch-tests.yml b/.github/workflows/torch-tests.yml index 4de4efd60..93fd31c80 100644 --- a/.github/workflows/torch-tests.yml +++ b/.github/workflows/torch-tests.yml @@ -20,7 +20,7 @@ jobs: include: - os: ubuntu-24.04 torch-version: "2.1" - python-version: "3.9" + python-version: "3.10" cargo-test-flags: --release - os: ubuntu-24.04 diff --git a/featomic-torch/CHANGELOG.md b/featomic-torch/CHANGELOG.md index 865aa67c5..540aaf67a 100644 --- a/featomic-torch/CHANGELOG.md +++ b/featomic-torch/CHANGELOG.md @@ -17,6 +17,10 @@ a changelog](https://keepachangelog.com/en/1.1.0/) format. This project follows ### Removed --> +### Changed + +- We now require Python >= 3.10 + ## [Version 0.7.1](https://github.com/metatensor/featomic/releases/tag/featomic-torch-v0.7.1) - 2025-09-17 - Added support for torch v2.8, and metatensor-torch v0.8.0 diff --git a/featomic/CHANGELOG.md b/featomic/CHANGELOG.md index 4d7c46b1d..b4e2ff863 100644 --- a/featomic/CHANGELOG.md +++ b/featomic/CHANGELOG.md @@ -17,6 +17,10 @@ a changelog](https://keepachangelog.com/en/1.1.0/) format. This project follows ### Removed --> +### Changed + +- We now require Python >= 3.10 + ## [Version 0.6.3](https://github.com/metatensor/featomic/releases/tag/featomic-v0.6.2) - 2025-10-06 ### Fixed diff --git a/python/featomic/pyproject.toml b/python/featomic/pyproject.toml index 05a0ce538..c75025797 100644 --- a/python/featomic/pyproject.toml +++ b/python/featomic/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "featomic" dynamic = ["version", "authors", "optional-dependencies"] -requires-python = ">=3.9" +requires-python = ">=3.10" readme = "README.rst" license = "BSD-3-Clause" diff --git a/python/featomic_torch/pyproject.toml b/python/featomic_torch/pyproject.toml index bfa6e5d35..acdcfeab1 100644 --- a/python/featomic_torch/pyproject.toml +++ b/python/featomic_torch/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "featomic-torch" dynamic = ["version", "authors", "dependencies"] -requires-python = ">=3.9" +requires-python = ">=3.10" readme = "README.rst" license = "BSD-3-Clause" From 29798b2cdac1d72849ee24a1959e3a8a96184585 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Mon, 13 Oct 2025 09:29:16 +0200 Subject: [PATCH 2/2] Add `strict=True` to all calls to zip --- .../featomic/featomic/clebsch_gordan/_cartesian_spherical.py | 2 +- python/featomic/featomic/clebsch_gordan/_utils.py | 4 ++-- python/featomic/featomic/splines.py | 1 + python/featomic/featomic/systems/ase.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/python/featomic/featomic/clebsch_gordan/_cartesian_spherical.py b/python/featomic/featomic/clebsch_gordan/_cartesian_spherical.py index 2c9b678d0..7fd7c96c3 100644 --- a/python/featomic/featomic/clebsch_gordan/_cartesian_spherical.py +++ b/python/featomic/featomic/clebsch_gordan/_cartesian_spherical.py @@ -413,7 +413,7 @@ def _do_coupling( ) # create one block for each output of `cg_couple` - for o3_lambda, values in zip(o3_lambdas, outputs): + for o3_lambda, values in zip(o3_lambdas, outputs, strict=True): o3_sigma = int(old_sigma * (-1) ** (l1 + l2 + o3_lambda)) new_keys_values.append( [o3_lambda, o3_sigma] + _dispatch.to_int_list(key.values) diff --git a/python/featomic/featomic/clebsch_gordan/_utils.py b/python/featomic/featomic/clebsch_gordan/_utils.py index 2a2321b8f..7f495ba3e 100644 --- a/python/featomic/featomic/clebsch_gordan/_utils.py +++ b/python/featomic/featomic/clebsch_gordan/_utils.py @@ -195,7 +195,7 @@ def _group_combinations_of_same_blocks( keys_values: List[List[int]] = [] combinations: List[Combination] = [] - for (block_1, block_2), keys_idx in zip(groups, groups_keys): + for (block_1, block_2), keys_idx in zip(groups, groups_keys, strict=True): o3_lambdas: List[int] = [] for key_i in keys_idx: keys_values.append(_dispatch.to_int_list(output_keys.values[key_i])) @@ -248,7 +248,7 @@ def cg_tensor_product_blocks( # Create the TensorBlocks results: List[TensorBlock] = [] - for values, o3_lambda in zip(combined_values, o3_lambdas): + for values, o3_lambda in zip(combined_values, o3_lambdas, strict=True): block = TensorBlock( values=values, samples=block_1.samples, diff --git a/python/featomic/featomic/splines.py b/python/featomic/featomic/splines.py index ec4d7fbf8..10bb6ceb2 100644 --- a/python/featomic/featomic/splines.py +++ b/python/featomic/featomic/splines.py @@ -241,6 +241,7 @@ def get_hypers(self): self.spline.positions, self.spline.values, self.spline.derivatives, + strict=True, ) ], } diff --git a/python/featomic/featomic/systems/ase.py b/python/featomic/featomic/systems/ase.py index 6774e6d6b..783376a16 100644 --- a/python/featomic/featomic/systems/ase.py +++ b/python/featomic/featomic/systems/ase.py @@ -90,7 +90,7 @@ def compute_neighbors(self, cutoff): self._pairs = [] nl_result = neighborlist.neighbor_list("ijdDS", self._atoms, cutoff) - for i, j, d, D, S in zip(*nl_result): + for i, j, d, D, S in zip(*nl_result, strict=True): # we want a half neighbor list, so drop all duplicated neighbors if j < i: continue