summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorStefan van der Walt <sjvdwalt@gmail.com>2018-03-16 08:39:15 -0700
committerCharles Harris <charlesr.harris@gmail.com>2018-03-16 09:39:15 -0600
commit01cd5c9d8b8cd4cfc5c7bde066aa5ed4736ed3e9 (patch)
tree31d705e6ba33ff2a70517a9df4b9bc4a16cb9dae /numpy
parentf42e10405f2354e1776f89402ceae0ad0ab637bb (diff)
downloadpython-numpy-01cd5c9d8b8cd4cfc5c7bde066aa5ed4736ed3e9.tar.gz
python-numpy-01cd5c9d8b8cd4cfc5c7bde066aa5ed4736ed3e9.tar.bz2
python-numpy-01cd5c9d8b8cd4cfc5c7bde066aa5ed4736ed3e9.zip
TST, DOC: Upload devdocs and neps after circleci build (#10702)
* Upload devdocs and neps after build * Install numpydoc * Fix masked array documentation injection `doc_note` appends a `Notes` section to docstrings, which may lead to duplicate sections. * Add deploy key for neps repo Note that we have to explicitly reset the ~/.ssh/config to only leave one SSH key * Only deploy on master branch * Blow away previous dev docs after each upload * Add tool to upload files to remote repo * Remove numpydoc from pip install; it is included as a submodule * Avoid using invalid escape code * Rename repo upload tool * Use check_call to simplify doc pushing tool
Diffstat (limited to 'numpy')
-rw-r--r--numpy/ma/core.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 6deff0ef4..5f53dfdae 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -26,6 +26,7 @@ import sys
import operator
import warnings
import textwrap
+import re
from functools import reduce
if sys.version_info[0] >= 3:
@@ -132,19 +133,17 @@ def doc_note(initialdoc, note):
if note is None:
return initialdoc
- # FIXME: disable this function for the moment until we figure out what to
- # do with it. Currently it may result in duplicate Notes sections or Notes
- # sections in the wrong place
- return initialdoc
+ notesplit = re.split(r'\n\s*?Notes\n\s*?-----', initialdoc)
- newdoc = """
- %s
-
- Notes
+ notedoc = """\
+Notes
-----
- %s
- """
- return newdoc % (initialdoc, note)
+ %s""" % note
+
+ if len(notesplit) > 1:
+ notedoc = '\n\n ' + notedoc + '\n'
+
+ return ''.join(notesplit[:1] + [notedoc] + notesplit[1:])
def get_object_signature(obj):