Skip to content

Add optional Gaussian weights to spatial radius graphs - #1372

Open
Sizerta wants to merge 1 commit into
scverse:mainfrom
Sizerta:feat/gaussian-radius-weights
Open

Sizerta wants to merge 1 commit into
scverse:mainfrom
Sizerta:feat/gaussian-radius-weights

Conversation

@Sizerta

@Sizerta Sizerta commented Dec 6, 2026

Copy link
Copy Markdown

Addresses #1241.

Hii
I added an optional gaussian_sigma to spatial_neighbors_radius(). Say two cells are 5 µm and 15 µm away. With a 30 µm radius, both are neighbors. If you also set gaussian_sigma=10 the closer cell gets a weight of about 0.88 and the farther one about 0.32.

The tests check the weights including for two distinct cells at the same coordinates and confirm that the distance matrix stays the same. All 62 spatial-neighbor tests passed on Linux with Python 3.13.

@read-the-docs-community

Copy link
Copy Markdown
📖 279 files modified

Preview · build overview · Squidpy · built Dec. 6, 2026, 9:30 a.m. UTC

@codecov

codecov Bot commented Dec 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.12%. Comparing base (4fbdb7f) to head (06098b8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1372      +/-   ##
==========================================
+ Coverage   79.10%   79.12%   +0.01%     
==========================================
  Files          63       63              
  Lines        9435     9442       +7     
  Branches     1574     1576       +2     
==========================================
+ Hits         7464     7471       +7     
  Misses       1460     1460              
  Partials      511      511              
Files with missing lines Coverage Δ
src/squidpy/gr/_build.py 90.20% <ø> (ø)
src/squidpy/gr/neighbors.py 92.88% <100.00%> (+0.21%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

1 participant