-
Notifications
You must be signed in to change notification settings - Fork 11
Function_Warp improvements and unit tests #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall code looks good other than the few nitpicks I put in comments.
|
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.
| 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: | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix this during the merge, but this is the wrong format for a Python function comment.
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.