Skip to content

Fix #32: scipy>=1.15 compat + lamindb modules flag#34

Merged
jkobject merged 1 commit into
mainfrom
fix/scipy-115-series-indexing
May 20, 2026
Merged

Fix #32: scipy>=1.15 compat + lamindb modules flag#34
jkobject merged 1 commit into
mainfrom
fix/scipy-115-series-indexing

Conversation

@jkobject
Copy link
Copy Markdown
Owner

Fixes #32.

Changes

  • preprocess.additional_postprocess: cast pd.Series boolean mask to numpy before indexing AnnData.X. scipy >= 1.15 dropped the implicit relaxed indexing of sparse arrays with pandas Series (see scipy/scipy@66ec333), so adata.X[adata.obs[NEWOBS] == i] raises AttributeError: 'Series' object has no attribute 'nonzero'. Casting with .to_numpy() fixes the regression and is forward-compatible.
  • Docs/README: replace deprecated lamin init --schema bionty with --modules bionty (lamindb 2.1.x). Also matches the reporter's working notebook (gist).
  • Bumped version to 2.1.3 so scPRINT-2 can pin to the fixed release.

Test plan

  • Ran the failing snippet (additional_postprocess(adata) with a mock AnnData) on scipy 1.15 — no more AttributeError.

CC @Stfort52 — thanks for the very thorough bug report (including the scipy commit pointer).

- preprocess.additional_postprocess: cast pandas boolean Series to numpy
  before indexing AnnData.X, since scipy>=1.15 removed implicit relaxed
  indexing of sparse arrays with pandas Series (reported in #32).
- docs/README: replace deprecated 'lamin init --schema bionty' with the
  current 'lamin init --modules bionty' (lamindb 2.1.x).
- bump version to 2.1.3.

Refs #32.
Copilot AI review requested due to automatic review settings May 20, 2026 07:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a preprocessing regression with SciPy ≥ 1.15 when boolean-indexing sparse AnnData.X using a pandas Series, and updates LaminDB initialization instructions to use the newer --modules flag. Also bumps the package version for downstream pinning.

Changes:

  • Cast boolean masks to NumPy arrays before indexing AnnData.X in additional_postprocess (SciPy ≥ 1.15 compatibility).
  • Update docs/README LaminDB init command from deprecated --schema bionty to --modules bionty.
  • Bump project version from 2.1.2 to 2.1.3.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scdataloader/preprocess.py Fix sparse boolean indexing by converting pandas boolean Series masks to NumPy arrays.
README.md Update lamin init examples to use --modules bionty.
pyproject.toml Bump project version to 2.1.3.
docs/notebooks/1_download_and_preprocess.ipynb Update commented lamin init command to --modules bionty.
docs/index.md Mirror README doc change for lamin init --modules bionty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.02%. Comparing base (6338665) to head (78647f9).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #34   +/-   ##
=======================================
  Coverage   48.02%   48.02%           
=======================================
  Files          10       10           
  Lines        1976     1976           
=======================================
  Hits          949      949           
  Misses       1027     1027           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jkobject jkobject merged commit f9670e4 into main May 20, 2026
2 checks passed
@jkobject jkobject deleted the fix/scipy-115-series-indexing branch May 20, 2026 11:50
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.

scDataLoader pre-processing for scprint-2 pretraining

3 participants