Skip to content

Support up to pandas 3 - #100

Merged
srmnitc merged 5 commits into
ICAMS:masterfrom
pmrv:claude/sleepy-dijkstra-luopd2
Sep 4, 2026
Merged

Support up to pandas 3#100
srmnitc merged 5 commits into
ICAMS:masterfrom
pmrv:claude/sleepy-dijkstra-luopd2

Conversation

@pmrv

@pmrv pmrv commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Pull Request Template

Thank you for contributing to our project! Please review the checklist and fill out the details below.

Description of Changes

Widens the pandas requirement in setup.py from pandas<=2.0 to pandas>=2,<4, covering the whole pandas 2.x and 3.x series.

The codebase was audited for pandas 3 blockers; none were found:

No use of APIs removed in pandas 2/3 (DataFrame.append, applymap, Series.iteritems, delim_whitespace, .ix).
No chained assignment — all DataFrame writes go through df[col] = ... or df.loc[mask, col] = ..., so pandas 3's enforced Copy-on-Write does not change behavior.
All .map() calls operate on Series/Index objects, so nothing depends on DataFrame.map (introduced in 2.1), keeping the 2.0 lower bound valid.
Legacy pickled reference DataFrames (tests/*.pckl.gzip, [data/exmpl_df.pckl.gzip](https://github.com/pmrv/python-ace/blob/claude/sleepy-dijkstra-luopd2/data/exmpl_df.pckl.gzip)) load correctly under pandas 3, with object dtype preserved.
The existing numpy<=1.26.4 pin satisfies pandas 3's numpy ≥1.26 requirement.

Also installs the vendored lib/maxvolpy explicitly in the test workflow: pip install . does not run the custom setup.py install hook, so test_activelearning/test_activeexploration failed collection in CI with ModuleNotFoundError: maxvolpy.

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!

pmrv and others added 4 commits February 25, 2025 21:41
Static review and the test suite show no pandas 3 blockers: no removed
APIs, no chained assignment (Copy-on-Write safe), all .map() usage is on
Series, and legacy pickled dataframes still load. Verified by running
the test suite under pandas 2.0.3 and 3.0.3.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HuteAomkhXVg2b5vco62Xw
pip install . does not run the custom setup.py install hook that
installs lib/maxvolpy, so test collection failed with
ModuleNotFoundError for test_activelearning and test_activeexploration.
Install it explicitly after the main package.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HuteAomkhXVg2b5vco62Xw
UnitCellFilter moved from ase.constraints to ase.filters in ase 3.23;
try the new location first and fall back for older ase.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HuteAomkhXVg2b5vco62Xw
@pmrv pmrv changed the title Claude/sleepy dijkstra luopd2 Support up to pandas 3 Jul 15, 2026
@pmrv

pmrv commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

There's some drive-by fixes for the CI too. Not sure if those were only important for my repo or also here.

Bring in master and drop this branch's now-redundant copies of the two CI
fixes, leaving the pandas bound as its only net change.

This branch (15 Jul) found both CI problems before ICAMS#104 did and carried
its own fixes for them, so master and this branch fixed the same two
things independently and both files conflicted:

  * .github/workflows/test.yml - both add an "Install maxvolpy" step.
    Resolved to master's: it installs `Cython scipy` rather than only
    `cython`, and spells out why --no-build-isolation is needed.
  * tests/test_PyACECalculator.py - both wrap the UnitCellFilter import.
    Identical logic, only comment placement differed; resolved to
    master's.

Both files are now byte-identical to master, so the net diff against
master is the single setup.py line this PR is actually about.

Verified the pandas audit rather than assuming it:

  * No use of APIs dropped in pandas 2/3 - no applymap, iteritems,
    delim_whitespace, .ix, get_values or lookup anywhere. Every
    `.append(` hit is a plain list; preparedata.py:706 appends to a list
    and then calls pd.concat, which is the modern pattern.
  * The `>=2` floor holds. paralleldataexecutor.py:68 looked like a
    DataFrame.map (pandas 2.1+) risk given the `batch_df` name, but the
    call is guarded by `isinstance(batch_df, pd.Series)` and DataFrames
    take the `.apply(..., axis=1)` branch, so nothing needs 2.1.
  * No chained assignment on DataFrames; writes go through df[col] = or
    df.loc[mask, col] =. The inplace=True calls that do exist (drop,
    dropna, reset_index) are on owned frames, not slices.
  * All 12 pickled frames in the repo load under pandas 3.0.5 / numpy
    2.5.2, not just the exmpl_df cited in the PR. Nine of them are
    pyace.preparedata.DataFrameWithMetadata, a pd.DataFrame subclass
    with _metadata and a _constructor override - the part most exposed
    to pandas 3 - and they rebuild with the metadata attribute intact
    and object dtypes preserved. index.map(str), Series.map(len),
    df[col] =, df.loc[mask, col] = and pd.concat all run clean on the
    loaded frames with no CoW warnings.

Caveat: a green run here does not exercise pandas 3, for two independent
reasons. pandas 3.0 requires Python >= 3.11 and this matrix is 3.9/3.10,
so it cannot be installed at all; and TensorPotential pins pandas<=2.0
and is installed first, so both jobs resolve pandas 2.0.0 whichever bound
this file carries. CI can only show no regression against pandas 2.0.0.
Same shape of gap as ICAMS#101 has for numpy.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@srmnitc
srmnitc merged commit 5ea895e 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