-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
transform update for generic transforms #60
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.
Only one comment, re docs, code all looks good 🎉
return transform; | ||
} | ||
|
||
pub struct AffineTransform { |
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 think this module is underdocumented so probably worth adding some either module level docs or type docs on the structs and public methods.
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.
Finally got around to updating this, added a bunch of comments, let me know what you think.
18c541d
to
9fe43f0
Compare
src/transform/affine.rs
Outdated
|
||
|
||
pub fn transform_from_2dmatrix(in_array: Array2<f64>) -> AffineTransform { | ||
/// converts a matrix into an equivalent Transform |
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.
Doc comments like this should be above the function signature.
src/transform/affine.rs
Outdated
} | ||
|
||
pub struct AffineTransform { | ||
/// Represents a linear transform of either size 2x2 |
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.
Ditto, I imagine this comment should be above the struct? The idea is these should show up for users when they look at the docs (so run cargo doc
and have a peruse to see how it looks)
@xd009642 happy to hear your feedback on this next round of comment polish. Also made ComposedTransform public |
The doc comments still seem to be below the function signatures instead of above them? |
Gah.. bad commit, sorry, should be working now. |
src/transform/mod.rs
Outdated
impl Display for TransformError { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
match self { | ||
InvalidTransform => return write!(f, "invalid transform" ), |
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 think here you should do Self::InvalidTransform
that might fix CI
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.
Took TransformerError::InvalidTransform to pass tests... hopefully that works.
Okay just a |
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
Looking for Comments, Thanks