Skip to content

Commit 8a8eeea

Browse files
committed
DOC: Improve docstrings
Small docstring improvements with specifics for seed size
1 parent f1b0769 commit 8a8eeea

File tree

7 files changed

+24
-18
lines changed

7 files changed

+24
-18
lines changed

doc/source/mrg32k3a.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ Random generator
1616
get_state
1717
set_state
1818

19+
Parallel generation
20+
===================
21+
.. autosummary::
22+
:toctree: generated/
1923

24+
jump
25+
2026
Simple random data
2127
==================
2228
.. autosummary::

randomstate/shims/mlfg-1279-861/mlfg-1279-861.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ seed : {None, int}, optional
8181
Can be an integer in [0, 2**64] or ``None`` (the default).
8282
If ``seed`` is ``None``, then ``mlfg_1279_861.RandomState`` will try to
8383
read entropy from ``/dev/urandom`` (or the Windows analogue) if available
84-
to produce a 64-bit seed. If unavailable, the a 64-bit hash of the time
84+
to produce a 64-bit seed. If unavailable, a 64-bit hash of the time
8585
and process ID is used.
8686
8787
Notes

randomstate/shims/mrg32k3a/mrg32k3a.pxi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ cdef void jump_state(aug_state* state):
8787
DEF CLASS_DOCSTRING = """
8888
RandomState(seed=None)
8989
90-
Container for L\'Ecuyer MRG32K3A pseudo random number generator.
90+
Container for L'Ecuyer MRG32K3A pseudo random number generator.
9191
9292
MRG32K3A is a 32-bit implementation of L'Ecuyer's combined multiple
93-
recursive generator ([1]_, [2]_). MRG32K3A has a period of 2**191 and
94-
supports multiple streams (NOT IMPLEMENTED YET).
93+
recursive generator [1]_, [2]_. MRG32K3A has a period of :math:`2^{191}`,
94+
supports jumping ahead and is suitable for parallel applications.
9595
9696
``mrg32k3a.RandomState`` exposes a number of methods for generating random
9797
numbers drawn from a variety of probability distributions. In addition to the
@@ -116,8 +116,8 @@ seed : {None, int}, optional
116116
Random seed initializing the pseudo-random number generator.
117117
Can be an integer in [0, 2**64] or ``None`` (the default).
118118
If `seed` is ``None``, then ``mrg32k3a.RandomState`` will try to read data
119-
from ``/dev/urandom`` (or the Windows analogue) if available or seed from
120-
the clock otherwise.
119+
from ``/dev/urandom`` (or the Windows analogue) if available. If
120+
unavailable, a 64-bit hash of the time and process ID is used.
121121
122122
Notes
123123
-----

randomstate/shims/pcg-32/pcg-32.pxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ seed : {None, long}, optional
6767
Random seed initializing the pseudo-random number generator.
6868
Can be an integer in [0, 2**64] or ``None`` (the default).
6969
If `seed` is ``None``, then ``pcg32.RandomState`` will try to read data
70-
from ``/dev/urandom`` (or the Windows analogue) if available or seed from
71-
the clock otherwise.
70+
from ``/dev/urandom`` (or the Windows analogue) if available. If
71+
unavailable, a 64-bit hash of the time and process ID is used.
7272
inc : {None, int}, optional
7373
Stream to return.
7474
Can be an integer in [0, 2**64] or ``None`` (the default). If `inc` is

randomstate/shims/pcg-64/pcg-64-docstring.pxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ seed : {None, long}, optional
3030
Random seed initializing the pseudo-random number generator.
3131
Can be an integer in [0, 2**128] or ``None`` (the default).
3232
If `seed` is ``None``, then ``pcg64.RandomState`` will try to read data
33-
from ``/dev/urandom`` (or the Windows analogue) if available or seed from
34-
the clock otherwise.
33+
from ``/dev/urandom`` (or the Windows analogue) if available. If
34+
unavailable, a 64-bit hash of the time and process ID is used.
3535
inc : {None, int}, optional
3636
Stream to return.
3737
Can be an integer in [0, 2**128] or ``None`` (the default). If `inc` is

randomstate/shims/xorshift1024/xorshift1024.pxi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ Parameters
7575
----------
7676
seed : {None, int}, optional
7777
Random seed initializing the pseudo-random number generator.
78-
Can be an integer or ``None`` (the default).
79-
If `seed` is ``None``, then ``xorshift1024.RandomState`` will try to read data
80-
from ``/dev/urandom`` (or the Windows analogue) if available or seed from
81-
the clock otherwise.
78+
Can be an integer in [0, 2**64] or ``None`` (the default).
79+
If `seed` is ``None``, then ``xorshift1024.RandomState`` will try to read
80+
data from ``/dev/urandom`` (or the Windows analogue) if available. If
81+
unavailable, a 64-bit hash of the time and process ID is used.
8282
8383
Notes
8484
-----

randomstate/shims/xorshift128/xorshift128.pxi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ Parameters
7070
----------
7171
seed : {None, int}, optional
7272
Random seed initializing the pseudo-random number generator.
73-
Can be an integer or ``None`` (the default).
74-
If `seed` is ``None``, then ``xorshift128.RandomState`` will try to read data
75-
from ``/dev/urandom`` (or the Windows analogue) if available or seed from
76-
the clock otherwise.
73+
Can be an integer in [0, 2**64] or ``None`` (the default).
74+
If `seed` is ``None``, then ``xorshift128.RandomState`` will try to read
75+
data from ``/dev/urandom`` (or the Windows analogue) if available. If
76+
unavailable, a 64-bit hash of the time and process ID is used.
7777
7878
Notes
7979
-----

0 commit comments

Comments
 (0)