au icon indicating copy to clipboard operation
au copied to clipboard

Solve most `[UNLABELED_UNIT]` instances by generating magnitude labels

Open chiphogg opened this issue 2 years ago • 0 comments

Right now, the unit resulting from scaling a unit by a magnitude gets the default label, [UNLABELED_UNIT]. It's important that it not have the same label as the unscaled unit. Still, we can do much better if we design magnitude labels: automatic string constants that represent magnitudes.

Possible examples:

  • "1 / 18"
  • "Pi / 180"
  • "5,280"
  • "(3 * sqrt(3)) / (5 * Pi)"

To solve this, we would need to come up with a collection of canonical examples we can use as acceptance tests, and work out the general rules. We also need to figure out how to handle things like parentheses, powers, and roots.

chiphogg avatar Feb 06 '23 00:02 chiphogg