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

Refactor Units to reduce complexity + better support conversion automation #282

Open
robfitzgerald opened this issue Feb 6, 2025 · 1 comment

Comments

@robfitzgerald
Copy link
Collaborator

The current solution for units has some capabilities for supporting high-performance conversions and type safety. However, a few aspects of the current solution create friction around automated conversion:

  1. the core capability of unit types, "convert", does not come from a trait, so it cannot be abstracted over
  2. state variables are accessed through the StateModel as Distance, Time, etc newtypes, which was intended to add type safety, but instead makes it challenging to abstract over, and duplicates the choice of having strongly typed unit types like DistanceUnit, TimeUnit, etc
  3. unit types are disjoint, so it is complicated to abstract over all unit types
@robfitzgerald robfitzgerald added this to the Sprint: Units fixes milestone Feb 6, 2025
@robfitzgerald
Copy link
Collaborator Author

sketch illustrating this refactor in this gist

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