Skip to content

Commit e1db360

Browse files
committed
Merge pull request #43 from bashtage/trusty-build
Trusty build
2 parents 93b582f + f9e19a2 commit e1db360

File tree

10 files changed

+57
-59
lines changed

10 files changed

+57
-59
lines changed

.travis.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@
22
# versions. Allows substantial flexability for choosing versions of
33
# required packages and is simpler to use to test up-to-date scientific Python
44
# stack
5-
sudo: false
6-
7-
language: python
5+
sudo: required
6+
dist: trusty
7+
language: generic
88

99
matrix:
1010
fast_finish: true
1111
include:
12-
- python: 2.7
13-
env:
12+
- env:
1413
- PYTHON=2.7
15-
- python: 2.7
16-
env:
14+
- env:
1715
- PYTHON=3.4
18-
- python: 2.7
19-
env:
16+
- env:
2017
- PYTHON=3.5
2118

2219
before_install:
@@ -35,13 +32,13 @@ before_install:
3532

3633
# Install packages
3734
install:
38-
- conda create -n rng-test ${PKGS} nose pip setuptools --quiet
39-
- source activate rng-test
40-
- export BUILD_DIR=$PWD
35+
- conda create -n randomstate-test ${PKGS} nose pip setuptools --quiet
36+
- source activate randomstate-test
4137
- python setup.py install
38+
- export BUILD_DIR=$PWD
39+
- cd $HOME
4240

4341
script:
44-
- cd $HOME
45-
- nosetests -vv randomstate
42+
- nosetests randomstate
4643
- cd $BUILD_DIR/randomstate
4744
- if [ ${PYTHON} = "2.7" ]; then python performance.py; fi

doc/source/parallel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Jump/Advance the PRNG state
3333
---------------------------
3434

3535
``jump`` advances the state of the PRNG *as-if* a large number of random
36-
number have been drawn. The specific number of draws varies by PRNG, and
36+
numbers have been drawn. The specific number of draws varies by PRNG, and
3737
ranges from :math:`2^{64}` to :math:`2^{512}`. Additionally, the *as-if*
3838
draws also depend on the size of the default random number produced by the
3939
specific PRNG. The PRNGs that support ``jump``, along with the period of

randomstate/interface/dSFMT/dSFMT.pxi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ seed : {None, int, array_like}, optional
110110
Can be an integer in [0, 2**32-1], array of integers in
111111
[0, 2**32-1] or ``None`` (the default). If `seed` is ``None``,
112112
then ``dSFMT.RandomState`` will try to read entropy from
113-
``/dev/urandom`` (or the Windows analogue) if available to
113+
``/dev/urandom`` (or the Windows analog) if available to
114114
produce a 64-bit seed. If unavailable, the a 64-bit hash of the time
115115
and process ID is used.
116116
@@ -125,9 +125,9 @@ number of probability distributions to choose from.
125125
**Parallel Features**
126126
127127
``dsfmt.RandomState`` can be used in parallel applications by
128-
calling the method ``jump`` which advances the the state as-if :math:`2^{128}`
129-
random numbers have been generated [2]_. This allow the original sequence to
130-
be split so that distinct segments can be used on each worker process. All
128+
calling the method ``jump`` which advances the state as-if :math:`2^{128}`
129+
random numbers have been generated [2]_. This allows the original sequence to
130+
be split so that distinct segments can be used in each worker process. All
131131
generators should be initialized with the same seed to ensure that the
132132
segments come from the same sequence.
133133
@@ -148,7 +148,7 @@ used here augments this with a 384 element array of doubles which are used
148148
to efficiently access the random numbers produced by the dSFMT generator.
149149
150150
``dsfmt.RandomState`` is seeded using either a single 32-bit unsigned integer
151-
or a vector of 32-bit unsigned integers. In either case the input seed is
151+
or a vector of 32-bit unsigned integers. In either case, the input seed is
152152
used as an input (or inputs) for a hashing function, and the output of the
153153
hashing function is used as the initial state. Using a single 32-bit value
154154
for the seed can only initialize a small range of the possible initial
@@ -171,7 +171,7 @@ have been generated.
171171
Parameters
172172
----------
173173
iter : integer, positive
174-
Number of times to jump the state of the rng.
174+
Number of times to jump the state of the prng.
175175
176176
Returns
177177
-------

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ RandomState(seed=None)
4848
4949
Container for a Multiplicative Lagged Fibonacci Generator (MLFG).
5050
51-
LFG(1279, 861, \*) is a 64-bit implementation of a MLFG that uses lags 1279 and
52-
861 where random numbers are determined by
51+
LFG(1279, 861, \*) is a 64-bit implementation of an MLFG that uses lags 1279
52+
and 861 where random numbers are determined by
5353
5454
.. math::
5555
@@ -83,7 +83,7 @@ seed : {None, int, array_like}, optional
8383
Can be an integer in [0, 2**64-1], array of integers in
8484
[0, 2**64-1] or ``None`` (the default). If `seed` is ``None``,
8585
then ``mlfg_1279_861.RandomState`` will try to read entropy from
86-
``/dev/urandom`` (or the Windows analogue) if available to
86+
``/dev/urandom`` (or the Windows analog) if available to
8787
produce a 64-bit seed. If unavailable, a 64-bit hash of the time
8888
and process ID is used.
8989
@@ -98,11 +98,11 @@ state array of the current and lagged values.
9898
The ``mlfg_1279_861.RandomState`` state vector consists of a 1279 element array
9999
of 64-bit unsigned integers plus a two integers value between 0 and 1278
100100
indicating the current position and the position of the lagged value within
101-
the main array required to produce the next random. All elements of the 1279
102-
element state array must be odd.
101+
the main array required to produce the next random. All 1279 elements of the
102+
state array must be odd.
103103
104104
``mlfg_1279_861.RandomState`` is seeded using either a single 64-bit unsigned integer
105-
or a vector of 64-bit unsigned integers. In either case the input seed is
105+
or a vector of 64-bit unsigned integers. In either case, the input seed is
106106
used as an input (or inputs) for another simple random number generator,
107107
Splitmix64, and the output of this PRNG function is used as the initial state.
108108
Using a single 64-bit value for the seed can only initialize a small range of

randomstate/interface/mrg32k3a/mrg32k3a.pxi

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ cdef void jump_state(aug_state* state):
106106
DEF CLASS_DOCSTRING = u"""
107107
RandomState(seed=None)
108108
109-
Container for L'Ecuyer MRG32K3A pseudo random number generator.
109+
Container for L'Ecuyer MRG32K3A pseudo-random number generator.
110110
111111
MRG32K3A is a 32-bit implementation of L'Ecuyer's combined multiple
112112
recursive generator [1]_, [2]_. MRG32K3A has a period of :math:`2^{191}`,
@@ -136,23 +136,24 @@ seed : {None, int, array_like}, optional
136136
Can be an integer in [0, 2**64-1], array of integers in
137137
[0, 2**64-1] or ``None`` (the default). If `seed` is ``None``,
138138
then ``mrg32k3a.RandomState`` will try to read data from
139-
``/dev/urandom`` (or the Windows analogue) if available. If
139+
``/dev/urandom`` (or the Windows analog) if available. If
140140
unavailable, a 64-bit hash of the time and process ID is used.
141141
142142
Notes
143143
-----
144144
The state of the MRG32KA PRNG is represented by 6 64-bit integers.
145145
146146
This implementation is integer based and produces integers in the interval
147-
:math:`[0, 2^{32}-209+1]`. These are treated as if they 32-bit random integers.
147+
:math:`[0, 2^{32}-209+1]`. These are treated as if they 32-bit random
148+
integers.
148149
149150
**Parallel Features**
150151
151152
``mrg32k3a.RandomState`` can be used in parallel applications by
152-
calling the method ``jump`` which advances the
153-
the state as-if :math:`2^{127}` random numbers have been generated [3]_. This
154-
allow the original sequence to be split so that distinct segments can be used
155-
on each worker process. All generators should be initialized with the same
153+
calling the method ``jump`` which advances the state as-if
154+
:math:`2^{127}` random numbers have been generated [3]_. This
155+
allows the original sequence to be split so that distinct segments can be used
156+
in each worker process. All generators should be initialized with the same
156157
seed to ensure that the segments come from the same sequence.
157158
158159
>>> import randomstate.prng.mrg32k3a as rnd
@@ -170,7 +171,7 @@ elements of the state vector are in [0, 4294967087) and the second 3 are
170171
in [0, 4294944443).
171172
172173
``mrg32k3a.RandomState`` is seeded using either a single 64-bit unsigned integer
173-
or a vector of 64-bit unsigned integers. In either case the input seed is
174+
or a vector of 64-bit unsigned integers. In either case, the input seed is
174175
used as an input (or inputs) for another simple random number generator,
175176
Splitmix64, and the output of this PRNG function is used as the initial state.
176177
Using a single 64-bit value for the seed can only initialize a small range of

randomstate/interface/pcg-32/pcg-32.pxi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ cdef object _set_state(aug_state *state, object state_info):
3838
DEF CLASS_DOCSTRING = u"""
3939
RandomState(seed=None)
4040
41-
Container for the PCG-32 pseudo random number generator.
41+
Container for the PCG-32 pseudo-random number generator.
4242
4343
PCG-32 is a 64-bit implementation of O'Neill's permutation congruential
4444
generator ([1]_, [2]_). PCG-32 has a period of :math:`2^{64}` and supports advancing
@@ -67,7 +67,7 @@ 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. If
70+
from ``/dev/urandom`` (or the Windows analog) if available. If
7171
unavailable, a 64-bit hash of the time and process ID is used.
7272
inc : {None, int}, optional
7373
Stream to return.
@@ -104,7 +104,7 @@ in parallel applications is not recommended.
104104
105105
**State and Seeding**
106106
107-
The ``pcg32.RandomState`` state vector consists of 2 unsigned 64 bit values.
107+
The ``pcg32.RandomState`` state vector consists of 2 unsigned 64-bit values.
108108
``pcg32.RandomState`` is seeded using a single 64-bit unsigned integer.
109109
In addition, a second 64-bit unsigned integer is used to set the stream.
110110

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
DEF CLASS_DOCSTRING = u"""
22
RandomState(seed=None)
33
4-
Container for the PCG-64 pseudo random number generator.
4+
Container for the PCG-64 pseudo-random number generator.
55
66
PCG-64 is a 128-bit implementation of O'Neill's permutation congruential
77
generator ([1]_, [2]_). PCG-64 has a period of :math:`2^{128}` and supports advancing
@@ -30,7 +30,7 @@ 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. If
33+
from ``/dev/urandom`` (or the Windows analog) if available. If
3434
unavailable, a 64-bit hash of the time and process ID is used.
3535
inc : {None, int}, optional
3636
Stream to return.
@@ -64,7 +64,7 @@ produce non-overlapping sequences.
6464
6565
**State and Seeding**
6666
67-
The ``pcg64.RandomState`` state vector consists of 2 unsigned 128 bit values,
67+
The ``pcg64.RandomState`` state vector consists of 2 unsigned 128-bit values,
6868
which are represented externally as python longs (2.x) or ints (Python 3+).
6969
``pcg64.RandomState`` is seeded using a single 128-bit unsigned integer
7070
(Python long/int). In addition, a second 128-bit unsigned integer is used

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ seed : {None, int, array_like}, optional
7575
Can be an integer, an array (or other sequence) of integers of
7676
any length, or ``None`` (the default).
7777
If `seed` is ``None``, then ``RandomState`` will try to read data from
78-
``/dev/urandom`` (or the Windows analogue) if available or seed from
78+
``/dev/urandom`` (or the Windows analog) if available or seed from
7979
the clock otherwise.
8080
8181
Notes

randomstate/interface/xorshift1024/xorshift1024.pxi

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ cdef object _set_state(aug_state *state, object state_info):
4949
DEF CLASS_DOCSTRING = u"""
5050
RandomState(seed=None)
5151
52-
Container for the xorshift1024* pseudo random number generator.
52+
Container for the xorshift1024* pseudo-random number generator.
5353
5454
xorshift1024* is a 64-bit implementation of Saito and Matsumoto's XSadd
5555
generator [1]_. xorshift1024* has a period of :math:`2^{1024} - 1` and
56-
supports jumping the sequence in increments of :math:`2^{512}`, which allow multiple
57-
non-overlapping sequences to be generated.
56+
supports jumping the sequence in increments of :math:`2^{512}`, which allows
57+
multiple non-overlapping sequences to be generated.
5858
5959
``xorshift1024.RandomState`` exposes a number of methods for generating random
6060
numbers drawn from a variety of probability distributions. In addition to the
@@ -80,7 +80,7 @@ seed : {None, int, array_like}, optional
8080
Can be an integer in [0, 2**64-1], array of integers in
8181
[0, 2**64-1] or ``None`` (the default). If `seed` is ``None``,
8282
then ``xorshift1024.RandomState`` will try to read data from
83-
``/dev/urandom`` (or the Windows analogue) if available. If
83+
``/dev/urandom`` (or the Windows analog) if available. If
8484
unavailable, a 64-bit hash of the time and process ID is used.
8585
8686
Notes
@@ -90,10 +90,10 @@ See xorshift128 for a faster implementation that has a smaller period.
9090
**Parallel Features**
9191
9292
``xorshift1024.RandomState`` can be used in parallel applications by
93-
calling the method ``jump`` which advances the
94-
the state as-if :math:`2^{512}` random numbers have been generated. This
95-
allow the original sequence to be split so that distinct segments can be used
96-
on each worker process. All generators should be initialized with the same
93+
calling the method ``jump`` which advances the state as-if
94+
:math:`2^{512}` random numbers have been generated. This
95+
allows the original sequence to be split so that distinct segments can be used
96+
in each worker process. All generators should be initialized with the same
9797
seed to ensure that the segments come from the same sequence.
9898
9999
>>> import randomstate.prng.xorshift1024 as rnd
@@ -108,7 +108,7 @@ The ``xorshift1024.RandomState`` state vector consists of a 16 element array
108108
of 64-bit unsigned integers.
109109
110110
``xorshift1024.RandomState`` is seeded using either a single 64-bit unsigned integer
111-
or a vector of 64-bit unsigned integers. In either case the input seed is
111+
or a vector of 64-bit unsigned integers. In either case, the input seed is
112112
used as an input (or inputs) for another simple random number generator,
113113
Splitmix64, and the output of this PRNG function is used as the initial state.
114114
Using a single 64-bit value for the seed can only initialize a small range of

randomstate/interface/xorshift128/xorshift128.pxi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ cdef inline object _set_state(aug_state *state, object state_info):
4444
DEF CLASS_DOCSTRING = u"""
4545
RandomState(seed=None)
4646
47-
Container for the xorshift128+ pseudo random number generator.
47+
Container for the xorshift128+ pseudo-random number generator.
4848
4949
xorshift128+ is a 64-bit implementation of Saito and Matsumoto's XSadd
5050
generator [1]_. xorshift128+ has a period of :math:`2^{128} - 1` and
51-
supports jumping the sequence in increments of :math:`2^{64}`, which allow multiple
52-
non-overlapping sequences to be generated.
51+
supports jumping the sequence in increments of :math:`2^{64}`, which allows
52+
multiple non-overlapping sequences to be generated.
5353
5454
``xorshift128.RandomState`` exposes a number of methods for generating random
5555
numbers drawn from a variety of probability distributions. In addition to the
@@ -75,7 +75,7 @@ seed : {None, int, array_like}, optional
7575
Can be an integer in [0, 2**64-1], array of integers in
7676
[0, 2**64-1] or ``None`` (the default). If `seed` is ``None``,
7777
then ``xorshift128.RandomState`` will try to read data from
78-
``/dev/urandom`` (or the Windows analogue) if available. If
78+
``/dev/urandom`` (or the Windows analog) if available. If
7979
unavailable, a 64-bit hash of the time and process ID is used.
8080
8181
Notes
@@ -86,10 +86,10 @@ See xorshift1024 for an implementation with a larger period
8686
**Parallel Features**
8787
8888
``xorshift128.RandomState`` can be used in parallel applications by
89-
calling the method ``jump`` which advances the
90-
the state as-if :math:`2^{64}` random numbers have been generated. This
89+
calling the method ``jump`` which advances the state as-if
90+
:math:`2^{64}` random numbers have been generated. This
9191
allow the original sequence to be split so that distinct segments can be used
92-
on each worker process. All generators should be initialized with the same
92+
in each worker process. All generators should be initialized with the same
9393
seed to ensure that the segments come from the same sequence.
9494
9595
>>> import randomstate.prng.xorshift128 as rnd
@@ -104,7 +104,7 @@ The ``xorshift128.RandomState`` state vector consists of a 2 element array
104104
of 64-bit unsigned integers.
105105
106106
``xorshift128.RandomState`` is seeded using either a single 64-bit unsigned integer
107-
or a vector of 64-bit unsigned integers. In either case the input seed is
107+
or a vector of 64-bit unsigned integers. In either case, the input seed is
108108
used as an input (or inputs) for another simple random number generator,
109109
Splitmix64, and the output of this PRNG function is used as the initial state.
110110
Using a single 64-bit value for the seed can only initialize a small range of

0 commit comments

Comments
 (0)