-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
DOC: Attempt at autoformatting docstrings in morphology/* #5317
Conversation
Great! Thank you for trying on our source files. The failure is related to #5318 |
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.
skimage/morphology/convex_hull.py
Outdated
@@ -155,6 +155,7 @@ def convex_hull_object(image, *, connectivity=2): | |||
---------- | |||
image : (M, N) ndarray | |||
Binary input image. | |||
|
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 extra space is unexpected?
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 does not cause any problem in the rendered doc: https://1635-2014929-gh.circle-artifacts.com/0/doc/build/html/api/skimage.morphology.html#skimage.morphology.convex_hull_object
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 interpreted it as a convention to split between arguments before * and after. Just a guess that I found elegant.
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 don't believe there are written rules about this; wether to put blank lines between items varies across projects; currently my auto formatter has some heuristics, in particular if one items description have multiple paragraph (which is the case here for connectivity) it will add one line between all items.
It is quite hard to no modify whitespace as is does Docstring -> AST-Like repr -> back to text, tso initial whitespace information is lost.
Numpydoc is specific about the meaning of spaces arround : and a few other things, while it may look almost identical in sphinx depending on themes it is semantically different. I'm attempting to write an docstring autoreformatter thetry to fix common mistakes, and fix a couple of other things like typo in parameter names, remove parameters that are still documented, and try to get a uniform style. You'll see in the diff - add / removal of spaces - add / removal of blank lines - indent 4 spaces always. - Capitalisation of section names - removal of `border_value` parameter which is indeed not a function argument. In morphology/* this hasn't found any other issue it can fix, and the only other non-automatically fixable issues are missing documentation for `dtype` parameters.
I reran it with the |
Numpydoc is specific about the meaning of spaces arround : and a few
other things, while it may look almost identical in sphinx depending on
themes it is semantically different.
I'm attempting to write an docstring autoreformatter thetry to fix
common mistakes, and fix a couple of other things like typo in parameter
names, remove parameters that are still documented, and try to get a
uniform style.
You'll see in the diff
border_value
parameter which is indeed not a functionargument.
In morphology/* this hasn't found any other issue it can fix, and the
only other non-automatically fixable issues are missing documentation
for
dtype
parameters.For reviewers
later.
__init__.py
.doc/release/release_dev.rst
.