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 pint (unit of measure library) #9866

Closed
kszlim opened this issue Jul 13, 2023 · 2 comments
Closed

Support pint (unit of measure library) #9866

kszlim opened this issue Jul 13, 2023 · 2 comments
Labels
enhancement New feature or an improvement of an existing feature

Comments

@kszlim
Copy link
Contributor

kszlim commented Jul 13, 2023

Problem description

It would be great to have support for pint in polars.

Ideally this would avoid a direct dependency on pint but would involve opening the appropriate hooks needed to enable a package similar to pint-pandas.

Relates to:
hgrecco/pint#1811

If you have a good idea for polars extension points and provide the necessary extension points, I perhaps could try to write pint-polars.

@kszlim kszlim added the enhancement New feature or an improvement of an existing feature label Jul 13, 2023
@github-project-automation github-project-automation bot moved this to Untriaged in Backlog Jul 13, 2023
@stinodego stinodego removed this from Backlog Jul 14, 2023
@stinodego
Copy link
Contributor

We do not plan to implement this functionality directly in Polars.

You can implement an integration as a plugin. See the docs:
https://pola-rs.github.io/polars/user-guide/expressions/plugins/

More simple integrations could be done as a custom namespace. See the docs on extending the API:
https://pola-rs.github.io/polars/py-polars/html/reference/api.html

@stinodego stinodego closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
@kszlim
Copy link
Contributor Author

kszlim commented May 25, 2024

I realize this issue is closed, but I think this might require extension datatypes support in polars, do you know if anything like that will be supported similar to https://pandas.pydata.org/docs/reference/api/pandas.api.extensions.register_extension_dtype.html

and/or a subset of this functionality https://pandas.pydata.org/docs/reference/extensions.html

I guess related to #9112

Ideally it could go through a combination of the above and https://pint.readthedocs.io/en/stable/user/numpy.html + taking an approach similar to https://github.com/hgrecco/pint-pandas/blob/master/pint_pandas/pint_array.py

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

No branches or pull requests

2 participants