Closed LucaMarconato closed 7 months ago
Please check the docstring of the _decompose_transformation()
for a detailed explanation. Please let me know if you need more use cases or a different type of representation (like combining "shear" and "rotation" into a unique affine matrix, or forcing "shear" having diagonal values all 1 done; things like these).
I added some tests, but at each run the function is also doing some additional lightweight checks before returning, so if there are bugs we catch them.
Merging #327 (c0bca76) into main (b25ec12) will decrease coverage by
0.73%
. Report is 1 commits behind head on main. The diff coverage is100.00%
.:exclamation: Current head c0bca76 differs from pull request most recent head 44f80bf. Consider uploading reports for the commit 44f80bf to get more accurate results
Please also have a look at the much simpler _decompose_affine_into_linear_and_translation()
. For the new transformations refactoring I will need the new function of this PR because I want to separate operations on the coordinates and operations on the raw data that needs to be committed. But for plotting this PR may be overkill (or I may need to make a simpler function).
@timtreis I made some changes, I added the parameter simple_decomposition
to _decompose_transformation()
and I believe that this is what you need (not _decompose_affine_into_linear_and_translation()). Thought about it and the original decomposition (
simple_decomposition=False`) is probably not useful for matplotlib plotting.
Other PR have more priorities for code review. Gonna merge since the PR is thoroughly tested and since I am going to test it manually again when refactoring the transformations using this code. CC @kevinyamauchi @giovp
Helper function for @timtreis as asked in https://github.com/scverse/spatialdata/issues/314.