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

Indicate relative magnitudes in common unit labels #105

Open
chiphogg opened this issue Feb 15, 2023 · 1 comment
Open

Indicate relative magnitudes in common unit labels #105

chiphogg opened this issue Feb 15, 2023 · 1 comment
Labels
⬇️ affects: code (implementation) Affects implementation details of the code 📁 kind: enhancement New feature or request 📝 status: blocked Blocked on another issue or an external dependency 💪 effort: small
Milestone

Comments

@chiphogg
Copy link
Contributor

A core part of Au's philosophy is "no preferred units". So when we subtract, say, MPH from KPH, the result is labeled as essentially "the common unit of MPH and KPH": COM[km / h, mi / h].

I think this is a mixed bag. It's good that we don't conjure up any unmentioned units. COM[km / h, mi / h] does unambiguously identify what unit is being used. But this isn't a commonly used unit, and it's clearly bad that the label doesn't give any clue as to its magnitude, relative to any other unit.

I've found a new candidate solution. We can express the common unit in terms of each constituent unit --- and, for clarity, replace the , with ==. For example: COM([1 / 15625] km / h == [1 / 25146] mi / h).

  • PRO: Doesn't put any unit on special footing.
  • PRO: Clearly indicates the common unit's magnitude in terms of each constituent unit.
  • CON: A little verbose.

I think this is a clear improvement. Common-unit quantities generally only occur as the result of intermediate computations. They're not the kind of thing that end users are going to want to print, unmodified. But when they do end up being output, they'd better be unambiguous!

This solution depends on #85, because we need to be able to print magnitudes.

@chiphogg
Copy link
Contributor Author

Related: mpusz/mp-units#438.

@chiphogg chiphogg added the 📁 kind: enhancement New feature or request label Feb 15, 2023
@chiphogg chiphogg added ⬇️ affects: code (implementation) Affects implementation details of the code 📝 status: blocked Blocked on another issue or an external dependency 💪 effort: small labels Mar 26, 2023
@chiphogg chiphogg added this to the 0.4.0 milestone Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬇️ affects: code (implementation) Affects implementation details of the code 📁 kind: enhancement New feature or request 📝 status: blocked Blocked on another issue or an external dependency 💪 effort: small
Projects
None yet
Development

No branches or pull requests

1 participant