summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2019-10-13 09:13:05 +0300
committermattip <matti.picus@gmail.com>2019-10-13 09:13:05 +0300
commit185efe1bb746ad5b6ac23d106df12ad35a207d49 (patch)
tree737b9dd102c576756910764aa12da74c099b50b5 /numpy
parent260bf67640724915ffefd0a5a7133318ece149da (diff)
downloadnumpy-185efe1bb746ad5b6ac23d106df12ad35a207d49.tar.gz
DOC: clean up for moved references, remove ISeedSequence
Diffstat (limited to 'numpy')
-rw-r--r--numpy/matlib.py4
-rw-r--r--numpy/random/__init__.py4
-rw-r--r--numpy/random/_bit_generator.pyx7
-rw-r--r--numpy/random/_generator.pyx7
-rw-r--r--numpy/random/_mt19937.pyx5
-rw-r--r--numpy/random/_pcg64.pyx5
-rw-r--r--numpy/random/_philox.pyx15
-rw-r--r--numpy/random/_sfc64.pyx5
-rw-r--r--numpy/random/mtrand.pyx12
9 files changed, 29 insertions, 35 deletions
diff --git a/numpy/matlib.py b/numpy/matlib.py
index 604ef470b..c495c04ae 100644
--- a/numpy/matlib.py
+++ b/numpy/matlib.py
@@ -239,7 +239,7 @@ def rand(*args):
See Also
--------
- randn, numpy.random.rand
+ randn, numpy.random.RandomState.rand
Examples
--------
@@ -285,7 +285,7 @@ def randn(*args):
See Also
--------
- rand, random.randn
+ rand, random.RandomState.randn
Notes
-----
diff --git a/numpy/random/__init__.py b/numpy/random/__init__.py
index 799700899..1ceb5c4dd 100644
--- a/numpy/random/__init__.py
+++ b/numpy/random/__init__.py
@@ -183,7 +183,7 @@ from . import _common
from . import _bounded_integers
from ._generator import Generator, default_rng
-from ._bit_generator import SeedSequence
+from ._bit_generator import SeedSequence, BitGenerator
from ._mt19937 import MT19937
from ._pcg64 import PCG64
from ._philox import Philox
@@ -191,7 +191,7 @@ from ._sfc64 import SFC64
from .mtrand import *
__all__ += ['Generator', 'RandomState', 'SeedSequence', 'MT19937',
- 'Philox', 'PCG64', 'SFC64', 'default_rng']
+ 'Philox', 'PCG64', 'SFC64', 'default_rng', 'BitGenerator']
def __RandomState_ctor():
diff --git a/numpy/random/_bit_generator.pyx b/numpy/random/_bit_generator.pyx
index b85f0a41b..471adcecd 100644
--- a/numpy/random/_bit_generator.pyx
+++ b/numpy/random/_bit_generator.pyx
@@ -482,13 +482,12 @@ cdef class BitGenerator():
Parameters
----------
- seed : {None, int, array_like[ints], ISeedSequence}, optional
+ seed : {None, int, array_like[ints], SeedSequence}, optional
A seed to initialize the `BitGenerator`. If None, then fresh,
unpredictable entropy will be pulled from the OS. If an ``int`` or
``array_like[ints]`` is passed, then it will be passed to
- `SeedSequence` to derive the initial `BitGenerator` state. One may also
- pass in an implementor of the `ISeedSequence` interface like
- `SeedSequence`.
+ ~`numpy.randomSeedSequence` to derive the initial `BitGenerator` state.
+ One may also pass in a ~`numpy.random.SeedSequence` instance.
Attributes
----------
diff --git a/numpy/random/_generator.pyx b/numpy/random/_generator.pyx
index f4c1d3772..22b17ab03 100644
--- a/numpy/random/_generator.pyx
+++ b/numpy/random/_generator.pyx
@@ -4097,19 +4097,18 @@ def default_rng(seed=None):
Parameters
----------
- seed : {None, int, array_like[ints], ISeedSequence, BitGenerator, Generator}, optional
+ seed : {None, int, array_like[ints], SeedSequence, BitGenerator, Generator}, optional
A seed to initialize the `BitGenerator`. If None, then fresh,
unpredictable entropy will be pulled from the OS. If an ``int`` or
``array_like[ints]`` is passed, then it will be passed to
`SeedSequence` to derive the initial `BitGenerator` state. One may also
- pass in an implementor of the `ISeedSequence` interface like
- `SeedSequence`.
+ pass in a`SeedSequence` instance
Additionally, when passed a `BitGenerator`, it will be wrapped by
`Generator`. If passed a `Generator`, it will be returned unaltered.
Notes
-----
- When `seed` is omitted or ``None``, a new `BitGenerator` and `Generator` will
+ When ``seed`` is omitted or ``None``, a new `BitGenerator` and `Generator` will
be instantiated each time. This function does not manage a default global
instance.
"""
diff --git a/numpy/random/_mt19937.pyx b/numpy/random/_mt19937.pyx
index 206f164e1..e99652b73 100644
--- a/numpy/random/_mt19937.pyx
+++ b/numpy/random/_mt19937.pyx
@@ -48,13 +48,12 @@ cdef class MT19937(BitGenerator):
Parameters
----------
- seed : {None, int, array_like[ints], ISeedSequence}, optional
+ seed : {None, int, array_like[ints], SeedSequence}, optional
A seed to initialize the `BitGenerator`. If None, then fresh,
unpredictable entropy will be pulled from the OS. If an ``int`` or
``array_like[ints]`` is passed, then it will be passed to
`SeedSequence` to derive the initial `BitGenerator` state. One may also
- pass in an implementor of the `ISeedSequence` interface like
- `SeedSequence`.
+ pass in a `SeedSequence` instance.
Attributes
----------
diff --git a/numpy/random/_pcg64.pyx b/numpy/random/_pcg64.pyx
index 2d5ade9f8..1a5d852a2 100644
--- a/numpy/random/_pcg64.pyx
+++ b/numpy/random/_pcg64.pyx
@@ -44,13 +44,12 @@ cdef class PCG64(BitGenerator):
Parameters
----------
- seed : {None, int, array_like[ints], ISeedSequence}, optional
+ seed : {None, int, array_like[ints], SeedSequence}, optional
A seed to initialize the `BitGenerator`. If None, then fresh,
unpredictable entropy will be pulled from the OS. If an ``int`` or
``array_like[ints]`` is passed, then it will be passed to
`SeedSequence` to derive the initial `BitGenerator` state. One may also
- pass in an implementor of the `ISeedSequence` interface like
- `SeedSequence`.
+ pass in a `SeedSequence` instance.
Notes
-----
diff --git a/numpy/random/_philox.pyx b/numpy/random/_philox.pyx
index 4154e042c..9f136c32f 100644
--- a/numpy/random/_philox.pyx
+++ b/numpy/random/_philox.pyx
@@ -64,21 +64,20 @@ cdef class Philox(BitGenerator):
Parameters
----------
- seed : {None, int, array_like[ints], ISeedSequence}, optional
+ seed : {None, int, array_like[ints], SeedSequence}, optional
A seed to initialize the `BitGenerator`. If None, then fresh,
unpredictable entropy will be pulled from the OS. If an ``int`` or
``array_like[ints]`` is passed, then it will be passed to
`SeedSequence` to derive the initial `BitGenerator` state. One may also
- pass in an implementor of the `ISeedSequence` interface like
- `SeedSequence`.
+ pass in a `SeedSequence` instance.
counter : {None, int, array_like}, optional
Counter to use in the Philox state. Can be either
a Python int (long in 2.x) in [0, 2**256) or a 4-element uint64 array.
If not provided, the RNG is initialized at 0.
key : {None, int, array_like}, optional
- Key to use in the Philox state. Unlike seed, the value in key is
+ Key to use in the Philox state. Unlike ``seed``, the value in key is
directly set. Can be either a Python int in [0, 2**128) or a 2-element
- uint64 array. `key` and `seed` cannot both be used.
+ uint64 array. `key` and ``seed`` cannot both be used.
Attributes
----------
@@ -110,10 +109,10 @@ cdef class Philox(BitGenerator):
randoms produced. The second is a key which determined the sequence
produced. Using different keys produces independent sequences.
- The input seed is processed by `SeedSequence` to generate the key. The
+ The input ``seed`` is processed by `SeedSequence` to generate the key. The
counter is set to 0.
- Alternately, one can omit the seed parameter and set the ``key`` and
+ Alternately, one can omit the ``seed`` parameter and set the ``key`` and
``counter`` directly.
**Parallel Features**
@@ -148,7 +147,7 @@ cdef class Philox(BitGenerator):
**Compatibility Guarantee**
- ``Philox`` makes a guarantee that a fixed seed will always produce
+ ``Philox`` makes a guarantee that a fixed ``seed`` will always produce
the same random integer stream.
Examples
diff --git a/numpy/random/_sfc64.pyx b/numpy/random/_sfc64.pyx
index 842598e38..1633669d5 100644
--- a/numpy/random/_sfc64.pyx
+++ b/numpy/random/_sfc64.pyx
@@ -39,13 +39,12 @@ cdef class SFC64(BitGenerator):
Parameters
----------
- seed : {None, int, array_like[ints], ISeedSequence}, optional
+ seed : {None, int, array_like[ints], SeedSequence}, optional
A seed to initialize the `BitGenerator`. If None, then fresh,
unpredictable entropy will be pulled from the OS. If an ``int`` or
``array_like[ints]`` is passed, then it will be passed to
`SeedSequence` to derive the initial `BitGenerator` state. One may also
- pass in an implementor of the `ISeedSequence` interface like
- `SeedSequence`.
+ pass in a `SeedSequence` instance.
Notes
-----
diff --git a/numpy/random/mtrand.pyx b/numpy/random/mtrand.pyx
index 326e8b45e..683a771cc 100644
--- a/numpy/random/mtrand.pyx
+++ b/numpy/random/mtrand.pyx
@@ -165,7 +165,7 @@ cdef class RandomState:
--------
Generator
MT19937
- :ref:`bit_generator`
+ numpy.random.BitGenerator
"""
cdef public object _bit_generator
@@ -648,7 +648,7 @@ cdef class RandomState:
See Also
--------
- random.random_integers : similar to `randint`, only for the closed
+ random_integers : similar to `randint`, only for the closed
interval [`low`, `high`], and 1 is the lowest value if `high` is
omitted.
@@ -1066,7 +1066,7 @@ cdef class RandomState:
.. note::
This is a convenience function for users porting code from Matlab,
- and wraps `numpy.random.random_sample`. That function takes a
+ and wraps `random_sample`. That function takes a
tuple to specify the size of the output, which is consistent with
other NumPy functions like `numpy.zeros` and `numpy.ones`.
@@ -1110,7 +1110,7 @@ cdef class RandomState:
.. note::
This is a convenience function for users porting code from Matlab,
- and wraps `numpy.random.standard_normal`. That function takes a
+ and wraps `standard_normal`. That function takes a
tuple to specify the size of the output, which is consistent with
other NumPy functions like `numpy.zeros` and `numpy.ones`.
@@ -1370,8 +1370,8 @@ cdef class RandomState:
The function has its peak at the mean, and its "spread" increases with
the standard deviation (the function reaches 0.607 times its maximum at
:math:`x + \\sigma` and :math:`x - \\sigma` [2]_). This implies that
- `numpy.random.normal` is more likely to return samples lying close to
- the mean, rather than those far away.
+ normal is more likely to return samples lying close to the mean, rather
+ than those far away.
References
----------