8000 DOC: Fix malformed docstrings in ma. by takanori-pskq · Pull Request #16296 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 6 commits into from
Jun 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions numpy/ma/extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,6 @@ def getdoc(self):
the new masked array version of the function. A note on application
of the function to the mask is appended.

.. warning::
If the function docstring already contained a Notes section, the
new docstring will have two Notes sections instead of appending a note
to the existing section.

Parameters
----------
None
Expand All @@ -258,9 +253,9 @@ def getdoc(self):
doc = getattr(npfunc, '__doc__', None)
if doc:
sig = self.__name__ + ma.get_object_signature(npfunc)
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 "
Copy link
Member

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.

"and the _mask, if any.")
return '\n\n'.join((sig, doc))
return

def __call__(self, *args, **params):
Expand Down
0