Skip to content

feat(models): make pygam an optional dependency - #1381

Merged
Marius1311 merged 1 commit into
mainfrom
feat/optional-pygam
Oct 13, 2026
Merged

Marius1311 merged 1 commit into
mainfrom
feat/optional-pygam

Conversation

@Marius1311

Copy link
Copy Markdown
Collaborator

Summary

  • pygam moves from dependencies to a new gam extra. cellrank.models.GAM imports it lazily and raises ModuleNotFoundError with pip install cellrank[gam] when it is missing; import cellrank no longer needs it.
  • pygam joins the test group; docs/installation.md and AGENTS.md list the extra.

Why

Every pyGAM release (0.10.1–0.12.0) declares scipy<1.17 (dswah/pyGAM#584, open since May). As a required dependency it holds pip users on scipy 1.16 and makes CellRank unsolvable wherever scipy is pinned by conda (e.g. pixi with conda-forge scipy 1.18). Only GAM uses it.

Breaking change

Fitting gene trends with cr.models.GAM now needs pip install "cellrank[gam]" — worth a line in the release notes. The conda-forge recipe can keep pygam as a run dependency (conda-forge's pygam has no scipy cap).

Testing

  • tests/test_model.py, tests/test_utils.py: 272 passed, 14 skipped (Python 3.12, scipy 1.16.3, pygam 0.12.0).
  • New tests: import cellrank with pygam blocked (subprocess), and GAM() raising the install hint.
  • The PETSc / SLEPc + R job has failed on main since 2026-10-01 (petsc4py 3.26 removed Mat.getVecs); unrelated, follow-up PR.

🤖 Generated with Claude Code

Every pyGAM release caps scipy<1.17 (dswah/pyGAM#584), so a required pygam
holds scipy back for all CellRank users and fails to solve where scipy is
pinned by conda. Only cellrank.models.GAM needs it: import it lazily there and
point to `pip install cellrank[gam]` when it is missing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T10:09:12.148898Z 163ae90 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Marius1311
Marius1311 merged commit d4bce4d into main Oct 13, 2026
11 of 13 checks passed
@Marius1311
Marius1311 deleted the feat/optional-pygam branch October 13, 2026 13:44
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