Repository navigation
fix: support numpy 2, dask 2026 and spatialdata 0.7 - #199
Merged
Merged
Conversation
added 2 commits
November 13, 2026 12:10
- Relax scipy~=1.10.0 to scipy>=1.10.0. scipy 1.10 caps numpy below 1.27 and Python below 3.12, which blocks spatialdata 0.7 and newer installs. - Cap decoupler below 2.0 (dc.run_wsum was removed in 2.0) and xgboost below 3.0 (it cannot unpickle the bundled rf_calib_20220514.pkl). - Update .attrs in place instead of assigning it; spatialdata 0.7 stores dask attrs in an accessor that breaks on assignment. - Only force the legacy dask DataFrame on dask < 2025, which removed it. - Pass an explicit shape to sparse.COO and a column list to dask drop(). - Run the test suite on every Ubuntu Python version in CI, not just 3.10.
objects=[scatter] gives adjustText NaN extents. scipy 1.10 let them into KDTree; scipy >= 1.11 raises "data must be finite", which is why scipy was pinned to ~1.10. Pass the plotted x/y instead, and add a test that draws an annotated comp plot from the MERFISH sample.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets bento-tools install and run on numpy 2, scipy 1.17, dask 2026.1 and spatialdata 0.7. This is needed for a new Bento container image that clears the open Dependabot alerts in YeoLab/containers (pyarrow, distributed, fsspec, urllib3 can't be patched on the current RAPIDS 24.8 / spatialdata 0.2.3 stack).
Fixes #189. Should also help #190 and #177 (the scipy pin forced source builds of scipy 1.10).
Dependency changes
scipy~=1.10.0→scipy>=1.10.0. scipy 1.10 requires numpy <1.27 and Python <3.12; spatialdata 0.7 needs numpy 2.decoupler>=1.7.0,<2.0: decoupler 2.0 removeddc.run_wsum(bt.tl.fe_xia2019 or bt.tl.fe_fazal2019 error #189).xgboost>=2.0.3,<3.0: xgboost 3 can't unpickle the bundledrf_calib_20220514.pkl("Invalid serialization file").Code changes
bento/_utils.py,bento/tools/_shape_features.py: update dask.attrsin place instead of assigning a new object. spatialdata 0.7 stores attrs in an accessor and assignment raised'DataFrame' object has no attribute '_attrs'.bento/_utils.py: only setdataframe.query-planning: Falseon dask < 2025. dask 2025.1 removed the legacy DataFrame and raises on import with that setting (seen in worker processes).bento/tools/_colocation.py: passshapetosparse.COO; current sparse requires it.bento/tools/_flux.py:drop(columns=list(old_cols)); dask-expr evaluates the truthiness of a pandasIndex.bento/plotting/_multidimensional.py: pass the plotted x/y toadjust_textinstead ofobjects=[scatter]. That path gives adjustText NaN extents; scipy 1.10 let them intoKDTree, scipy >= 1.11 raises "data must be finite". This is the "adjusttext kdtree compat" problem the scipy pin was added for.tests/test_ut.py: checkdd.DataFrameinstead ofdd.core.DataFrame, which no longer exists.tests/test_composition.py: newtest_comp_plot_annotatedraws an annotatedbt.pl.compplot from the MERFISH sample. It fails with the KDTree error without theadjust_textfix.Verification
flake8 --select=E9,F63,F7,F82: 0 errors..attrs.updateworks on the legacy dask attrs dict too).No version bump; release separately (e.g. 2.1.5).