Skip to content

spatial_neigbours extensibility features and clarification#1147

Open
selmanozleyen wants to merge 68 commits into
scverse:mainfrom
selmanozleyen:feat/spatial_neighbours
Open

spatial_neigbours extensibility features and clarification#1147
selmanozleyen wants to merge 68 commits into
scverse:mainfrom
selmanozleyen:feat/spatial_neighbours

Conversation

@selmanozleyen
Copy link
Copy Markdown
Member

@selmanozleyen selmanozleyen commented Apr 2, 2026

fixes: #1102 and #1047

It's backward compatible and I am curious what the community might bring to this!

  • I clarified the docs on argument precedence
  • Added extensibility features
  • Added tests to ensure the function behaves as written in the docs
  • No breaking changes

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 87.56906% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.08%. Comparing base (093217d) to head (f3eab97).

Files with missing lines Patch % Lines
src/squidpy/gr/_build.py 80.55% 24 Missing and 4 partials ⚠️
src/squidpy/gr/neighbors.py 92.09% 11 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1147      +/-   ##
==========================================
+ Coverage   73.82%   74.08%   +0.26%     
==========================================
  Files          45       46       +1     
  Lines        7013     7185     +172     
  Branches     1188     1193       +5     
==========================================
+ Hits         5177     5323     +146     
- Misses       1349     1371      +22     
- Partials      487      491       +4     
Files with missing lines Coverage Δ
src/squidpy/_docs.py 94.44% <100.00%> (+0.24%) ⬆️
src/squidpy/gr/neighbors.py 92.09% <92.09%> (ø)
src/squidpy/gr/_build.py 81.31% <80.55%> (-7.22%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@selmanozleyen selmanozleyen requested a review from grst April 2, 2026 12:30
@selmanozleyen selmanozleyen requested a review from timtreis April 2, 2026 12:53
@selmanozleyen selmanozleyen self-assigned this Apr 2, 2026
Copy link
Copy Markdown
Contributor

@grst grst left a comment

Choose a reason for hiding this comment

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

Thanks @selmanozleyen, that goes in the right direction. I put up some design questions up for discussion!

Comment thread src/squidpy/gr/_build.py Outdated
Comment thread src/squidpy/gr/_build.py
Comment thread src/squidpy/gr/neighbors.py Outdated
Comment thread src/squidpy/gr/neighbors.py Outdated
Comment thread src/squidpy/gr/neighbors.py Outdated
Comment thread src/squidpy/gr/neighbors.py Outdated
Comment thread src/squidpy/gr/neighbors.py Outdated
Comment thread src/squidpy/gr/neighbors.py Outdated
selmanozleyen and others added 16 commits April 13, 2026 07:46
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/biomejs/pre-commit: v2.4.9 → v2.4.10](biomejs/pre-commit@v2.4.9...v2.4.10)
- [github.com/tox-dev/pyproject-fmt: v2.20.0 → v2.21.0](tox-dev/pyproject-fmt@v2.20.0...v2.21.0)
- [github.com/astral-sh/ruff-pre-commit: v0.15.8 → v0.15.9](astral-sh/ruff-pre-commit@v0.15.8...v0.15.9)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@selmanozleyen selmanozleyen requested a review from timtreis April 13, 2026 22:33
Copy link
Copy Markdown

@shashkat shashkat left a comment

Choose a reason for hiding this comment

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

It looks amazing to me now! Just a few more minor suggestions. I really liked the idea of using specialized Postprocessor classes!

Comment thread src/squidpy/gr/_build.py Outdated
Comment thread src/squidpy/gr/neighbors.py
Comment thread src/squidpy/gr/neighbors.py
Comment thread src/squidpy/gr/neighbors.py Outdated
Comment thread src/squidpy/gr/neighbors.py
@selmanozleyen
Copy link
Copy Markdown
Member Author

These classes would be also ideally serializable so we dont need to rely on a forman under adata.uns which we are scared to change. I will make this as an issue to tackle when the time comes

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.

Documentation for sq.gr.spatial_neighbors() likely needs more clarification about the interplay of arguments

4 participants