Neighbors: _connected_components is only set for sparse data
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 779
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 27
Description
self._connected_components is only set in an if branch, but elsewhere read unconditionally:
also the code is duplicated later and should be DRYed
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 in scanpy/neighbors/init.py at the referenced sections around lines 562-566 and 737-741. Trace where self._connected_components is assigned and read for sparse and non-sparse data, then consolidate the duplicated logic. Done means the attribute is safely available in every relevant path without duplicating the implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100