-
Notifications
You must be signed in to change notification settings - Fork 12
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
CF units / udunits #26
Comments
We've been working on this in MetPy in our custom Pint registry piece-by-piece for a while, essentially fixing CF unit problems as they arise with user-submitted issues. The overall tracking issue for this is Unidata/MetPy#1362, which may have some relevant discussion. So far, MetPy does the following:
Recently I've implemented a case insensitive registry option, which was in the just-released Pint 0.15, but on MetPy's end we haven't enabled that option yet (waiting for dependabot to bump to Pint 0.15 and to decide if we want to bump our minimum required Pint to 0.15 to guarantee that option or not). Once we have that in place, our next goal is to do some tests against the UDUNITS database to see where we're still failing. I could imaging taking MetPy's registry and copying it to a more centrally available place to help solve this issue. @dopplershift do you have thoughts here? Particularly, this may mean moving MetPy's unit handling to an external library, and I'm not sure where your stance on that would be. |
Long term, I'm not opposed to moving it to something external (Pint's already external). Deduplication of effort is a good thing. I'm also happy to host whatever makes sense. My only caveat here is that separate projects come with maintenance burden. |
I still don't think Other than that, I think we should document extending the default registry used by |
Just in case folks weren't aware, there appear to already be two dedicated CF unit-parsing python engines: "cfunits" and "cf_units". They appear to do almost exactly the same thing, but for some reason there are two of them ¯\_(ツ)_/¯. The latter is under SciTools and appears to be more popular (and unlike the former, it is integrated with I wonder if |
I'd like to make some progress here. It seems like Is it easy to copy over Metpy's registry to cf-xarray? Then we can add more climate-relevant units there. |
is that always a string For |
@dcherian Let me know if I can be of help with this! MetPy's CF unit compatibility has not progressed much since the prior discussion here, so the same caveats with MetPy's registry (case sensitivity, etc.) apply. I'd also be curious to see where |
In the released version of Edit: the |
From http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#units
I guess this is solved but for completeness, here's the error
and |
@jthielen do you have time to make a PR? 😉 you're the expert! |
@dcherian I should be able to do so later this evening! |
Carrying on the
degrees_east
vsdegrees_west
conversation from #20 ...What is the solution here? Should
cf_xarray
define a CF units / UDUNITS registry?The text was updated successfully, but these errors were encountered: