summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeni Burovski <evgeny.burovskiy@gmail.com>2016-01-04 15:58:55 +0000
committerEvgeni Burovski <evgeny.burovskiy@gmail.com>2016-01-04 17:04:12 +0000
commit2edc202a2a70a17893e523dd4eb56b6668522981 (patch)
tree010348eac0065673ac0c7ee314128f6cf4c05926
parent2fb2b66aa459d30120b9c2abd98c736cbf853cc0 (diff)
downloadnumpy-2edc202a2a70a17893e523dd4eb56b6668522981.tar.gz
DEP: deprecate np.testing.rand
-rw-r--r--doc/release/1.11.0-notes.rst7
-rw-r--r--numpy/testing/utils.py3
2 files changed, 10 insertions, 0 deletions
diff --git a/doc/release/1.11.0-notes.rst b/doc/release/1.11.0-notes.rst
index 6de10b553..c15936cc3 100644
--- a/doc/release/1.11.0-notes.rst
+++ b/doc/release/1.11.0-notes.rst
@@ -158,3 +158,10 @@ parameter in methods like ```array.flatten``` or ```array.ravel```
that were not one of the following: 'C', 'F', 'A', 'K' (note that
all of these possible values are unicode- and case-insensitive).
Such behaviour will not be allowed in future releases.
+
+Random number generator in the ``testing`` namespace
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Python standard library random number generator was previously exposed in the
+``testing`` namespace as ``testing.rand``. Using this generator is not
+recommended and it will be removed in a future release. Use generators from
+``numpy.random`` namespace instead.
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index 0c4ebe1b9..f545cd3c2 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -16,6 +16,7 @@ from tempfile import mkdtemp, mkstemp
from .nosetester import import_nose
from numpy.core import float32, empty, arange, array_repr, ndarray
+from numpy.lib.utils import deprecate
if sys.version_info[0] >= 3:
from io import StringIO
@@ -122,6 +123,8 @@ def gisinf(x):
raise TypeError("isinf not supported for this type")
return st
+@deprecate(message="numpy.testing.rand is deprecated in numpy 1.11. "
+ "Use numpy.random.rand instead.")
def rand(*args):
"""Returns an array of random numbers with the given shape.