Skip to content

Commit 3ed6bc9

Browse files
committed
Merge pull request #55 from bashtage/add-tempita-integers
REF: Switch common integer code to tempita
2 parents 56b2c82 + 243666d commit 3ed6bc9

10 files changed

+165
-267
lines changed

.travis.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
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: required
5+
group: edge
66
dist: trusty
7-
language: generic
7+
sudo: required
8+
language: python
9+
10+
services:
11+
- docker
12+
13+
before_install:
14+
- docker pull ubuntu:16.04
815

916
matrix:
1017
fast_finish: true
@@ -38,6 +45,7 @@ before_install:
3845
install:
3946
- conda create -n randomstate-test ${PKGS} nose pip setuptools --quiet
4047
- source activate randomstate-test
48+
- pip install tempita
4149
- python setup.py install
4250
- export BUILD_DIR=$PWD
4351
- cd $HOME

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,12 @@ need to be smoothed.
100100
## Requirements
101101
Building requires:
102102

103+
* Python (2.7, 3.4, 3.5)
103104
* Numpy (1.9, 1.10, 1.11)
104105
* Cython (0.22, 0.23, 0.24)
105-
* Python (2.7, 3.4, 3.5)
106+
* tempita (0.5+), if not provided by Cython
107+
108+
Testing requires nose (1.3+).
106109

107110
**Note:** it might work with other versions but only tested with these
108111
versions.

README.rst

+47-33
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Features
2222
same seed, same random numbers).
2323
- Support for random number generators that support independent streams
2424
and jumping ahead so that substreams can be generated
25-
- Faster random number generations, especially for Normals using the
25+
- Faster random number generation, especially for Normals using the
2626
Ziggurat method
2727

2828
.. code:: python
@@ -58,8 +58,8 @@ New Features
5858
- ``standard_normal``, ``normal``, ``randn`` and
5959
``multivariate_normal`` all support an additional ``method`` keyword
6060
argument which can be ``bm`` or ``zig`` where ``bm`` corresponds to
61-
the current method and ``zig`` uses the much faster (100%+) ziggurat
62-
method.
61+
the current method using the Box-Muller transformation and ``zig``
62+
uses the much faster (100%+) ziggurat method.
6363

6464
New Functions
6565
~~~~~~~~~~~~~
@@ -68,9 +68,8 @@ New Functions
6868
commonly used in cryptographic applications
6969
- ``random_uintegers`` - unsigned integers ``[0, 2**64-1]``
7070
- ``random_raw`` - Direct access to the values produced by the
71-
underlying PRNG.
72-
The range of the values returned depends on the specifics of the PRNG
73-
implementation.
71+
underlying PRNG. The range of the values returned depends on the
72+
specifics of the PRNG implementation.
7473
- ``jump`` - Jumps RNGs that support it. ``jump`` moves the state a
7574
great distance. *Only available if supported by the RNG.*
7675
- ``advance`` - Advanced the core RNG 'as-if' a number of draws were
@@ -85,7 +84,7 @@ Status
8584
and will produce an identical sequence of random numbers for a given
8685
seed.
8786
- Builds and passes all tests on:
88-
- Linux 32/64 bit, Python 2.6, 2.7, 3.3, 3.4, 3.5
87+
- Linux 32/64 bit, Python 2.7, 3.4, 3.5 (should work on 2.6 and 3.3)
8988
- PC-BSD (FreeBSD) 64-bit, Python 2.7
9089
- OSX 64-bit, Python 2.7
9190
- Windows 32/64 bit (only tested on Python 2.7 and 3.5, but should work
@@ -118,9 +117,12 @@ Requirements
118117

119118
Building requires:
120119

120+
- Python (2.7, 3.4, 3.5)
121121
- Numpy (1.9, 1.10, 1.11)
122122
- Cython (0.22, 0.23, 0.24)
123-
- Python (2.6, 2.7, 3.3, 3.4, 3.5)
123+
- tempita (0.5+), if not provided by Cython
124+
125+
Testing requires nose (1.3+).
124126

125127
**Note:** it might work with other versions but only tested with these
126128
versions.
@@ -154,10 +156,10 @@ or are building on non-x86, you can install using:
154156
Windows
155157
~~~~~~~
156158

157-
Either use a binary installer or if building from scratch using Python
158-
3.5 and the free Visual Studio 2015 Community Edition. It can also be
159-
build using Microsoft Visual C++ Compiler for Python 2.7 and Python 2.7,
160-
although some modifications are needed to ``distutils`` to find the
159+
Either use a binary installer, or if building from scratch, use Python
160+
3.5 with Visual Studio 2015 Community Edition. It can also be build
161+
using Microsoft Visual C++ Compiler for Python 2.7 and Python 2.7,
162+
although some modifications may be needed to ``distutils`` to find the
161163
compiler.
162164

163165
Using
@@ -202,29 +204,41 @@ NumPy's mt19937.
202204

203205
::
204206

205-
Speed-up relative to NumPy (Box-Muller)
207+
Speed-up relative to NumPy (Uniform Doubles)
208+
************************************************************
209+
randomstate.prng-dsfmt-random_sample 313.5%
210+
randomstate.prng-mlfg_1279_861-random_sample 459.4%
211+
randomstate.prng-mrg32k3a-random_sample -57.6%
212+
randomstate.prng-mt19937-random_sample 72.5%
213+
randomstate.prng-pcg32-random_sample 232.8%
214+
randomstate.prng-pcg64-random_sample 330.6%
215+
randomstate.prng-xoroshiro128plus-random_sample 609.9%
216+
randomstate.prng-xorshift1024-random_sample 348.8%
217+
randomstate.prng-xorshift128-random_sample 489.7%
218+
219+
Speed-up relative to NumPy (Normals using Box-Muller)
206220
************************************************************
207-
randomstate.prng-dsfmt-standard_normal 30.2%
208-
randomstate.prng-mlfg_1279_861-standard_normal 24.7%
209-
randomstate.prng-mrg32k3a-standard_normal -17.8%
210-
randomstate.prng-mt19937-standard_normal 11.2%
211-
randomstate.prng-pcg32-standard_normal 22.0%
212-
randomstate.prng-pcg64-standard_normal 21.8%
213-
randomstate.prng-xoroshiro128plus-standard_normal 26.5%
214-
randomstate.prng-xorshift1024-standard_normal 20.2%
215-
randomstate.prng-xorshift128-standard_normal 23.5%
216-
217-
Speed-up relative to NumPy (Ziggurat)
221+
randomstate.prng-dsfmt-standard_normal 26.8%
222+
randomstate.prng-mlfg_1279_861-standard_normal 30.9%
223+
randomstate.prng-mrg32k3a-standard_normal -14.8%
224+
randomstate.prng-mt19937-standard_normal 17.7%
225+
randomstate.prng-pcg32-standard_normal 24.5%
226+
randomstate.prng-pcg64-standard_normal 26.2%
227+
randomstate.prng-xoroshiro128plus-standard_normal 31.4%
228+
randomstate.prng-xorshift1024-standard_normal 27.4%
229+
randomstate.prng-xorshift128-standard_normal 30.3%
230+
231+
Speed-up relative to NumPy (Normals using Ziggurat)
218232
************************************************************
219-
randomstate.prng-dsfmt-standard_normal 494.2%
220-
randomstate.prng-mlfg_1279_861-standard_normal 464.2%
221-
randomstate.prng-mrg32k3a-standard_normal 103.8%
222-
randomstate.prng-mt19937-standard_normal 362.6%
223-
randomstate.prng-pcg32-standard_normal 539.6%
224-
randomstate.prng-pcg64-standard_normal 407.7%
225-
randomstate.prng-xoroshiro128plus-standard_normal 722.8%
226-
randomstate.prng-xorshift1024-standard_normal 506.1%
227-
randomstate.prng-xorshift128-standard_normal 686.3%
233+
randomstate.prng-dsfmt-standard_normal 491.7%
234+
randomstate.prng-mlfg_1279_861-standard_normal 439.6%
235+
randomstate.prng-mrg32k3a-standard_normal 101.2%
236+
randomstate.prng-mt19937-standard_normal 354.4%
237+
randomstate.prng-pcg32-standard_normal 531.0%
238+
randomstate.prng-pcg64-standard_normal 517.9%
239+
randomstate.prng-xoroshiro128plus-standard_normal 674.0%
240+
randomstate.prng-xorshift1024-standard_normal 486.7%
241+
randomstate.prng-xorshift128-standard_normal 617.0%
228242

229243
.. |Travis Build Status| image:: https://travis-ci.org/bashtage/ng-numpy-randomstate.svg?branch=master
230244
:target: https://travis-ci.org/bashtage/ng-numpy-randomstate

0 commit comments

Comments
 (0)