Skip to content

feat: stalign api and landmark alignment - #1195

Open
selmanozleyen wants to merge 17 commits into
scverse:mainfrom
selmanozleyen:feat/experimental-fit-core
Open

selmanozleyen wants to merge 17 commits into
scverse:mainfrom
selmanozleyen:feat/experimental-fit-core

Conversation

@selmanozleyen

Copy link
Copy Markdown
Member

Continuation of #1162

@codecov

codecov Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 36.15935% with 625 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.93%. Comparing base (dc82c73) to head (6916fd5).

Files with missing lines Patch % Lines
...idpy/experimental/tl/_align/_stalign_impl/_core.py 0.00% 215 Missing ⚠️
src/squidpy/experimental/tl/_align/_stalign.py 31.47% 134 Missing and 1 partial ⚠️
src/squidpy/experimental/im/_rasterize_points.py 11.45% 84 Missing and 1 partial ⚠️
src/squidpy/experimental/tl/_align/_api.py 55.15% 61 Missing and 13 partials ⚠️
...y/experimental/tl/_align/_stalign_impl/_helpers.py 0.00% 69 Missing ⚠️
src/squidpy/experimental/tl/_align/_io.py 36.50% 37 Missing and 3 partials ⚠️
src/squidpy/experimental/tl/_align/_landmark.py 87.09% 2 Missing and 2 partials ⚠️
src/squidpy/_validators.py 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1195      +/-   ##
==========================================
- Coverage   78.95%   74.93%   -4.03%     
==========================================
  Files          63       70       +7     
  Lines        9439    10417     +978     
  Branches     1574     1703     +129     
==========================================
+ Hits         7453     7806     +353     
- Misses       1469     2073     +604     
- Partials      517      538      +21     
Files with missing lines Coverage Δ
src/squidpy/types.py 100.00% <100.00%> (ø)
src/squidpy/_validators.py 87.23% <70.00%> (-2.18%) ⬇️
src/squidpy/experimental/tl/_align/_landmark.py 87.09% <87.09%> (ø)
src/squidpy/experimental/tl/_align/_io.py 36.50% <36.50%> (ø)
...y/experimental/tl/_align/_stalign_impl/_helpers.py 0.00% <0.00%> (ø)
src/squidpy/experimental/tl/_align/_api.py 55.15% <55.15%> (ø)
src/squidpy/experimental/im/_rasterize_points.py 11.45% <11.45%> (ø)
src/squidpy/experimental/tl/_align/_stalign.py 31.47% <31.47%> (ø)
...idpy/experimental/tl/_align/_stalign_impl/_core.py 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/squidpy/experimental/tl/__init__.py Outdated
Comment thread src/squidpy/experimental/tl/_align/_io.py Outdated
radius = int(np.ceil(float(np.max(blur_values)) * 4.0))
denom = 2.0 * (dx * blur_values * 2.0) ** 2

for x_i, y_i in zip(x, y, strict=False):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How many points do we have? Should probably rasterize

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

wdym? This is the function for rasterization?

Comment thread src/squidpy/experimental/methods/align_samples/_stalign_impl/_core.py Outdated
Comment thread src/squidpy/experimental/tl/_align/_io.py Outdated
Comment thread pyproject.toml Outdated
@selmanozleyen selmanozleyen changed the title feat: stalign with a fit apply pattern. Also foundation for imputation feat: stalign with a fit apply pattern. Jun 20, 2026
@selmanozleyen selmanozleyen self-assigned this Jun 20, 2026
Comment thread src/squidpy/experimental/methods/align_landmarks/_landmark.py Outdated
Comment thread src/squidpy/experimental/methods/align_landmarks/_landmark.py Outdated
@selmanozleyen selmanozleyen changed the title feat: stalign with a fit apply pattern. feat: stalign api and landmark alignment Aug 11, 2026
@selmanozleyen
selmanozleyen requested a review from timtreis August 22, 2026 14:31
@selmanozleyen
selmanozleyen changed the base branch from main to feat/rng-seeding August 22, 2026 21:02
@selmanozleyen
selmanozleyen changed the base branch from feat/rng-seeding to main August 22, 2026 21:03
Comment thread src/squidpy/experimental/tl/_align/_api.py Outdated
@selmanozleyen
selmanozleyen changed the base branch from main to feat/api-docs-restructure August 30, 2026 21:33
@selmanozleyen
selmanozleyen force-pushed the feat/api-docs-restructure branch 3 times, most recently from 3c54e85 to 7b33737 Compare August 30, 2026 23:20
@selmanozleyen
selmanozleyen force-pushed the feat/api-docs-restructure branch 3 times, most recently from d594650 to 11d8760 Compare September 25, 2026 16:05
@selmanozleyen
selmanozleyen force-pushed the feat/experimental-fit-core branch from 69dae69 to 76d69a7 Compare September 25, 2026 16:05
@selmanozleyen
selmanozleyen force-pushed the feat/api-docs-restructure branch from 11d8760 to e5f0d6b Compare September 25, 2026 19:42
@selmanozleyen
selmanozleyen force-pushed the feat/experimental-fit-core branch from 8e433f8 to f1462a8 Compare October 9, 2026 23:54
@selmanozleyen
selmanozleyen deleted the branch scverse:feat/api-docs-restructure October 27, 2026 16:46
@selmanozleyen selmanozleyen reopened this Oct 27, 2026
@selmanozleyen
selmanozleyen changed the base branch from feat/api-docs-restructure to feat/enum-to-literal October 27, 2026 16:54
@selmanozleyen
selmanozleyen deleted the branch scverse:feat/enum-to-literal October 27, 2026 17:19
@selmanozleyen selmanozleyen reopened this Oct 27, 2026
@selmanozleyen
selmanozleyen changed the base branch from feat/enum-to-literal to main October 27, 2026 17:20
…direction

- landmarks from shapes elements are read in their coordinate system, the
  frame the fit is registered onto, not the element's intrinsic one
- key_added with shapes-element landmarks is refused up front, and the
  refusal that suggested it now suggests table_key + key_added
- the volume path's initial_affine maps the volume onto the section, the
  reverse of the 2D paths; the docstrings say so
- transform refuses a coordinate_system the fit was not made in
spatialdata is a hard dependency, so the importorskips never skipped; jax
stays optional, so its skip stays.
rasterize_points takes only sdata positionally; the alignment functions
keep their reference and query positional. The jitted solver loop takes
only its first argument positionally.
… share the raster fit path, trim repeated docstrings
Most of these had a second paragraph arguing for a design decision rather than
telling a reader anything: why the axes are read off the transformation instead
of taken as an argument, why JAX is imported lazily, why the frame check exists
rather than being applied silently, why one flag beats two spellings. The fit
subclasses each restated that they are a StalignFit and listed what they
inherit, which the class line already says.

What a caller cannot recover from the code stays: landmark units and row-order
matching, the obsm frame rule, the bilinear-vs-nearest quantisation, the
mass-conserving blur, the stop-gradient on the contrast M step, the upstream
velocity-axis divergence, and why not jnp.atleast_3d.

lddmm also repeated _lddmm_run's loop-fusion note and kept prose between
Parameters and Returns, where numpydoc does not expect it. One sentence in
_api.py's module docstring had lost its grammar.
@selmanozleyen
selmanozleyen force-pushed the feat/experimental-fit-core branch from 6386896 to 6916fd5 Compare October 27, 2026 17:22
The volume fit never passes landmarks, so the point term is zero and the
value was dead; it existed only because `lddmm` required the argument.
`sigmaP` is now optional there and checked only when points are given.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants