Skip to content
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

support for units with pint #3594

Open
16 of 18 tasks
keewis opened this issue Dec 4, 2019 · 7 comments
Open
16 of 18 tasks

support for units with pint #3594

keewis opened this issue Dec 4, 2019 · 7 comments
Labels
enhancement topic-arrays related to flexible array support

Comments

@keewis
Copy link
Collaborator

keewis commented Dec 4, 2019

pint's implementation of NEP-18 (see hgrecco/pint#905) is close enough so we can finally start working on the pint support (i.e. make the integration tests pass). This would be the list of tasks to get there:

@dcherian
Copy link
Contributor

dcherian commented Dec 4, 2019

Thanks for leading this effort @keewis.

I would start with the lowest-level operations like the constructors and align, concat, merge. These are called in many of the other functions so fixing these is a prerequisite for getting the rest working. I've looked at align, concat & merge recently so can help if you need to chat about confusing error messages.

indexes strip units

What does this mean? You can't have units in a IndexVariable?

@keewis
Copy link
Collaborator Author

keewis commented Dec 4, 2019

What does this mean? You can't have units in a IndexVariable?

yes, we had that discussion from #525 (comment) on. Short version: pd.Index converts using np.asarray and support for units probably requires #1603.

@amcnicho
Copy link
Contributor

I will try to figure out the reason for each of these test failures, but I'd appreciate help.

Would #3643 be the best place to offer contributions at this point, or somewhere else?

@keewis
Copy link
Collaborator Author

keewis commented Mar 11, 2020

I think issues related to DataArray + pint should be in #3643, for everything else you can use this issue or new issues / pull requests.

If you want to, I'd appreciate someone reviewing the tests in test_units.py since I don't think anyone other than me thoroughly looked at all of them. You could also investigate / fix the Dataset issues, investigate the reason for the UnitStrippedWarnings or start writing documentation on how to use pint in combination with xarray.

@dcherian dcherian mentioned this issue Mar 19, 2020
13 tasks
@TomNicholas TomNicholas added the topic-arrays related to flexible array support label Apr 6, 2020
@keewis keewis mentioned this issue Apr 15, 2020
3 tasks
@dcherian dcherian mentioned this issue Jun 23, 2020
23 tasks
@keewis
Copy link
Collaborator Author

keewis commented Jul 2, 2020

so, except from the major issues mentioned above which we won't be able to fix in the near future (but there will probably be workarounds in pint-xarray) we only have three minor issues: nanprod, support for per variable fill values and the repr (#2773).

I don't think nanprod and the fill values are particularly urgent, so if we get support for the repr (maybe using some sort of hook that a library like pint-xarray can then use to properly format the duckarray) and put together the documentation page, we could include this in the 0.16 release.

Edit: I guess the release is already big enough so I don't really mind waiting on the next release, but this is really close.

@dcherian
Copy link
Contributor

@keewis Shall we close this? It seems the only outstanding one is nanprod with quantities. Which sort of indicates that we've made the necessary big changes.

@keewis
Copy link
Collaborator Author

keewis commented Aug 3, 2022

#6873 might fix the nanprod issue, and we have a separate issue for the last big change left (#3950, which is not really limited to quantities) so I agree that we should be able to close this with #6873.

We might want to open a new issue to get the known issues to work, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement topic-arrays related to flexible array support
Projects
None yet
Development

No branches or pull requests

4 participants