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

Add units module to allow for type checked conversions [DRAFT] #375

Closed
wants to merge 1 commit into from

Conversation

cmleinz
Copy link
Contributor

@cmleinz cmleinz commented Nov 9, 2024

Summary

This would add a new units module to Nyx where we can specify units, and their conversions. The idea being that in places where we have constructors which look like fn new_mass(mass_kg: f64) we could change them to be fn new_mass(mass: impl Into<Kilograms>).

Additionally by defining explicit types for mass, length, etc. we avoid potential errors internally from adding a mass and a length, for example.

This would be a large and breaking change, so if it is not aligned with the goals of Nyx that is understandable.

Architectural Changes

New units module

New Features

No change

Improvements

No change

Bug Fixes

No change

Testing and validation

TODO

Documentation

This PR does not primarily deal with documentation changes.

@ChristopherRabotin
Copy link
Member

Thanks for the work on the PR, Caleb. I think this would fit better as a crate separate from Nyx.

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

Successfully merging this pull request may close these issues.

2 participants