From 01cd5c9d8b8cd4cfc5c7bde066aa5ed4736ed3e9 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Fri, 16 Mar 2018 08:39:15 -0700 Subject: 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 --- numpy/ma/core.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'numpy') 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): -- cgit v1.2.3