Open tbody-cfs opened 1 year ago
Hi,
Thanks for making a great project — I've always wanted xarray to support pint units. Dropping here in case it's useful — I often need to use functions written for float or numpy arrays. To handle units I'd use ureg.wraps
and to handle xarray
s I'd use apply_ufunc
. I've looked at the inner workings of ureg.wraps
and tried to approximate it, adding in apply_ufunc
.
If this seems helpful, I could tidy it up. If you've got a better way of doing this, I'd be very happy to hear :)
This might be a duplicate of https://github.com/xarray-contrib/pint-xarray/pull/143.
thanks for the PR and sorry for the delay, @tbody-cfs. This is definitely something on our roadmap, but unfortunately I didn't have too much time to work on this in the past few months.
Indeed, this PR is a duplicate of #143, which as an initial version should be very close. However, I fear we didn't try using too much, yet, so the API might not be as useful as we thought it would be (and of course there might be bugs). If you want to help moving that forward, I think it would be great to just experiment with expects
and report your findings in #143 (and post any questions / feedback you might have).
pre-commit run --all-files
whats-new.rst
api.rst