-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
DOC: Fix malformed docstrings in ma. #16296
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
Conversation
numpy/ma/extras.py
Outdated
locdoc = "\n\n Notes\n -----\n "\ | ||
"The function is applied to both the _data"\ | ||
" and the _mask, if any." |
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.
Perhaps instead we should use inspect.cleandoc(doc)
before concatenating?
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.
@eric-wieser Thanks for reviewing. I think that's right, so I fixed the code.
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.
Applying cleandoc
is definitely an improvement. Just had a quick thought on the linebreaking in locdoc
.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
I found a function
So I think it's better to use |
Unfortunately |
Proof that this seems to be working as intended: https://13466-908607-gh.circle-artifacts.com/0/doc/build/html/reference/generated/numpy.ma.vstack.html |
Close/Reopen to clear CI failure |
Now |
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
locdoc = "Notes\n-----\nThe function is applied to both the _data"\ | ||
" and the _mask, if any." | ||
return '\n'.join((sig, doc, locdoc)) | ||
doc = ma.doc_note(doc, "The function is applied to both the _data " |
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 wonder if as a follow-up we can set self.__wrapped__ = npfunc
to avoid having to add a manual signature line.
Thanks @takanori-pskq |
Fixing documents for some functions in
numpy.ma
(e.g.numpy.ma.vstack
, https://numpy.org/devdocs/reference/generated/numpy.ma.vstack.html ). The documents is malformed because the indent of notes section is wrong.