Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Explicit units for measurements and calculations #82

Open
jpas opened this issue Jun 13, 2017 · 3 comments
Open

Explicit units for measurements and calculations #82

jpas opened this issue Jun 13, 2017 · 3 comments
Assignees

Comments

@jpas
Copy link
Contributor

jpas commented Jun 13, 2017

It would be useful to have type checking for all our units that we use, in the GPSDriveProcess alone I have needed to use:

  • radians
  • degrees
  • metres
  • rpm (for wheels)
@ottopasuuna
Copy link
Member

Right, at the very least these should be documented better. I'll go through the code base this evening to update more of the documentation, there are other things that need updating as well.
Do you know of a good way to associate units with values in python? I'd rather not have to use a third party library just for that.

@ottopasuuna ottopasuuna self-assigned this Jun 13, 2017
@climathosphere
Copy link
Contributor

climathosphere commented Jun 14, 2017

You could create a class that contains two instance variables: one for the numerical value, and one for the unit of measurement. Then you can use this class to compare units. Is this what you have in mind Jarrod?

@jpas
Copy link
Contributor Author

jpas commented Jun 14, 2017

That is part of what I had in mind, we could also implement the standard mathematical operations for these unit classes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants