feat: Implement map_coordinates function#49
Closed
feelgom wants to merge 3 commits intosunset1995:masterfrom
Closed
feat: Implement map_coordinates function#49feelgom wants to merge 3 commits intosunset1995:masterfrom
feelgom wants to merge 3 commits intosunset1995:masterfrom
Conversation
Implement map_coordinates function with nearest, linear, and cubic interpolation methods; add corresponding tests for validation.
- Added scipy dependency to pyproject.toml for development. - Refactored _cubic_kernel and rotation_matrix_fromRodrigues functions for better readability. - Updated map_coordinates function signature to accept tuple coordinates. - Cleaned up test_utils.py by removing unnecessary try-except for scipy import.
…nges - Updated Poetry version from 1.8.5 to 2.1.3. - Added 'groups' attribute for several packages to categorize them as 'dev'. - Adjusted 'markers' for compatibility with specific Python versions. - Updated content hash and lock version in metadata.
Collaborator
|
Hi @feelgom! Why close this PR? |
Contributor
Author
|
I'm working on implementing a function that produces exactly the same results as scipy's map_coordinates function, specifically focusing on the cubic interpolation method. However, the test cases for map_coordinates_cubic consistently fail.
Now I'm working on https://github.com/feelgom/py360convert/tree/andrew/replace_scipy |
Collaborator
|
sounds good! feel free to re-open when ready! |
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.



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.