-
Notifications
You must be signed in to change notification settings - Fork 73
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 more add_location tests #1000
Conversation
…& lon values that were being interpolated to nan
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## dev #1000 +/- ##
===========================================
+ Coverage 79.63% 92.10% +12.47%
===========================================
Files 66 3 -63
Lines 5745 152 -5593
===========================================
- Hits 4575 140 -4435
+ Misses 1170 12 -1158
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 63 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Ok, done. I decided to use xarray interpolate in the test rather than |
assert not ds_test["longitude"].isnull().any() | ||
assert not ds_test["latitude"].isnull().any() |
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.
These will have to change if we do not extrapolate the first position.
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 removed these tests. Now that nan
lon & lat values may be valid, I can't think of a general, useful test involving nan's. But I think the other tests already cover all ground: lon & lat contain the ping_time
dimension (and no other dim), and the values match against interpolated values (that may include nan's) or fixed-point broadcasting. BTW, I modified the comparison of interpolated values to account for nan's.
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.
@emiliom : I am done reviewing this. My comments are mostly small and some completely textual. The only exception is the one involving extrapolation. Let me know what you think on that.
Co-authored-by: Wu-Jung Lee <leewujung@gmail.com>
Co-authored-by: Wu-Jung Lee <leewujung@gmail.com>
Thanks! I'll remove the extrapolation and update the tests to reflect that change. |
…d variable names in that test, for clarity
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.
Looks good. Thanks @emiliom. Please feel free to merge this!
Addresses all but one of the tests specified in #769.
test_consolidate_integration.py::test_add_location
now includes two additional sample raw files, including an AZFP file. The test files now encompass:update_location
to first add a fixed-location single pointThe tests in this PR currently include:
latitude
andlongitude
variablestime
variablesnmea_sentence="GGA"
for the EK60 dataset with Platform lat-lon dataValueError
longitude
orlatitude
value is nulllongitude
andlatitude
variables have a single dimension,ping_time
add_latlon
function match up with values interpolated in the testupdate_platform
Remaining test: Checking the added (interpolated) lat/lon values between theadd_latlon
function and directly computed fromscipy.interpolate
Also, see #769 (comment) for findings about
time1
vstime3
dimensions associated withwater_level
, and for the outcome of the first interpolatedlatitude
andlongitude
value beingnan
. In this PR I modifiedadd_location
toset the first value of interpolateduse thelatitude
andlongitude
equal to the second valuescipy.interpolate.interp1d
fill_value="extrapolate"
scheme. Let's discuss this.