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

Automatic simplification of composed quantity types #16

Open
nicoddemus opened this issue Nov 9, 2018 · 0 comments
Open

Automatic simplification of composed quantity types #16

nicoddemus opened this issue Nov 9, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@nicoddemus
Copy link
Member

Follow up: #15 (comment)

We should discuss how to automatically simplify composing units:

Scalar(1, 'kg') * Scalar(1, 'm3') / Scalar(1, 'm3') should return a scalar with Quantity('kg').

This implies that we should not have simple units in our database which are actually composed: for example, Quantity("kg/m3") should really be handled as Quantity([("kg", 1), ("m3", 1)]) internally.

This simplification process needs to make sure to not throw away all units and get a Quantity("unitless") back, as an important feature is to have units like "m3/m3" or "g/kg" in our systems.

This also implies that scalar.GetValue("kg/m3") will need to parse "kg/m3" properly into the respective exponents [("kg", 1), ("m3", -1)], as "kg/m3" as a single unit will no longer exist.

@fabioz please let me know if I'm missing something.

cc @igortg @kfasolin @tadeu @damianimc @arthursoprana

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

1 participant