8000 Merge pull request #6936 from ev-br/dep-rand · numpy/numpy@4c2b198 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c2b198

Browse files
committed
Merge pull request #6936 from ev-br/dep-rand
DEP: deprecate np.testing.rand
2 parents 2fb2b66 + 2edc202 commit 4c2b198

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

doc/release/1.11.0-notes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,10 @@ parameter in methods like ```array.flatten``` or ```array.ravel```
158158
that were not one of the following: 'C', 'F', 'A', 'K' (note that
159159
all of these possible values are unicode- and case-insensitive).
160160
Such behaviour will not be allowed in future releases.
161+
162+
Random number generator in the ``testing`` namespace
163+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164+
Python standard library random number generator was previously exposed in the
165+
``testing`` namespace as ``testing.rand``. Using this generator is not
166+
recommended and it will be removed in a future release. Use generators from
167+
``numpy.random`` namespace instead.

numpy/testing/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from .nosetester import import_nose
1818
from numpy.core import float32, empty, arange, array_repr, ndarray
19+
from numpy.lib.utils import deprecate
1920

2021
if sys.version_info[0] >= 3:
2122
from io import StringIO
@@ -122,6 +123,8 @@ def gisinf(x):
122123
raise TypeError("isinf not supported for this type")
123124
return st
124125

126+
@deprecate(message="numpy.testing.rand is deprecated in numpy 1.11. "
127+
"Use numpy.random.rand instead.")
125128
def rand(*args):
126129
"""Returns an array of random numbers with the given shape.
127130

0 commit comments

Comments
 (0)
0