Skip to content

Commit 37d6d47

Browse files
committed
Merge pull request #14 from bashtage/reorg-mod
REF: Reorganize module
2 parents c5fe33e + 93a0ae0 commit 37d6d47

File tree

16 files changed

+37
-36
lines changed

16 files changed

+37
-36
lines changed

randomstate/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from __future__ import division, absolute_import, print_function
22

3-
from randomstate.mt19937 import *
4-
import randomstate.mlfg_1279_861 as mlfg_1279_861
5-
import randomstate.mrg32k3a as mrg32k3a
6-
import randomstate.pcg32 as pcg32
7-
import randomstate.pcg64 as pcg64
8-
import randomstate.xorshift1024 as xorshift1024
9-
import randomstate.xorshift128 as xorshift128
3+
from randomstate.prng.mt19937.mt19937 import *
4+
from randomstate.prng.mlfg_1279_861 import mlfg_1279_861
5+
from randomstate.prng.mrg32k3a import mrg32k3a
6+
from randomstate.prng.pcg32 import pcg32
7+
from randomstate.prng.pcg64 import pcg64
8+
from randomstate.prng.xorshift1024 import xorshift1024
9+
from randomstate.prng.xorshift128 import xorshift128

randomstate/performance.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
rs.random_sample()
1010
'''
1111

12+
SETUP_RS = '''
13+
import {mod}.{rng}
14+
rs = {mod}.{rng}.RandomState()
15+
rs.random_sample()
16+
'''
17+
1218
scale_32 = scale_64 = 1
1319
if sys.maxsize < 2 ** 32:
1420
# 32 bit
@@ -34,7 +40,7 @@ def run_timer(dist, command, numpy_command=None, setup='', random_type=''):
3440

3541
res = {}
3642
for rng in RNGS:
37-
mod = 'randomstate' if rng != 'random' else 'numpy'
43+
mod = 'randomstate.prng.' + rng if rng != 'random' else 'numpy'
3844
key = '-'.join((mod, rng, dist)).replace('"', '')
3945
command = numpy_command if 'numpy' in mod else command
4046
res[key] = timer(command.format(dist=dist), setup=setup.format(mod=mod, rng=rng))

randomstate/prng/__init__.py

Whitespace-only changes.

randomstate/prng/mlfg_1279_861/__init__.py

Whitespace-only changes.

randomstate/prng/mrg32k3a/__init__.py

Whitespace-only changes.

randomstate/prng/mt19937/__init__.py

Whitespace-only changes.

randomstate/prng/pcg32/__init__.py

Whitespace-only changes.

randomstate/prng/pcg64/__init__.py

Whitespace-only changes.

randomstate/prng/xorshift1024/__init__.py

Whitespace-only changes.

randomstate/prng/xorshift128/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)