-
Notifications
You must be signed in to change notification settings - Fork 474
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
Creating a pint-xarray package/module #849
Comments
Sounds like a really good plan to me. I like extension packages as they allow faster iteration of a core idea without perturbing the more stable main package and a more frequent release cycle. I would really support it. @andrewgsavage can give you a good overview about the lessons we have learned with I also think that it would be good that we get #764 right as it would affect all derived packages and we need to make sure that such big change is for the best of all the ecosystem. |
This is something we have been needing for some time in pytroll/satpy. We'll be following this with attention. |
We originally had pint-pandas as part of pint, but decided to split it out
as a separate module. We took the tests with it. I'd suggest keeping most
tests with the code they test so you can get Travis checking PRs easily.
Pandas has template tests for extension arrays to ensure methods/properties
etc behave correctly. We used the Cyberpandas extensionarrays and these
tests as a starting point.
You may need to make some changes to xarray or pint as you go. It was a bit
irritating pointing tests to branches or commits, especially for pandas as
it took ages to build each test.
…On Wed, 28 Aug 2019, 17:01 Martin Raspaud, ***@***.***> wrote:
This is something we have been needing for some time in pytroll/satpy.
We'll be following this with attention.
Also, you may be aware of this, but the metpy package seems to implement
some unit accessors:
https://unidata.github.io/MetPy/latest/tutorials/xarray_tutorial.html#units
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#849?email_source=notifications&email_token=ADEMLEETNVJQD7T5TCC5VMTQGYWG3A5CNFSM4IPG5LFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5KHZRY#issuecomment-525630663>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADEMLEAP6NZHUW75OEG2RCTQGYWG3ANCNFSM4IPG5LFA>
.
|
One difference with xarray vs pandas is that with xarray we NumPy's array interface instead of inventing our own. So the basic functionality (propagation of units) should work fine without the xarray-pint module, which is only needed for extra unit specific methods. |
I would like to ask what is the current status of the pint-xarray package. In the NumPy Support notebook of the docs ( |
You can see the current status for I don't think there has been any effort to create a |
Unfortunately, while I had hoped to have put together a As @keewis says, this DataArray
Dataset
(this may be modified as things change on xarray's and pint's end, especially involving Dask arrays (xref #883)) |
Also, with imminent development in mind, @hgrecco would you want to have the main repository for |
I would be great to have such package, you can host it in your own account and then we can tranfer it. If your prefer, I can create a repo in my account and give your full access. Regarding the organization, I would be happy to start discussing something in that direction. I actually already did something like that when I transferred pyvisa to its own organization. But maybe it would be nice to have some people from different open source projects such as MetPy and others using Pint to give an opinion about this. |
Thank you all for the comprehensive status update. I will keep a look here to check the progress of the pint-xarray package, but it looks like the current situation is better than what I expected, and thus I will start testing it it is already good enough for our projects. |
1042: Update expected initial release date for pint-xarray r=hgrecco a=jthielen Just a quick update to the docs delaying the expected release for pint-xarray, since I haven't gotten around to it yet, and unfortunately likely won't get the chance until April. (Though, if someone wanted to take the ideas in #849 and get something put together earlier, that would be great too!) xref #849 - ~~Closes # (insert issue number)~~ - ~~Executed ``black -t py36 . && isort -rc . && flake8`` with no errors~~ - ~~The change is fully covered by automated unit tests~~ - [x] Documented in docs/ as appropriate - ~~Added an entry to the CHANGES file~~ Co-authored-by: Jon Thielen <[email protected]>
I'm very keen for pint-xarray integration, so I started working on the pint-xarray package here. It's not got that much in it yet but you should be able to use I would welcome any help, and @hgrecco @jthielen @keewis do you want me to add you as maintainers? With regards to the eventual API I was thinking @shoyer that this might be a good fit for using an entrypoint? If I also think that there should be a pint project to group the different repos now. It helps from a versioning, maintaining, and clarity standpoint, as well as just looking a bit more professional 💪 |
@TomNicholas That all sounds good, and yes, it would be great to be added as a maintainer on pint-xarray! |
With @TomNicholas having set up |
Based on conversations with @shoyer on pydata/xarray#525, I'm thinking that the best way forward to fully integrate pint with xarray might be the creation of a "pint-xarray" module similar to "pint-pandas". It would likely house DataArray and Dataset accessor interfaces to allow for easy unit access, unit conversion, and IO integration within xarray. These accessor classes would be designed in such a way so as to provide easy mixins for downstream libraries like metpy that have their own accessors. I think tests of xarray functionality with wrapping pint would likely stay in xarray (as in pydata/xarray#3238).
@hgrecco Would this be something you would be willing to have and support here? I'd be willing to help maintain it (it would be the first package I would do so with, but thankfully it should be a fairly simple package).
Also, cc @andrewgsavage, @keewis, and @dopplershift, who I would think would also have thoughts on whether or not this is the best way forward for this integration.
xref #845, #764, #479, pydata/xarray#525, pydata/xarray#3238
The text was updated successfully, but these errors were encountered: