-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add enhanced support for geographic coordinates #181
Merged
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
9f9262b
Add latlon option to inside() function
santisoler 81530a2
Fix wrong coordinate variable in latlon_continuity
santisoler 94a5e8e
Add test case around zero meridian
santisoler db1e816
Remove unwrapping from latlon_continuity function
santisoler a43b415
Refactor latlon_continuity function
santisoler 836fef2
Add tests for latlon_continuity
santisoler eea0d9b
Add latlon_continuity to doc and __init__.py
santisoler 457f192
Improve docstring of latlon_continuity
santisoler 11f691f
Add example for latlon_continuity
santisoler aa2ce52
Add example to inside function with latlon=True
santisoler 123607e
Fix typo in docstring
santisoler ed9410f
Make latlon_continuity() a private function
santisoler bdbc6dc
Rewrite _latlon_continuity function
santisoler 49d96cd
Remove latlon_continuity from docs index
santisoler 0fc747f
Remove _latlon_continuity from __init__.py
santisoler 5fb3c0e
Add case where region goes around the globe
santisoler 88dab93
Add more test around the globe
santisoler d0b83e5
Add test around the poles
santisoler 2327294
Add latlon_continuity test when w == e
santisoler 7ad90e9
Improve check for around the globe region
santisoler 4855882
Add test for two rounds to the globe
santisoler d3b86b2
Add latlon option to check_region()
santisoler 7493f1d
Change the way geographic region is checked
santisoler 7e527e9
Add function to check geographic coordinates
santisoler 9b1021d
Replace all() for any()
santisoler 0c3a067
Modify _latlon_continuity function
santisoler 76fc0b9
Add docstring for latlon on check_region
santisoler b6dfa90
Add s > n error for both latlon True or False
santisoler 98cf7fc
Extended tests for check_region when latlon=True
santisoler 00fddb2
Update tests for the new code
santisoler 7c5b9c3
Add test in case abs(e - w) > 360
santisoler 5b90b51
Improve styling of tests
santisoler 75077c9
Merge branch 'master' into geographic
santisoler 25de366
Make latlon_continuity public
santisoler 956b083
Refactor latlon_continuity to improve readability
santisoler f7ad34d
Add checks inside latlon_continuity
santisoler 4f8c502
Replace .any() with np.any()
santisoler 1c1a92d
Merge branch 'master' into geographic
santisoler 157ce34
Merge branch 'master' into geographic
santisoler 9dc288a
Rename latlon_continuity to longitude_continuity
santisoler 3c45a6c
Rename latlon to geographic
santisoler 9906366
Remove longitude_continuity from inside function
santisoler 130c96e
Fix order of returns on docstring
santisoler 614b9e2
Fix reference to longitude_continuity function
santisoler 3ac3773
Improve comment on example
santisoler 5235234
Improve longitude_continuity docstring
santisoler 55e58b7
Merge branch 'master' into geographic
santisoler e2e4b7b
Merge branch 'master' into geographic
santisoler fdd1748
Double bracketing for intervals in docstring
santisoler 7296f84
Merge branch 'master' into geographic
santisoler 3e1f495
Remove trailing space on empty line
santisoler ca1f440
Add missing ` on docstring
santisoler d822d50
Add test function for invalid geographic region
santisoler 9f3fd5f
Add test func for invalid geographic coordinates
santisoler a16b01c
Remove importing unused inside on test_coordinates
santisoler 4108c6b
Merge branch 'master' into geographic
leouieda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
This might be problematic since the region might be very close but not exactly 360. Might lead to slightly off coordinates that could give errors down the line. Is there any way to avoid this?
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've added this
all_globe
check in case you passw, e = 0, 360
as region boundaries.If we omit the
all_globe
, the algorithm will returnw, e = 0, 0
, which is problematic.The slightly off coordinates you mention will be within an error of 1e-5 (according to
numpy.allclose
).One simple hack would be to lower down this error, but I don't know if it's ideal.
What do you think?
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.
My thinking for this is "do we need to do this check?". If this is not necessary, then we could skip the check and avoid the issues with precision.