summaryrefslogtreecommitdiff
path: root/numpy/core/multiarray.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2019-07-06 16:08:17 -0700
committerMatti Picus <matti.picus@gmail.com>2019-07-06 16:08:17 -0700
commit7ac7fa9a4621f7392f534b20f0cdd64967e9c7eb (patch)
tree7c277762efd84f59d11e07720ad2995d361ff308 /numpy/core/multiarray.py
parent57b16ed568581c33d0a6b6d3d4254dce3b67b321 (diff)
downloadnumpy-7ac7fa9a4621f7392f534b20f0cdd64967e9c7eb.tar.gz
MAINT/BUG/DOC: Fix errors in _add_newdocs (#13876)
* BUG: Remove items from `multiarray.__all__` which do not exist on python 3 Avoid using `_add_newdocs` if these functions do not exist. Leaving the version-checking here so that we can backport to 1.16 * BUG: Add missing `np.core.multiarray._get_ndarray_c_version` function This must have been lost in the multiarray / umath merge. Found by noticing that `add_newdocs` was being called on an object that does not exist. * DOC: Remove documentation for property that does not exist `ndarray._as_parameter_` is not a real thing * DOC: Remove docstrings which are duplicated from `numpy/core/multiarray.py` * BUG: Don't silence errors in add_newdoc caused by bad arguments This caught us trying to document members that don't exist.
Diffstat (limited to 'numpy/core/multiarray.py')
-rw-r--r--numpy/core/multiarray.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/numpy/core/multiarray.py b/numpy/core/multiarray.py
index 4f2c5b78e..c0fcc10ff 100644
--- a/numpy/core/multiarray.py
+++ b/numpy/core/multiarray.py
@@ -7,6 +7,7 @@ by importing from the extension module.
"""
import functools
+import sys
import warnings
import sys
@@ -16,7 +17,7 @@ import numpy as np
from numpy.core._multiarray_umath import *
from numpy.core._multiarray_umath import (
_fastCopyAndTranspose, _flagdict, _insert, _reconstruct, _vec_string,
- _ARRAY_API, _monotonicity
+ _ARRAY_API, _monotonicity, _get_ndarray_c_version
)
__all__ = [
@@ -31,15 +32,17 @@ __all__ = [
'count_nonzero', 'c_einsum', 'datetime_as_string', 'datetime_data',
'digitize', 'dot', 'dragon4_positional', 'dragon4_scientific', 'dtype',
'empty', 'empty_like', 'error', 'flagsobj', 'flatiter', 'format_longfloat',
- 'frombuffer', 'fromfile', 'fromiter', 'fromstring', 'getbuffer', 'inner',
+ 'frombuffer', 'fromfile', 'fromiter', 'fromstring', 'inner',
'int_asbuffer', 'interp', 'interp_complex', 'is_busday', 'lexsort',
'matmul', 'may_share_memory', 'min_scalar_type', 'ndarray', 'nditer',
- 'nested_iters', 'newbuffer', 'normalize_axis_index', 'packbits',
+ 'nested_iters', 'normalize_axis_index', 'packbits',
'promote_types', 'putmask', 'ravel_multi_index', 'result_type', 'scalar',
'set_datetimeparse_function', 'set_legacy_print_mode', 'set_numeric_ops',
'set_string_function', 'set_typeDict', 'shares_memory', 'test_interrupt',
'tracemalloc_domain', 'typeinfo', 'unpackbits', 'unravel_index', 'vdot',
'where', 'zeros']
+if sys.version_info.major < 3:
+ __all__ += ['newbuffer', 'getbuffer']
# For backward compatibility, make sure pickle imports these functions from here
_reconstruct.__module__ = 'numpy.core.multiarray'