summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-06-02 09:51:16 +0300
committerGitHub <noreply@github.com>2019-06-02 09:51:16 +0300
commitb90e09c1232861cb0a22628e29261e6cc8382df0 (patch)
tree038a201c519026d0aeba90c0bd54f3e9d55253a7 /numpy
parent52ddda6e253a2c5e16b3933462ed7e4778ca76f9 (diff)
parent68c81c10aa8b40a60a95968a1fb4b57c08b1340f (diff)
downloadnumpy-b90e09c1232861cb0a22628e29261e6cc8382df0.tar.gz
Merge pull request #13688 from bashtage/random_sample-aliases
MAINT: Correct masked aliases
Diffstat (limited to 'numpy')
-rw-r--r--numpy/random/__init__.py7
-rw-r--r--numpy/random/mtrand.pyx3
2 files changed, 5 insertions, 5 deletions
diff --git a/numpy/random/__init__.py b/numpy/random/__init__.py
index 2e83e419d..21c1adddf 100644
--- a/numpy/random/__init__.py
+++ b/numpy/random/__init__.py
@@ -141,9 +141,12 @@ __all__ = [
'rand',
'randint',
'randn',
+ 'random',
'random_integers',
'random_sample',
+ 'ranf',
'rayleigh',
+ 'sample',
'seed',
'set_state',
'shuffle',
@@ -176,10 +179,6 @@ from .mtrand import RandomState
__all__ += ['Generator', 'DSFMT', 'MT19937', 'Philox', 'PCG64', 'PCG32',
'ThreeFry', 'Xoshiro256', 'Xoshiro512', 'RandomState']
-# Some aliases:
-ranf = random = sample = random_sample
-__all__.extend(['ranf', 'random', 'sample'])
-
def __RandomState_ctor():
"""Return a RandomState instance.
diff --git a/numpy/random/mtrand.pyx b/numpy/random/mtrand.pyx
index 732de7a56..e97af4596 100644
--- a/numpy/random/mtrand.pyx
+++ b/numpy/random/mtrand.pyx
@@ -4195,7 +4195,7 @@ power = _rand.power
rand = _rand.rand
randint = _rand.randint
randn = _rand.randn
-random = _rand.random_sample
+random = _rand.random
random_integers = _rand.random_integers
random_sample = _rand.random_sample
rayleigh = _rand.rayleigh
@@ -4260,6 +4260,7 @@ __all__ = [
'rand',
'randint',
'randn',
+ 'random',
'random_integers',
'random_sample',
'ranf',