-
Notifications
You must be signed in to change notification settings - Fork 3
Unit conversion methods and their names #19
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
Comments
My current thoughts:
Should a unit conversion function that returns the value exist, and what should it be named? Yes. |
so make it |
Then does it convert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's discussion starting #9 (comment) about unit conversion and the methods.
in short:
What should the name of a unit conversion function that returns a quantity be?
Potential names:
asquantity(quantity, new_unit)
could be used but would combine initialising and conversion in the same function.asunit
could be expected to return a unit.convert
has debateable concerns over name collision.uconvert
isn't a nice nameconvert_quantity
is my suggestion, including the return type in the name.Should a unit conversion function that returns the value exist, and what should it be named?
Quantity.value
, so this doesn't need to exist in the initial release.Potential names:
uconvert_value
convert_value
is my suggestionShould a general function exist for converting between units? ie
convert(unit1, unit2, value)
The text was updated successfully, but these errors were encountered: