summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/random/__init__.py4
-rw-r--r--numpy/random/_bit_generator.pxd (renamed from numpy/random/bit_generator.pxd)0
-rw-r--r--numpy/random/_bit_generator.pyx (renamed from numpy/random/bit_generator.pyx)2
-rw-r--r--numpy/random/_bounded_integers.pxd2
-rw-r--r--numpy/random/_bounded_integers.pxd.in2
-rw-r--r--numpy/random/_common.pxd2
-rw-r--r--numpy/random/_generator.pyx (renamed from numpy/random/generator.pyx)2
-rw-r--r--numpy/random/_mt19937.pyx2
-rw-r--r--numpy/random/_pcg64.pyx2
-rw-r--r--numpy/random/_philox.pyx2
-rw-r--r--numpy/random/_pickle.py2
-rw-r--r--numpy/random/_sfc64.pyx2
-rw-r--r--numpy/random/mtrand.pyx2
-rw-r--r--numpy/random/setup.py13
-rw-r--r--numpy/random/tests/test_direct.py2
-rw-r--r--numpy/random/tests/test_seed_sequence.py2
-rw-r--r--numpy/tests/test_public_api.py2
17 files changed, 17 insertions, 28 deletions
diff --git a/numpy/random/__init__.py b/numpy/random/__init__.py
index 169b059b7..799700899 100644
--- a/numpy/random/__init__.py
+++ b/numpy/random/__init__.py
@@ -182,8 +182,8 @@ from . import _pickle
from . import _common
from . import _bounded_integers
-from .generator import Generator, default_rng
-from .bit_generator import SeedSequence
+from ._generator import Generator, default_rng
+from ._bit_generator import SeedSequence
from ._mt19937 import MT19937
from ._pcg64 import PCG64
from ._philox import Philox
diff --git a/numpy/random/bit_generator.pxd b/numpy/random/_bit_generator.pxd
index 30fa4a27d..30fa4a27d 100644
--- a/numpy/random/bit_generator.pxd
+++ b/numpy/random/_bit_generator.pxd
diff --git a/numpy/random/bit_generator.pyx b/numpy/random/_bit_generator.pyx
index 0d49ef171..b85f0a41b 100644
--- a/numpy/random/bit_generator.pyx
+++ b/numpy/random/_bit_generator.pyx
@@ -114,7 +114,7 @@ def _coerce_to_uint32_array(x):
Examples
--------
>>> import numpy as np
- >>> from numpy.random.bit_generator import _coerce_to_uint32_array
+ >>> from numpy.random._bit_generator import _coerce_to_uint32_array
>>> _coerce_to_uint32_array(12345)
array([12345], dtype=uint32)
>>> _coerce_to_uint32_array('12345')
diff --git a/numpy/random/_bounded_integers.pxd b/numpy/random/_bounded_integers.pxd
index fd7f1d3a2..d3ee97a70 100644
--- a/numpy/random/_bounded_integers.pxd
+++ b/numpy/random/_bounded_integers.pxd
@@ -4,7 +4,7 @@ import numpy as np
cimport numpy as np
ctypedef np.npy_bool bool_t
-from .bit_generator cimport bitgen_t
+from ._bit_generator cimport bitgen_t
cdef inline uint64_t _gen_mask(uint64_t max_val) nogil:
"""Mask generator for use in bounded random numbers"""
diff --git a/numpy/random/_bounded_integers.pxd.in b/numpy/random/_bounded_integers.pxd.in
index 894283c0b..320d35774 100644
--- a/numpy/random/_bounded_integers.pxd.in
+++ b/numpy/random/_bounded_integers.pxd.in
@@ -4,7 +4,7 @@ import numpy as np
cimport numpy as np
ctypedef np.npy_bool bool_t
-from .bit_generator cimport bitgen_t
+from ._bit_generator cimport bitgen_t
cdef inline uint64_t _gen_mask(uint64_t max_val) nogil:
"""Mask generator for use in bounded random numbers"""
diff --git a/numpy/random/_common.pxd b/numpy/random/_common.pxd
index 702bcb18f..74bebca83 100644
--- a/numpy/random/_common.pxd
+++ b/numpy/random/_common.pxd
@@ -5,7 +5,7 @@ from libc.stdint cimport uint32_t, uint64_t, int32_t, int64_t
import numpy as np
cimport numpy as np
-from .bit_generator cimport bitgen_t
+from ._bit_generator cimport bitgen_t
cdef double POISSON_LAM_MAX
cdef double LEGACY_POISSON_LAM_MAX
diff --git a/numpy/random/generator.pyx b/numpy/random/_generator.pyx
index b583b972b..f4c1d3772 100644
--- a/numpy/random/generator.pyx
+++ b/numpy/random/_generator.pyx
@@ -19,7 +19,7 @@ from ._bounded_integers cimport (_rand_bool, _rand_int32, _rand_int64,
_rand_uint8, _gen_mask)
from ._bounded_integers import _integers_types
from ._pcg64 import PCG64
-from .bit_generator cimport bitgen_t
+from ._bit_generator cimport bitgen_t
from ._common cimport (POISSON_LAM_MAX, CONS_POSITIVE, CONS_NONE,
CONS_NON_NEGATIVE, CONS_BOUNDED_0_1, CONS_BOUNDED_GT_0_1,
CONS_GT_1, CONS_POSITIVE_NOT_NAN, CONS_POISSON,
diff --git a/numpy/random/_mt19937.pyx b/numpy/random/_mt19937.pyx
index 24d4c19b6..206f164e1 100644
--- a/numpy/random/_mt19937.pyx
+++ b/numpy/random/_mt19937.pyx
@@ -4,7 +4,7 @@ import numpy as np
cimport numpy as np
from libc.stdint cimport uint32_t, uint64_t
-from .bit_generator cimport BitGenerator, SeedSequence
+from ._bit_generator cimport BitGenerator, SeedSequence
__all__ = ['MT19937']
diff --git a/numpy/random/_pcg64.pyx b/numpy/random/_pcg64.pyx
index 2886b0c82..2d5ade9f8 100644
--- a/numpy/random/_pcg64.pyx
+++ b/numpy/random/_pcg64.pyx
@@ -3,7 +3,7 @@ cimport numpy as np
from libc.stdint cimport uint32_t, uint64_t
from ._common cimport uint64_to_double, wrap_int
-from .bit_generator cimport BitGenerator
+from ._bit_generator cimport BitGenerator
__all__ = ['PCG64']
diff --git a/numpy/random/_philox.pyx b/numpy/random/_philox.pyx
index 1dd1972d4..4154e042c 100644
--- a/numpy/random/_philox.pyx
+++ b/numpy/random/_philox.pyx
@@ -10,7 +10,7 @@ cimport numpy as np
from libc.stdint cimport uint32_t, uint64_t
from ._common cimport uint64_to_double, int_to_array, wrap_int
-from .bit_generator cimport BitGenerator
+from ._bit_generator cimport BitGenerator
__all__ = ['Philox']
diff --git a/numpy/random/_pickle.py b/numpy/random/_pickle.py
index d71cf4311..29ff69644 100644
--- a/numpy/random/_pickle.py
+++ b/numpy/random/_pickle.py
@@ -3,7 +3,7 @@ from ._philox import Philox
from ._pcg64 import PCG64
from ._sfc64 import SFC64
-from .generator import Generator
+from ._generator import Generator
from ._mt19937 import MT19937
BitGenerators = {'MT19937': MT19937,
diff --git a/numpy/random/_sfc64.pyx b/numpy/random/_sfc64.pyx
index d1b0a0a52..842598e38 100644
--- a/numpy/random/_sfc64.pyx
+++ b/numpy/random/_sfc64.pyx
@@ -3,7 +3,7 @@ cimport numpy as np
from libc.stdint cimport uint32_t, uint64_t
from ._common cimport uint64_to_double
-from .bit_generator cimport BitGenerator
+from ._bit_generator cimport BitGenerator
__all__ = ['SFC64']
diff --git a/numpy/random/mtrand.pyx b/numpy/random/mtrand.pyx
index 3799754a7..326e8b45e 100644
--- a/numpy/random/mtrand.pyx
+++ b/numpy/random/mtrand.pyx
@@ -17,7 +17,7 @@ from ._bounded_integers cimport (_rand_bool, _rand_int32, _rand_int64,
_rand_uint8,)
from ._bounded_integers import _integers_types
from ._mt19937 import MT19937 as _MT19937
-from .bit_generator cimport bitgen_t
+from ._bit_generator cimport bitgen_t
from ._common cimport (POISSON_LAM_MAX, CONS_POSITIVE, CONS_NONE,
CONS_NON_NEGATIVE, CONS_BOUNDED_0_1, CONS_BOUNDED_GT_0_1, CONS_GTE_1,
CONS_GT_1, LEGACY_CONS_POISSON,
diff --git a/numpy/random/setup.py b/numpy/random/setup.py
index 463f483cd..ddb16339b 100644
--- a/numpy/random/setup.py
+++ b/numpy/random/setup.py
@@ -86,7 +86,7 @@ def configuration(parent_package='', top_path=None):
'bit_generator.pxd'],
define_macros=_defs,
)
- for gen in ['_common', 'bit_generator']:
+ for gen in ['_common', '_bit_generator']:
# gen.pyx
config.add_extension(gen,
sources=['{0}.c'.format(gen)],
@@ -102,7 +102,7 @@ def configuration(parent_package='', top_path=None):
'src/distributions/distributions.c',
'src/distributions/random_hypergeometric.c',
]
- for gen in ['generator', '_bounded_integers']:
+ for gen in ['_generator', '_bounded_integers']:
# gen.pyx, src/distributions/distributions.c
config.add_extension(gen,
sources=['{0}.c'.format(gen)] + other_srcs,
@@ -126,15 +126,6 @@ def configuration(parent_package='', top_path=None):
depends=['mtrand.pyx'],
define_macros=defs + LEGACY_DEFS,
)
- config.add_data_files('bit_generator.pxd')
- config.add_data_files('_bounded_integers.pxd')
- config.add_data_files('_common.pxd')
- # config.add_data_files('generator.pxd')
- # config.add_data_files('_mt19937.pxd')
- # config.add_data_files('_mtrand.pxd')
- # config.add_data_files('_pcg64.pxd')
- # config.add_data_files('_philox.pxd')
- # config.add_data_files('_sfc64.pxd')
return config
diff --git a/numpy/random/tests/test_direct.py b/numpy/random/tests/test_direct.py
index ca29c3544..34d7bd278 100644
--- a/numpy/random/tests/test_direct.py
+++ b/numpy/random/tests/test_direct.py
@@ -120,7 +120,7 @@ def gauss_from_uint(x, n, bits):
return gauss[:n]
def test_seedsequence():
- from numpy.random.bit_generator import (ISeedSequence,
+ from numpy.random._bit_generator import (ISeedSequence,
ISpawnableSeedSequence,
SeedlessSeedSequence)
diff --git a/numpy/random/tests/test_seed_sequence.py b/numpy/random/tests/test_seed_sequence.py
index 8d6d604a2..fdbc6081f 100644
--- a/numpy/random/tests/test_seed_sequence.py
+++ b/numpy/random/tests/test_seed_sequence.py
@@ -1,7 +1,7 @@
import numpy as np
from numpy.testing import assert_array_equal
-from numpy.random.bit_generator import SeedSequence
+from numpy.random._bit_generator import SeedSequence
def test_reference_data():
diff --git a/numpy/tests/test_public_api.py b/numpy/tests/test_public_api.py
index 8afcede0b..c71d03432 100644
--- a/numpy/tests/test_public_api.py
+++ b/numpy/tests/test_public_api.py
@@ -298,8 +298,6 @@ PRIVATE_BUT_PRESENT_MODULES = ['numpy.' + s for s in [
"ma.timer_comparison",
"matrixlib",
"matrixlib.defmatrix",
- "random.bit_generator",
- "random.generator",
"random.mtrand",
"testing.print_coercion_tables",
"testing.utils",