-
Notifications
You must be signed in to change notification settings - Fork 9
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
Improve coordinate checks #96
Conversation
This is permitted against the Standard, though use of this coordinate in actual data is almost certainly incorrect - it's in the ocean
Tests failed :-( |
@@ -243,13 +243,18 @@ def valid_value(value_element): | |||
|
|||
|
|||
def valid_coords(x): |
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.
Could we make life easier for ourselves in future by documenting this function to our better practices...
Suggest adding a docstring here
stats/dashboard.py
Outdated
if x == 0 and y ==0: | ||
if x == 0 and y == 0: | ||
return False | ||
elif x < -90 or x > 90 or y < -180 or y > 180: |
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.
Also, on the documentation front: might be worth adding a one-line comment to say what this is doing...
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.
See inline comments re documentation :_)
Documentation added. Also changed coordinate naming to clarify that we're talking |
This makes several improvements to better check whether a coordinate is valid.
(0,0)
coordinate is not a correct coordinate, despite being valid against the IATI Standard (it's in the ocean and so almost certainly an incorrect value)Tests have been added.