-
Notifications
You must be signed in to change notification settings - Fork 98
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
added AngleKind and Angle #125
Conversation
I'm not yet sold on this whole
due to the fact that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for another PR! Again I've just done a quick pass and will need to go through in more detail this week.
For the kind issue do you have the full error available? I think the issue may be that the Div
impl leaves the result with a kind of uom::Kind
and doesn't maintain the kind of the left-hand-side. This may be a tough problem to solve with the limits of specialization in Rust right now. e.g. we want ratio / time = time^-1
but angle / time = angular velocity
.
src/si/angle.rs
Outdated
@@ -0,0 +1,96 @@ | |||
//! Angle (dimensionless). | |||
|
|||
use super::angle_kind::AngleKind; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have a si::marker
module for kinds to reside in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it if you like. Left to my own devices I typically go by the rule of three.
Edit: Now that it inherits from uom::Kind
the whole thing fits onto a single line, I'm starting to think it might be cleaner to just inline it.
Can you also add into the commit message that this resolves #89. Just realized an issue already existed! |
The full error for the kind issue is just that Div is expecting the same Kind on the left and the right, so Is it possible to define types that don't appear in the API docs? We could have the macros generate Another option that might not be too bad could be to relax the "SI purity" requirements and add "angle" as a dimension. That would have the perk of leading to a natural representation of SolidAngle as well (although that's not a thing that I personally have a use for at the moment). Edit: as for tagging the issue, I'll do that when this is ready to squash. |
Sorry for the delays. Been a busy week and it's looking like I wont get time for a full detailed review until this weekend. The two most recent commits look good. You can define items that don't appear in docs with |
Everything looks good! If you don't mind punting on what to do about |
de720b2
to
4c090b6
Compare
Thanks again for the PR! |
My pleasure, I'm stoked to finally be able to contribute to open source. |
I've split
AngleKind
into its own submodule because I expect to re-use it for AngularVelocity and AngularAcceleration.