Skip to content

Package with pyproject.toml, test old to new dependency stacks, modernize CI - #65

Open
crvernon wants to merge 1 commit into
v3/out-1.3-transitionsfrom
v3/packaging-repo
Open

crvernon wants to merge 1 commit into
v3/out-1.3-transitionsfrom
v3/packaging-repo

Conversation

@crvernon

Copy link
Copy Markdown
Member

Stacked PR — part of the Demeter v3.0.0 upgrade. Base: v3/out-1.3-transitions. Review and merge in order, bottom of the stack first.

Plan items: 4.1, 4.3, 4.5, 4.6, 1.9b, 5.2 (partial)

Benchmark: IDENTICAL on the pinned stack. Latest stack (NumPy 2 / pandas 3) is WITHIN_TOLERANCE (4.7e-10 km²). 28/28 tests pass on the minimum, pinned, and latest stacks. This is the first PR that runs the new CI workflow on GitHub. Removing tracked artifacts (build/, comp_data/, pickles) is left as a follow-up.

Commits

Package with pyproject.toml, test old to new dependency stacks, modernize CI

Packaging (plan 4.1, 4.4, 4.5, 4.6):

  • PEP 621 pyproject.toml; setup.py is now a shim.
  • Version 3.0.0.dev0. Requires Python >= 3.11 (3.10 reaches end of
    life in October 2026).
  • gcamreader and matplotlib move to the [gcam] and [plot] extras and
    are imported lazily, with an install hint. Also new: [test], [docs],
    and [dev] extras.
  • Comparison pickles and duplicate .pkl files are excluded from
    distributions. A clean build is a 7.4 MB wheel.
  • MANIFEST.in no longer references a missing directory and now includes
    the mapping inputs it left out.
  • Docker uses python:3.12-slim with a JRE for gcamreader; the old image
    ran Python 3.6, below the minimum setup.py required.

Dependency compatibility (plan 1.9):

  • pandas 3 Copy-on-Write made the region array read-only, which broke
    the Taiwan remap. It is now copied.
  • inplace=True is replaced throughout (deprecated in pandas 3).
  • The projected land test input is added as land_df.csv.gz, an exact
    round trip of the pickle. The pickle files are kept for now (their
    removal is a separate decision). benchmarks/cases.read_projected
    prefers the CSV.
  • Test suite (28 tests) passes on three stacks: minimum (numpy 1.26.4,
    pandas 2.1.4, scipy 1.11.4, xarray 2024.1.1); pinned (1.26.4 / 2.2.1 /
    1.12.0); and latest (numpy 2.4.6, pandas 3.1.0, scipy 1.17.1,
    xarray 2026.9.0, with no warnings).
  • Benchmark on the latest stack: WITHIN_TOLERANCE of v3.0.0-b4, max
    4.7e-10 km2, about 15% faster. On the pinned stack: IDENTICAL.

CI (plan 4.3, 0.5):

  • Runs on pull requests.
  • Lint (syntax errors and undefined names).
  • Fast tests on ubuntu and macOS, Python 3.11-3.13.
  • Full tests on the minimum and latest stacks.
  • Benchmark job comparing the global and Texas cases against the
    baseline named in benchmarks/baselines/CURRENT. The compare reports
    go to the job summary and an artifact. The job fails on DRIFT unless
    the PR promotes a new baseline.
  • compare.py falls back to state hashes and region x metric totals when
    a baseline has no full arrays.

🤖 Generated with Claude Code

…nize CI

Packaging (plan 4.1, 4.4, 4.5, 4.6):
- PEP 621 pyproject.toml; setup.py is now a shim.
- Version 3.0.0.dev0. Requires Python >= 3.11 (3.10 reaches end of
  life in October 2026).
- gcamreader and matplotlib move to the [gcam] and [plot] extras and
  are imported lazily, with an install hint. Also new: [test], [docs],
  and [dev] extras.
- Comparison pickles and duplicate .pkl files are excluded from
  distributions. A clean build is a 7.4 MB wheel.
- MANIFEST.in no longer references a missing directory and now includes
  the mapping inputs it left out.
- Docker uses python:3.12-slim with a JRE for gcamreader; the old image
  ran Python 3.6, below the minimum setup.py required.

Dependency compatibility (plan 1.9):
- pandas 3 Copy-on-Write made the region array read-only, which broke
  the Taiwan remap. It is now copied.
- inplace=True is replaced throughout (deprecated in pandas 3).
- The projected land test input is added as land_df.csv.gz, an exact
  round trip of the pickle. The pickle files are kept for now (their
  removal is a separate decision). benchmarks/cases.read_projected
  prefers the CSV.
- Test suite (28 tests) passes on three stacks: minimum (numpy 1.26.4,
  pandas 2.1.4, scipy 1.11.4, xarray 2024.1.1); pinned (1.26.4 / 2.2.1 /
  1.12.0); and latest (numpy 2.4.6, pandas 3.1.0, scipy 1.17.1,
  xarray 2026.9.0, with no warnings).
- Benchmark on the latest stack: WITHIN_TOLERANCE of v3.0.0-b4, max
  4.7e-10 km2, about 15% faster. On the pinned stack: IDENTICAL.

CI (plan 4.3, 0.5):
- Runs on pull requests.
- Lint (syntax errors and undefined names).
- Fast tests on ubuntu and macOS, Python 3.11-3.13.
- Full tests on the minimum and latest stacks.
- Benchmark job comparing the global and Texas cases against the
  baseline named in benchmarks/baselines/CURRENT. The compare reports
  go to the job summary and an artifact. The job fails on DRIFT unless
  the PR promotes a new baseline.
- compare.py falls back to state hashes and region x metric totals when
  a baseline has no full arrays.

Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant