Improve affine decomposition - #1186
Open
LucaMarconato wants to merge 1 commit into
Open
Conversation
LucaMarconato
changed the base branch from
main
to
fix/bounding-box-query-axes-dependent-results
August 20, 2026 13:07
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1186 +/- ##
==========================================
- Coverage 92.41% 92.40% -0.02%
==========================================
Files 52 52
Lines 7874 7869 -5
==========================================
- Hits 7277 7271 -6
- Misses 597 598 +1
🚀 New features to boost your workflow:
|
Member
Author
|
@Tomaz-Vieira can you please review? Also, the GitHub diff view is not the most useful for this PR since the code is now split into functions. I suggest to use a standard diff view, so that most of the code is easily shown as untouched. |
LucaMarconato
changed the base branch from
fix/bounding-box-query-axes-dependent-results
to
main
August 20, 2026 13:27
ported from transfo: supporting z and c; improved order of returned transformations also: split into simple/full; changed return type to tuples; supporting permutation of input/output axes for the transformation
LucaMarconato
force-pushed
the
improve/affine-decomposition
branch
from
August 20, 2026 13:28
ed6769d to
2f10ecd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude generated PR description, manually verified
Port the RQ-based decomposition algorithm from
Spatial-Innovation-Team/transfoto replace the old 2D-only, theta-based rotation logic in
_decompose_transformation. The new algorithm is dimension-generic, warns onill-conditioned linear parts, and encodes the reflection as a single
axis flip instead of an arbitrary diagonal matrix.
Drop the spatialdata-specific restrictions that no longer apply: the
zaxisand the
cchannel are now decomposed like any other axis, and axes areallowed to come out in a different order between input and output (checked
by axis set rather than exact tuple order).
Split
_decompose_transformationinto_decompose_transformation_simpleand_decompose_transformation_full, each returning a fixed-size tuple of thecomponent transformations instead of a
Sequence, so callers get aconcretely-typed tuple (2 vs. 5 components) rather than a
Union.Reorganize the tests into
TestSimpleDecomposition/TestFullDecompositionclasses, consolidating round-trip coverage into a single
DECOMPOSE_TRANSFORMATION_CASEStable (with descriptive ids) shared by bothclasses, and keeping only the checks that can't be expressed as a
matrix-in/reconstructed-matrix-out case (warnings, component types/arity,
algorithmic invariants).