-
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
Improving get_field
of nomenclature
module
#32
Comments
get_field
of nomenclature
moduleget_field
of nomenclature
module
This sounds good @LSaffin, yes good idea
Ok, I don't have a strong preference on this. If you think that's better then let's do that.
Yes, that sounds alright. I would like to be able to keep calling
Great!
Only that
I thought |
That all sounds good. I'll put together a pull request with the changes for you to approve. That sounds like a good reason to go with |
* Moved unit conversion to separate module * Move get_field to top level and change to get_field_by_name and get_field_by_cf_standard_name in nomenclature.py * Allow get_field to be called directly with a CF standard name (change argument from field_name to name to reflect this generalisation) * Added a test for unit conversion * Use the nomenclature names for fixing the current JOANNE names. Keeping compatibility for when they are updated * Change Exception when units are absent from dataarray to KeyError and add test to check it is raised
Yes, definitely. We might want to start using it if we find we need more functionality that iris gives. I'll close this now since I've just merged #33. Thanks again for this |
The changes I would make are
get_field
in other functions it would be better to use it fromeurec4a_environment
rather thaneurec4a_environment.nomenclature
get_field_by_name
) and have the functionget_field
in the top level module call that function and the function for unit conversion. Then other functions are calling this top levelget_field
and you can add other functionality that might not be related to nomenclature to it.I can make these changes once your pull request is merged if they sound OK to you. Other questions I had:
Did you find any important differences between cf_units and cfunits? As far as I could tell they were basically the same but cf_units was more active and better documented.
Was using iris considered at all? This already does the unit checking as well as coordinate checking and better support for CF standard names (although the CF standard naming could be a limitation).
The text was updated successfully, but these errors were encountered: