feat: Implement map_coordinates function #49
Closed
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.



Implement map_coordinates function
Problem
I attempted to deploy py360convert to AWS Lambda but encountered a deployment failure due to size limitations. AWS Lambda has a restriction that the total size of the deployment package cannot exceed 250MB. The main issue was that scipy, one of our dependencies, takes up approximately 80MB of space.
Investigation
After investigating scipy's usage in our codebase, I found that we only use two functions from scipy:
map_coordinatesfromscipy.ndimageRotationfromscipy.spatial.transformSolution
To resolve this issue, I have:
map_coordinateswith three interpolation methods:rotation_matrix_fromRodriguesto replace scipy'sRotationTesting
The implementation has been thoroughly tested against scipy's original functions to ensure compatibility and correctness. The tests include:
Benefits
Impact
This change will significantly reduce our package size, making it suitable for AWS Lambda deployment while maintaining all existing functionality.
Additional Notes
Feedback
Please feel free to provide any feedback or raise any concerns you might have. I'm open to suggestions for improvements and would be happy to address any questions or issues you identify.