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

Listing possible units based on dimensionality #1939

Open
DNIIBOY opened this issue Feb 24, 2024 · 0 comments
Open

Listing possible units based on dimensionality #1939

DNIIBOY opened this issue Feb 24, 2024 · 0 comments

Comments

@DNIIBOY
Copy link

DNIIBOY commented Feb 24, 2024

Is there a way to list a subset of defined units based on their dimensionality?
I am creating an app where i would like to show users the possible units to choose from, when entering a value.
For this i would need to list the possible units for each dimensionality.
Is this something i can do with pint?

Example:

ureg = UnitRegistry()
dimensionality= ureg.get_dimensionality("[length]")

length_units = ureg.get_units(dimensionality=dimensionality)  # <- I need something like this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant