Skip to content

Commit e97a060

Browse files
committed
Merge pull request #48 from bashtage/update-latest-numpy
UPD: Update docstring to latest NumPy
2 parents 53648c0 + eb3ef91 commit e97a060

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

randomstate/interface/random-kit/random-kit.pxi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ previous behavior remains unchanged.
7171
Parameters
7272
----------
7373
seed : {None, int, array_like}, optional
74-
Random seed initializing the pseudo-random number generator.
75-
Can be an integer, an array (or other sequence) of integers of
76-
any length, or ``None`` (the default).
77-
If `seed` is ``None``, then ``RandomState`` will try to read data from
74+
Random seed used to initialize the pseudo-random number generator. Can
75+
be any integer between 0 and 2**32 - 1 inclusive, an array (or other
76+
sequence) of such integers, or ``None`` (the default). If `seed` is
77+
``None``, then `RandomState` will try to read data from
7878
``/dev/urandom`` (or the Windows analog) if available or seed from
7979
the clock otherwise.
8080
@@ -85,4 +85,4 @@ pseudo-random number generator with a number of methods that are similar
8585
to the ones available in ``RandomState``. ``RandomState``, besides being
8686
NumPy-aware, has the advantage that it provides a much larger number
8787
of probability distributions to choose from.
88-
"""
88+
"""

randomstate/randomstate.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ cdef class RandomState:
226226
else:
227227
idx = operator.index(seed)
228228
if idx > int(2**32 - 1) or idx < 0:
229-
raise ValueError("Seed must be between 0 and 4294967295")
229+
raise ValueError("Seed must be between 0 and 2**32 - 1")
230230
with self.lock:
231231
set_seed(&self.rng_state, seed)
232232
except TypeError:
233233
obj = np.asarray(seed).astype(np.int64, casting='safe')
234234
if ((obj > int(2**32 - 1)) | (obj < 0)).any():
235-
raise ValueError("Seed must be between 0 and 4294967295")
235+
raise ValueError("Seed must be between 0 and 2**32 - 1")
236236
obj = obj.astype(np.uint32, casting='unsafe', order='C')
237237
with self.lock:
238238
set_seed_by_array(&self.rng_state,

0 commit comments

Comments
 (0)