Function_Warp improvements and unit tests#77
Open
Tiomat85 wants to merge 4 commits intonion-software:masterfrom
Open
Function_Warp improvements and unit tests#77Tiomat85 wants to merge 4 commits intonion-software:masterfrom
Tiomat85 wants to merge 4 commits intonion-software:masterfrom
Conversation
This adds unit tests for function_warp testing various data types and shapes, and validates shape and quick sanity check of data. Additionally extended the function_warp functionality itself to be able to handle data of higher dimensionality than the provided warp map, with it broadcasting the map over the higher dimensions. So as an example if the data provided was of shape (8,4,32,32) and the warp map was (32,32) it broadcasts it applying the warp map to each data dimension correctly for each of the sequence/scan dimensions.
Added is_channel_data to specify whether data has the last dimension as channel (rgb/rgba) and so to correctly validate the warped shape. Missed return type, Adding typing to validate_warp
6d8ace2 to
3158092
Compare
cmeyer
reviewed
Jan 16, 2026
cmeyer
reviewed
Jan 16, 2026
cmeyer
requested changes
Jan 16, 2026
Collaborator
cmeyer
left a comment
There was a problem hiding this comment.
Overall code looks good other than the few nitpicks I put in comments.
cmeyer
reviewed
Jan 16, 2026
Collaborator
|
Btw - I can make all these changes when I merge it, if you want. |
Removed test-test code. Adds function description comment. Utilise better properties to identify if data is channelled.
cmeyer
reviewed
Jan 20, 2026
| def function_warp(data_and_metadata_in: _DataAndMetadataLike, coordinates_in: typing.Sequence[ | ||
| _DataAndMetadataLike], order: int = 1) -> DataAndMetadata.DataAndMetadata: | ||
| def function_warp(data_and_metadata_in: _DataAndMetadataLike, coordinates_in: typing.Sequence[_DataAndMetadataLike], order: int = 1) -> DataAndMetadata.DataAndMetadata: | ||
| """ |
Collaborator
There was a problem hiding this comment.
I'll fix this during the merge, but this is the wrong format for a Python function comment.
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.
This adds unit tests for function_warp testing various data types and shapes, and validates shape and quick sanity check of data. Additionally extended the function_warp functionality itself to be able to handle data of higher dimensionality than the provided warp map, with it broadcasting the map over the higher dimensions. So as an example if the data provided was of shape (8,4,32,32) and the warp map was (32,32) it broadcasts it applying the warp map to each data dimension correctly for each of the sequence/scan dimensions.