-
Notifications
You must be signed in to change notification settings - Fork 77
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 support to specify key type and always decode level as float #210
Conversation
Sorry @alexamici I missed this PR. It looks good to me, but it would look even better if there were some tests, if I may be so cheeky :) |
I'm now hesitant to add this feature to cfgrib as it really looks like a lower level functionality. @shahramn do you have a way to specify the target data type in the key, like |
We already have a way of passing in the type information. For example:
|
Codecov Report
@@ Coverage Diff @@
## stable/0.9.9.x #210 +/- ##
==================================================
- Coverage 92.29% 92.20% -0.09%
==================================================
Files 25 25
Lines 1714 1720 +6
Branches 201 202 +1
==================================================
+ Hits 1582 1586 +4
- Misses 110 111 +1
- Partials 22 23 +1
Continue to review full report at Codecov.
|
@iainrussell I added the tests for the generic functionality. This is ready to merge for me. |
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 to me, great that eccodes has such a nice interface to allow this to work so conveniently!
With this change you can optionally specify the key type when using
Message.__getitem__
like:Then the
level
key is decoded asfloat
in order to close #195 . Note that this is a significant user-visible change but I think it is the best default.