Skip to content

Widen scikit-learn constraint to <2 - #103

Merged
srmnitc merged 2 commits into
ICAMS:masterfrom
pmrv:scikit-learn-upstream
Sep 4, 2026
Merged

Widen scikit-learn constraint to <2#103
srmnitc merged 2 commits into
ICAMS:masterfrom
pmrv:scikit-learn-upstream

Conversation

@pmrv

@pmrv pmrv commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

The <=1.4.2 pin came from a blanket version-pinning commit; the only sklearn usage is Ridge from sklearn.linear_model, which is stable across 1.x releases. Match the style of the numpy/pandas constraints.

Checklist

  • Code is well-documented.
  • All tests have been run and passed.
  • Relevant documentation has been updated if necessary.

License Agreement

By submitting this pull request, I agree that:

  • The code submitted in this pull request will be distributed under the Academic Software License (free for academic non-commercial use, not free for commercial use), see LICENSE.md for more details.
  • The copyright for the code, including the submitted code, remains with Ruhr University Bochum. Ruhr University Bochum retains the right to transfer or modify the copyright.

Thank you for your contribution!

The <=1.4.2 pin came from a blanket version-pinning commit; the only
sklearn usage is Ridge from sklearn.linear_model, which is stable
across 1.x releases. Match the style of the numpy/pandas constraints.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FT7d8d2E3FansicmSzJ1SW
yury-lysogorskiy added a commit that referenced this pull request Aug 27, 2026
Both CI jobs aborted during pytest collection with

    pyace/activelearning.py:9: from maxvolpy.maxvol import maxvol
    E ModuleNotFoundError: No module named 'maxvolpy'
    Interrupted: 2 errors during collection

so no test ran at all. This is pre-existing and unrelated to any particular
change - run 31264271622 (17 Aug, PR #103) fails identically.

`maxvolpy` is installed by the custom InstallMaxVolPyLocalPackage(install)
command in setup.py, which shells out to `cd lib/maxvolpy; python setup.py
install`. The workflow installs with `pip install .`, which builds a wheel and
never invokes the legacy `install` command, so that hook never runs.
(`python setup.py install` is also gone in setuptools >= 80.)

Build it explicitly instead. `--no-build-isolation` is required because
lib/maxvolpy/setup.py imports Cython and numpy at module level while declaring
no pyproject.toml build-system, so an isolated build environment fails with
ModuleNotFoundError: No module named 'Cython'. Cython and scipy are installed
first: the extension cimports scipy/linalg/cython_blas.pxd. numpy is
deliberately not installed here, to avoid resolving past setup.py's
`numpy<=1.26.4` pin; it is already present from the python-ace install.

Verified locally in a clean venv: with build isolation the build fails on the
missing Cython, without scipy it fails cythonizing _maxvol.pyx, and with the
command used here it builds a wheel and `from maxvolpy.maxvol import maxvol`
succeeds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017QbfG2UVKxkeuiz9GtDLo4
srmnitc added a commit to pmrv/python-ace that referenced this pull request Sep 4, 2026
Bring in the CI fixes that landed after this branch was cut, so the
pipeline can actually exercise the pkg_resources change.

Both jobs on this PR (run 31264233541, 8 Aug) failed in "Test with
python-ace with tensorpotential". The logs are not readable without admin
rights, but the failure is pre-existing and not from this branch: the
sibling PR ICAMS#103 (run 31264271622) failed in the same step on the same day
off the same base, and 3bfa4df records that failure as

    pyace/activelearning.py:9: from maxvolpy.maxvol import maxvol
    E ModuleNotFoundError: No module named 'maxvolpy'
    Interrupted: 2 errors during collection

i.e. no test ran at all. Master has since fixed it:

  * 3bfa4df installs lib/maxvolpy explicitly, because `pip install .`
    builds a wheel and never runs setup.py's InstallMaxVolPyLocalPackage
    hook, so the suite could not be collected at all. This branch's run
    predates that step existing in the workflow.
  * d63466f imports UnitCellFilter from ase.filters with a fallback to
    ase.constraints; that was the sole remaining failure once collection
    worked, and it only affected the 3.10 job.

Merge is clean. Both sides touch bin/pacemaker in different hunks - the
import block here, the cutoff deprecation from f366916 further down - and
both survived intact.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bring in the CI fixes that landed after this branch was cut, so the
pipeline can actually exercise the widened scikit-learn constraint.

Both jobs on this PR (run 31264271622, 8 Aug) failed in "Test with
python-ace with tensorpotential" - the run 3bfa4df cites by number as
failing identically to ICAMS#104, from

    pyace/activelearning.py:9: from maxvolpy.maxvol import maxvol
    E ModuleNotFoundError: No module named 'maxvolpy'
    Interrupted: 2 errors during collection

i.e. collection aborted and no test ran, so the sklearn bound was never
tested either way. Pre-existing and unrelated to this branch. Master has
since fixed it in 3bfa4df (install lib/maxvolpy explicitly, since `pip
install .` builds a wheel and never runs setup.py's
InstallMaxVolPyLocalPackage hook) and d63466f (UnitCellFilter moved to
ase.filters; 3.10 job only).

Merge is clean - master has not touched setup.py since b143ac3.

Verified the premise of this change while I was here. sklearn is used in
exactly one place, src/pyace/linearacefit.py:332:

    Ridge(alpha=1e-5, fit_intercept=False, copy_X=False,
          random_state=42, solver="auto")

plus .fit(), .predict() and .coef_. Ran that exact call against the
versions the two jobs will now resolve - 1.6.1 for 3.9 and 1.7.2 for 3.10
(1.8+ requires Python >= 3.11, so it is out of reach here) - and against
1.9.0 as the top of the range, each alongside the numpy<=1.26.4 pin from
the same install_requires. Identical coefficients, no warnings, no
resolver backtracking: sklearn 1.9.0 asks for numpy>=1.24.1, which the
pin satisfies. No `normalize` argument anywhere, which is the one Ridge
parameter removed during 1.x (in 1.2).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@srmnitc
srmnitc merged commit 66c35ea into ICAMS:master Sep 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants