From 250861059b106371cb232456eeccd6d9e97d8f00 Mon Sep 17 00:00:00 2001 From: Tyler Reddy Date: Wed, 14 Nov 2018 11:36:59 -0800 Subject: TST, DOC: enable refguide_check * ported the refguide_check module from SciPy for usage in NumPy docstring execution/ verification; added the refguide_check run to Azure Mac OS CI * adjusted NumPy docstrings such that refguide_check passes --- numpy/lib/utils.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 84edf4021..1c834e7f2 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -151,9 +151,6 @@ def deprecate(*args, **kwargs): >>> olduint = np.deprecate(np.uint) >>> olduint(6) - /usr/lib/python2.5/site-packages/numpy/lib/utils.py:114: - DeprecationWarning: uint32 is deprecated - warnings.warn(str1, DeprecationWarning, stacklevel=2) 6 """ @@ -202,7 +199,7 @@ def byte_bounds(a): >>> high - low == I.size*I.itemsize True >>> I = np.eye(2, dtype='G'); I.dtype - dtype('complex192') + dtype('complex256') >>> low, high = np.byte_bounds(I) >>> high - low == I.size*I.itemsize True @@ -263,17 +260,17 @@ def who(vardict=None): >>> np.who() Name Shape Bytes Type =========================================================== - a 10 40 int32 + a 10 80 int64 b 20 160 float64 - Upper bound on total bytes = 200 + Upper bound on total bytes = 240 >>> d = {'x': np.arange(2.0), 'y': np.arange(3.0), 'txt': 'Some str', ... 'idx':5} >>> np.who(d) Name Shape Bytes Type =========================================================== - y 3 24 float64 x 2 16 float64 + y 3 24 float64 Upper bound on total bytes = 40 """ @@ -733,7 +730,7 @@ def lookfor(what, module=None, import_modules=True, regenerate=False, Examples -------- - >>> np.lookfor('binary representation') + >>> np.lookfor('binary representation') # doctest: +SKIP Search results for 'binary representation' ------------------------------------------ numpy.binary_repr @@ -1104,7 +1101,7 @@ def safe_eval(source): >>> np.safe_eval('open("/home/user/.ssh/id_dsa").read()') Traceback (most recent call last): ... - SyntaxError: Unsupported source construct: compiler.ast.CallFunc + ValueError: malformed node or string: <_ast.Call object at 0x...> """ # Local import to speed up numpy's import time. -- cgit v1.2.1 From 19784177a61de75927a4934fd4cdd91afbb5b35c Mon Sep 17 00:00:00 2001 From: Tyler Reddy Date: Tue, 4 Dec 2018 12:17:59 -0800 Subject: MAINT: address several reviewer comments --- numpy/lib/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 1c834e7f2..355b66df9 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -198,8 +198,8 @@ def byte_bounds(a): >>> low, high = np.byte_bounds(I) >>> high - low == I.size*I.itemsize True - >>> I = np.eye(2, dtype='G'); I.dtype - dtype('complex256') + >>> I = np.eye(2); I.dtype + dtype('complex256') # may vary >>> low, high = np.byte_bounds(I) >>> high - low == I.size*I.itemsize True -- cgit v1.2.1 From 0bdc587d6cf5e6806e95d9debcafe62ac9f1d7fa Mon Sep 17 00:00:00 2001 From: Tyler Reddy Date: Wed, 5 Dec 2018 11:15:28 -0800 Subject: MAINT: addressing review comments * restored regression comment in numpy/core/defchararray.py * fixed the dimensionality of the z array in all() docstring in numpy/core/fromnumeric.py; this isn't detected because it is in-line with variable memory addresses which are tagged as variable for refguide * byte_bounds() docstring adjusted to reflect non-variable dtype after reviewer requested removal of complex dtype * restore an original comment in matmul docstring, as requested by reviewer --- numpy/lib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 355b66df9..34d089893 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -199,7 +199,7 @@ def byte_bounds(a): >>> high - low == I.size*I.itemsize True >>> I = np.eye(2); I.dtype - dtype('complex256') # may vary + dtype('float64') >>> low, high = np.byte_bounds(I) >>> high - low == I.size*I.itemsize True -- cgit v1.2.1 From 28f8a85b9ece5773a8ac75ffcd2502fc93612eff Mon Sep 17 00:00:00 2001 From: Tyler Reddy Date: Wed, 5 Dec 2018 14:59:57 -0800 Subject: MAINT: include recfunctions module * added lib.recfunctions to refguide PUBLIC_SUBMODULES, as the doctests were otherwise not getting executed * fixed a failing doctest in recfunctions after above activation --- numpy/lib/utils.py | 1 + 1 file changed, 1 insertion(+) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 34d089893..5a4cae235 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -150,6 +150,7 @@ def deprecate(*args, **kwargs): Warning: >>> olduint = np.deprecate(np.uint) + DeprecationWarning: `uint64` is deprecated! # may vary >>> olduint(6) 6 -- cgit v1.2.1