Skip to content
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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mkcor
Copy link
Member

@mkcor mkcor commented Oct 9, 2023

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 mean n, i.e., the image's number of dimensions. We write "an nD image" so n takes values 2, 3, ... (not D).

Checklist

Release 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:

...

@mkcor mkcor added the 📄 type: Documentation Updates, fixes and additions to documentation label Oct 9, 2023
Comment on lines 1355 to 1356
translation : (x, y[, z, ...]) sequence of float, length D, optional
Translation parameters for each axis. Implemented only for 2D and 3D.
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Contributor

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)

Copy link
Member Author

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...

Copy link
Contributor

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.

Copy link
Member Author

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

@mkcor
Copy link
Member Author

mkcor commented Oct 14, 2023

Uh oh, this is getting more involved than I originally thought... e0baa7b

@mkcor mkcor marked this pull request as draft October 16, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📄 type: Documentation Updates, fixes and additions to documentation 💬 Discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants