diff options
author | Warren Weckesser <warren.weckesser@gmail.com> | 2020-04-26 09:34:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-26 09:34:04 -0400 |
commit | a695a9f240922790c8062b3349fe07812eabd251 (patch) | |
tree | 75314c997d2166e6fa6ccfc92cb1df5aa45ac42a | |
parent | 651bb25d6b409b9031c40cf33f991d24f350edd3 (diff) | |
parent | 2817f1aacc6f64de6a2a88aca35141748d306546 (diff) | |
download | numpy-a695a9f240922790c8062b3349fe07812eabd251.tar.gz |
Merge pull request #16079 from rossbar/bld/shorten_doc_build
DOC,BLD: Limit timeit iterations in random docs.
-rw-r--r-- | doc/source/reference/random/new-or-different.rst | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/doc/source/reference/random/new-or-different.rst b/doc/source/reference/random/new-or-different.rst index b3bddb443..1d6b09faf 100644 --- a/doc/source/reference/random/new-or-different.rst +++ b/doc/source/reference/random/new-or-different.rst @@ -52,36 +52,37 @@ And in more detail: methods which are 2-10 times faster than NumPy's default implementation in `~.Generator.standard_normal`, `~.Generator.standard_exponential` or `~.Generator.standard_gamma`. -* `~.Generator.integers` is now the canonical way to generate integer - random numbers from a discrete uniform distribution. The ``rand`` and - ``randn`` methods are only available through the legacy `~.RandomState`. - This replaces both ``randint`` and the deprecated ``random_integers``. -* The Box-Muller method used to produce NumPy's normals is no longer available. -* All bit generators can produce doubles, uint64s and - uint32s via CTypes (`~PCG64.ctypes`) and CFFI (`~PCG64.cffi`). - This allows these bit generators to be used in numba. -* The bit generators can be used in downstream projects via - Cython. - + .. ipython:: python from numpy.random import Generator, PCG64 import numpy.random rg = Generator(PCG64()) - %timeit rg.standard_normal(100000) - %timeit numpy.random.standard_normal(100000) + %timeit -n 1 rg.standard_normal(100000) + %timeit -n 1 numpy.random.standard_normal(100000) .. ipython:: python - %timeit rg.standard_exponential(100000) - %timeit numpy.random.standard_exponential(100000) + %timeit -n 1 rg.standard_exponential(100000) + %timeit -n 1 numpy.random.standard_exponential(100000) .. ipython:: python - %timeit rg.standard_gamma(3.0, 100000) - %timeit numpy.random.standard_gamma(3.0, 100000) + %timeit -n 1 rg.standard_gamma(3.0, 100000) + %timeit -n 1 numpy.random.standard_gamma(3.0, 100000) + +* `~.Generator.integers` is now the canonical way to generate integer + random numbers from a discrete uniform distribution. The ``rand`` and + ``randn`` methods are only available through the legacy `~.RandomState`. + This replaces both ``randint`` and the deprecated ``random_integers``. +* The Box-Muller method used to produce NumPy's normals is no longer available. +* All bit generators can produce doubles, uint64s and + uint32s via CTypes (`~PCG64.ctypes`) and CFFI (`~PCG64.cffi`). + This allows these bit generators to be used in numba. +* The bit generators can be used in downstream projects via + Cython. * Optional ``dtype`` argument that accepts ``np.float32`` or ``np.float64`` to produce either single or double prevision uniform random variables for select distributions |