Bugs and problems in calculate_niche and in unreleased main.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 598
- Forks
- 121
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 3
Description
This is NOT AI generated, I wrote these one by one. I usually disclose when I do. So I am a bit confident with these but I kept it brief. So please consult your AI assistant for digging where these items are coming from in the code. I wanted to keep it high level here. This will be a ledger also for the changes https://github.com/scverse/squidpy/pull/1284 introduces.
vs v1.8.3 here is the version before we started with this refactor. So these were what was already broken and require breaking changes:
n_hop_weightsshorter than distance pads silently, my proposal raises- Hop rings in cellcharter tried to do BFS via thresholded matrix powers but it was wrong. I wrote a BFS in numba which made the features differ.
- cellcharter GMM seed: now one rng spawned per clusterer
use_repskipped the spatial aggregation entirely. (was in 1.8.3 also, hops were computed and ignored completely, now use_rep should only replace the default pca and shouldn't mean anything else, also matches cellcharter). Now it doesn't skip it and the spatial aggregation is done on the scvi embeddings etc when provided. Which should've been the case alreadyn_componentsused to setGMM(n_components)but also for some reason truncatedadata.obsm[use_rep][:,:n_components]? but whenuse_repwasn't given, we calculatedsc.pp.pcawith non_componentspassing?? I basically decided to taken_pca_componentsandn_clustersand not usen_componentsin the newcalculate_niche_cellcharter. Not technically breaking against released version but it is againstmain(related #831 and #978)maskwas in the docs but was actually unused in all butneighborhoodwhich is crazy and shows we are doing good with this splitting refactor.- duplicate, empty and cross-flavor
resolutionsfailed silently or obscurely. [0.5, 0.5] produced one column instead of two with no warning, a tuple reached scanpy as must be real number, not tuple, and an ndarray as only 0-dimensional arrays...
vs main
- remove prefix removed from calculate_niche_spatialleiden. Never released, so no deprecation
(still in progress of finding the bugs)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the calculate_niche entry points, especially calculate_niche_cellcharter and calculate_niche_spatialleiden, then compare v1.8.3 with main and review PR #1284. Trace the listed behavior around hop weights, BFS rings, GMM seeding, use_rep, component counts, masks, resolutions, and the removed prefix. Done means the reported discrepancies are resolved or explicitly accounted for without silent failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, machine-learning
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100