-
Notifications
You must be signed in to change notification settings - Fork 32
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
Point to right directory where Hycom data is stored #206
Conversation
Codecov Report
@@ Coverage Diff @@
## master #206 +/- ##
=======================================
Coverage 95.30% 95.30%
=======================================
Files 10 10
Lines 3809 3809
Branches 842 849 +7
=======================================
Hits 3630 3630
Misses 99 99
Partials 80 80
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
Thanks Miguel. @malmans2 can you comment on the data formatting issue? |
I don't think the If that's the case, you have a few options:
|
BTW, I don't think it would work in your case, but I often use the argument |
All good suggestions. I'll work on these and report back. Thanks @malmans2 ! |
updates: - [github.com/psf/black: 21.10b0 → 21.11b1](psf/black@21.10b0...21.11b1) - [github.com/nbQA-dev/nbQA: 1.1.1 → 1.2.1](nbQA-dev/nbQA@1.1.1...1.2.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
updates: - [github.com/nbQA-dev/nbQA: 1.2.1 → 1.2.2](nbQA-dev/nbQA@1.2.1...1.2.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
updates: - [github.com/psf/black: 21.11b1 → 21.12b0](psf/black@21.11b1...21.12b0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Ok, figured out what variable was causing trouble ( @malmans2 Now that we can proceed with this pull request, I need to send you a test dataset (nc) along with its intake file, right? This in order to add a test that it can open and create the ospy object. The location and format (e.g. single zarr file) will likely change, but this should be merged in the next couple of days after the changes are done... |
Yes, but maybe it's better if we move the data in yours (or @asiddi24 @ThomasHaine @renskegelderloos ) onedrive? So basically add your data, move to another onedrive, and change the url here: https://github.com/hainegroup/oceanspy/blob/master/oceanspy/tests/conftest.py |
I agree. For the time being we can move it to my onedrive and figure out later a more stable long-term location. |
…t assertions are correct (dims and coords on HyCOM file are same)
…t assertions are correct (dims and coords on HyCOM file are same)
@malmans2 I am getting this error where during testing urlpath: ./oceanspy/tests/Data/hycom_test.nc could you fixed it on the |
@Mikejmnez Done! |
Awesome! If everything looks good, you can merge now. I figured what was causing trouble with |
Great! Merging... |
Do not merge yet.
There are a couple of things that need fixing:
Data for testing I can provide with a test file with HyCOM data output, and a test for opening / creating the ospy object with such data.
Decode variables. This is an issue that I have been having with this dataset when trying to make simple plots. Right now, the dataset is created with the xarray argument
decode_cf=False
(see intake catalog). As a result, both the time and variables do not have the proper format, e.g. salinity and temperature are not corrected forscale_factor
,offset_value
andmissing_value
. The problem withdecode_cf=True
when creating the dataset (it usually corrects this scale and offset vals) is that it gives an error because thetime
has 'encoding' that xarray doesn't like...setting
decode_cf=True
when creating the dataset yieldsif I manually create the dataset with
decode_cf=False
and then doI get the same error
If we leave
decode_cf=False
, the time variable is an array of floats64I think this error is related to that in pydata/xarray#521
do you have a suggestion for decoding the dataset correctly when reading from intake catalog?
Reading the dataset with
decode_cf=False
and doingds.time
yields