-
Notifications
You must be signed in to change notification settings - Fork 10
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 classes for coordinate spaces and transforms #218
Conversation
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.
LGTM with minor suggestions
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.
Looks mostly good, but I left some comments.
One important thing: "dunder methods" tend not to show up in rendered docs so I think the class docs need to explicitly say that these things are composable and @
is the operator for doing that. Alternatively I would add a compose
method so that it's more discoverable (via tab completion or doc method table).
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.
LGTM
- Drop scale from units - Use `attrs` instead of `dataclass` - Remove ABC meta class (bug)
a2505a9
to
9c514cd
Compare
- Add docstrings to Axis - Use `attrs` for CoordinateSpace - Add helper function for validation
Make CoordinateSpace classes call the super.__init__ from the level above.
Co-authored-by: paul fisher <[email protected]>
Add new methods that throw value errors for mismatched axes with a more meaningful error message.
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.
The solution to the class hierarchy situation here is good; I just have a few more suggestions (sorry) mostly about the operator implementation.
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.
🚢
[sc-50289] |
|
||
|
||
@attrs.define(frozen=True) | ||
class CoordinateSpace( |
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.
Can we also implement __eq__
for CoordinateSpace
in here?
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.
coming back from the dead to say that attrs gives you __eq__
for free
New classes: