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
Update docstring for SimilarityTransform. #7194
base: main
Are you sure you want to change the base?
Conversation
skimage/transform/_geometric.py
Outdated
translation : (x, y[, z, ...]) sequence of float, length D, optional | ||
Translation parameters for each axis. Implemented only for 2D and 3D. |
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.
It seems that D (as in "length D") is used to mean n, i.e., the image's number of dimensions. We write "an nD image" so n takes values 2, 3, ... (not D).
I don't mind updating this to "n" or "N". Though I do notice that translation is only supported for 2D and 3D. So the ...
should be removed as specifying more than xyz wouldn't work?
params : (dim+1, dim+1)
(below) should also be updated according to whatever we agree on 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.
Oh, thanks @lagru.
We can't use N
because this already denotes something else (number of points):
points : (N, D) array |
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 find D
(Dimensionality) to be much clearer than n
, particularly when next to N
(Number of points)
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.
@scott-vsi I hear you. Have you scanned the other modules to see which usage would currently dominate? Should we update "nD image" everywhere with "D-dim image?" In a sentence, "nD image" seems much more natural though...
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 agree, nD reads better, although it looks like n-D and N-D are also used pretty commonly (there are actually not that many uses of nD. I could see changing those to n-D or N-D).
skimage is a large package, so I doubt you could ever get complete consensus, but it looks like D
dominates for the dimensionality of the image. It is used in skimage._shared.utils.check_nD, skimage.measure._moments.moments_coords, skimage.measure._regionprops_utils.euler_number, and skimage.feature.template.match_template. And that is just from a quick spot check.
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 looking into this, @scott-vsi! I'll mark this PR as draft, because I realize some discussion is needed before we can move forward.
I could see changing those to n-D or N-D
I would avoid uppercase N because, in addition to number of points #7194 (comment), this notation is also used for number of columns, e.g.:
src : (M, N) array_like |
Uh oh, this is getting more involved than I originally thought... e0baa7b |
Description
@scott-vsi I've just applied what you suggested back in #7103 (comment).
@lagru this brings up another (minor) question for me: It seems that
D
(as in "length D") is used to meann
, i.e., the image's number of dimensions. We write "an nD image" son
takes values 2, 3, ... (notD
).Checklist
./doc/examples
for new featuresRelease note
Summarize the introduced changes in the code block below in one or a few sentences. The
summary will be included in the next release notes automatically: