Skip to content

Re-declare scipy as a direct dependency - #1148

Merged
AlexanderFengler merged 1 commit into
mainfrom
restore-scipy-direct-dependency
Aug 9, 2026
Merged

Re-declare scipy as a direct dependency#1148
AlexanderFengler merged 1 commit into
mainfrom
restore-scipy-direct-dependency

Conversation

@AlexanderFengler

Copy link
Copy Markdown
Member
  • Re-adds scipy>=1.10 to [project.dependencies], dropped in Fixed numpy version #1137.
  • scipy is a direct import in shipped source, not a transitive dependency:
    • src/hssm/plotting/predictive.py:13from scipy.stats import gaussian_kde
    • src/hssm/plotting/quantile_probability.py:14from scipy.stats import chi2
  • Today it arrives only via pymc. If pymc ever drops or re-scopes its scipy requirement, hssm.plotting breaks at import with no constraint to protect it — the same undeclared-direct-import fragility behind the numpy 2.5 row_stack CI breakage (drift: numpy 2.5 broke the fast suite on fresh resolves (row_stack removed) #1144).

Why this is not the #1145 objection

#1145 was rightly closed for declaring versions of transitive dependencies, which transfers version-management burden to us for packages we never import. That objection does not apply here: scipy is imported directly by code we ship, so declaring it is standard packaging practice (PEP 508 — declare what you import). The floor is deliberately loose (>=1.10, resolving to 1.18.0 today) so it constrains nothing in practice; it only guarantees scipy is present.

Verification

  • uv lock — no lockfile change; scipy already resolved at a satisfying version.
  • uv run prek run --all-files — ruff check/format and all file hooks pass. The mypy and pyrefly hooks fail identically on unmodified main (14 pre-existing errors in tests/rl/test_rlssm.py and tests/addm/oracle/validation.py); unrelated to this change.
  • from scipy.stats import gaussian_kde, chi2 and both hssm.plotting modules import cleanly (scipy 1.18.0).

🤖 Generated with Claude Code

scipy is imported directly by shipped source in hssm.plotting
(gaussian_kde, chi2) but reaches installs only transitively via pymc
after #1137 dropped the explicit entry.

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

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch restore-scipy-direct-dependency

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AlexanderFengler
AlexanderFengler merged commit 5233a21 into main Aug 9, 2026
5 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.

1 participant