8000 BUG: __dealloc__ can be called without __init__ in some error modes · numpy/numpy@9578dcf · GitHub
[go: up one dir, main page]

Skip to content

Commit 9578dcf

Browse files
committed
BUG: __dealloc__ can be called without __init__ in some error modes
skip doctests that require scipy move original mtrand module to _mtrand adjust documentation for namespace change
1 parent c53b2eb commit 9578dcf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+326
-282
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ benchmarks/env
175175
benchmarks/numpy
176176
# cythonized files
177177
cythonize.dat
178-
numpy/random/mtrand/mtrand.c
178+
numpy/random/_mtrand/_mtrand.c
179179
numpy/random/*.c
180180
numpy/random/legacy/*.c
181181
numpy/random/_mtrand/randint_helpers.pxi

benchmarks/benchmarks/bench_random.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
import numpy as np
66

7-
from numpy.random import RandomState
8-
from numpy.random.randomgen import RandomGenerator
7+
from numpy.random import RandomState, RandomGenerator
98

109
class Random(Benchmark):
1110
params = ['normal', 'uniform', 'weibull 1', 'binomial 10 0.5',
@@ -95,7 +94,7 @@ def setup(self, brng):
9594
if brng == 'numpy':
9695
self.rg = np.random.RandomState()
9796
else:
98-
self.rg = RandomGenerator(getattr(np.random.randomgen, brng)())
97+
self.rg = RandomGenerator(getattr(np.random, brng)())
9998
self.rg.random_sample()
10099
self.int32info = np.iinfo(np.int32)
101100
self.uint32info = np.iinfo(np.uint32)
@@ -149,7 +148,7 @@ def setup(self, brng, args):
149148
if brng == 'numpy':
150149
self.rg = np.random.RandomState()
151150
else:
152-
self.rg = RandomGenerator(getattr(np.random.randomgen, brng)())
151+
self.rg = RandomGenerator(getattr(np.random, brng)())
153152
self.rg.random_sample()
154153

155154
def time_bounded(self, brng, args):

doc/source/reference/randomgen/brng/dsfmt.rst renamed to doc/source/reference/random/brng/dsfmt.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Double SIMD Mersenne Twister (dSFMT)
22
------------------------------------
33

4-
.. module:: numpy.random.randomgen.dsfmt
4+
.. module:: numpy.random.dsfmt
55

6-
.. currentmodule:: numpy.random.randomgen.dsfmt
6+
.. currentmodule:: numpy.random.dsfmt
77

88

99
.. autoclass:: DSFMT

doc/source/reference/randomgen/brng/index.rst renamed to doc/source/reference/random/brng/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
Basic Random Number Generators
22
------------------------------
33

4-
The random values produced by :class:`~randomgen.generator.RandomGenerator`
4+
.. currentmodule:: numpy.random
5+
6+
The random values produced by :class:`~RandomGenerator`
57
are produced by a basic RNG. These basic RNGs do not directly provide
68
random numbers and only contains methods used for seeding, getting or
79
setting the state, jumping or advancing the state, and for accessing

doc/source/reference/randomgen/brng/mt19937.rst renamed to doc/source/reference/random/brng/mt19937.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Mersenne Twister (MT19937)
22
--------------------------
33

4-
.. module:: numpy.random.randomgen.mt19937
4+
.. module:: numpy.random.mt19937
55

6-
.. currentmodule:: numpy.random.randomgen.mt19937
6+
.. currentmodule:: numpy.random.mt19937
77

88
.. autoclass:: MT19937
99
:exclude-members:

doc/source/reference/randomgen/brng/pcg32.rst renamed to doc/source/reference/random/brng/pcg32.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Parallel Congruent Generator (32-bit, PCG32)
22
--------------------------------------------
33

4-
.. module:: numpy.random.randomgen.pcg32
4+
.. module:: numpy.random.pcg32
55

6-
.. currentmodule:: numpy.random.randomgen.pcg32
6+
.. currentmodule:: numpy.random.pcg32
77

88
.. autoclass:: PCG32
99
:exclude-members:

doc/source/reference/randomgen/brng/pcg64.rst renamed to doc/source/reference/random/brng/pcg64.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Parallel Congruent Generator (64-bit, PCG64)
22
--------------------------------------------
33

4-
.. module:: numpy.random.randomgen.pcg64
4+
.. module:: numpy.random.pcg64
55

6-
.. currentmodule:: numpy.random.randomgen.pcg64
6+
.. currentmodule:: numpy.random.pcg64
77

88
.. autoclass:: PCG64
99
:exclude-members:

doc/source/reference/randomgen/brng/philox.rst renamed to doc/source/reference/random/brng/philox.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Philox Counter-based RNG
22
------------------------
33

4-
.. module:: numpy.random.randomgen.philox
4+
.. module:: numpy.random.philox
55

6-
.. currentmodule:: numpy.random.randomgen.philox
6+
.. currentmodule:: numpy.random.philox
77

88
.. autoclass:: Philox
99
:exclude-members:

doc/source/reference/randomgen/brng/threefry.rst renamed to doc/source/reference/random/brng/threefry.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
ThreeFry Counter-based RNG
22
--------------------------
33

4-
.. module:: numpy.random.randomgen.threefry
4+
.. module:: numpy.random.threefry
55

6-
.. currentmodule:: numpy.random.randomgen.threefry
6+
.. currentmodule:: numpy.random.threefry
77

88
.. autoclass:: ThreeFry
99
:exclude-members:

doc/source/reference/randomgen/brng/threefry32.rst renamed to doc/source/reference/random/brng/threefry32.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
ThreeFry32 Counter-based RNG
22
----------------------------
33

4-
.. module:: numpy.random.randomgen.threefry32
4+
.. module:: numpy.random.threefry32
55

6-
.. currentmodule:: numpy.random.randomgen.threefry32
6+
.. currentmodule:: numpy.random.threefry32
77

88
.. autoclass:: ThreeFry32
99
:exclude-members:

0 commit comments

Comments
 (0)
0