summaryrefslogtreecommitdiff
path: root/numpy/ma/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/ma/core.py')
-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):