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

Optimise unit conversion and ops #72

Open
znicholls opened this issue Jul 3, 2020 · 6 comments
Open

Optimise unit conversion and ops #72

znicholls opened this issue Jul 3, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@znicholls
Copy link
Collaborator

At the moment our unit conversion is fairly custom. It also relies on pandas in the ops, which is probably pretty slow given you have to make the dataframe before operating on it. Given we now have ScmRun, which relies on xarray, there is probably going to be a better way. There is much talk of integrating Pint with xarray so maybe that's the best route. From what I can tell, the jumping off points/relevant issues are: pydata/xarray#525 and pydata/xarray#3594

@znicholls
Copy link
Collaborator Author

@lewisjared fyi

@znicholls
Copy link
Collaborator Author

@rgieseke and @swillner I have no idea if this is of interest to you, but just fyi

@znicholls znicholls added the enhancement New feature or request label Jul 3, 2020
@znicholls
Copy link
Collaborator Author

We might even be able to skip straight to using pint in our internal handling thanks to pydata/xarray#3975

@znicholls znicholls changed the title Unit conversion and ops Optimise unit conversion and ops Jul 13, 2020
@znicholls
Copy link
Collaborator Author

znicholls commented May 6, 2023

Now that we've swapped back to storing internals as dataframes, the xarray route probably isn't the right one. (This is very cool though for other projects https://xarray.dev/blog/introducing-pint-xarray, and xarray's unit aware support for many common operations does make me wonder if we've attached our horse to the wrong cart by using pandas as our backend)

@lewisjared
Copy link
Collaborator

That is what PRIMAP2 uses for unit handling. We shouldn't feel too bad as that didn't exist when we were playing with it

@znicholls
Copy link
Collaborator Author

Ye but I remember we switched back to pandas for our internals for a different reason. I think it was the sparsity issue from memory...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants