diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2019-11-20 13:39:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-20 13:39:02 -0700 |
commit | d428127183d46b2fbd99afefa4670642addf8d6e (patch) | |
tree | 692114515b9752d6c9817922976429cdb1105405 | |
parent | 9ec8474b13d73a9da3febf35ef35f7b55138772d (diff) | |
parent | f3fde3c4d0acba41122a6d87c0315064579fad6a (diff) | |
download | numpy-d428127183d46b2fbd99afefa4670642addf8d6e.tar.gz |
Merge pull request #14944 from mattip/move-examples
MAINT: move numpy/random/examples -> numpy/random/_examples
15 files changed, 12 insertions, 13 deletions
diff --git a/doc/source/reference/random/examples/cython/extending.pyx.rst b/doc/source/reference/random/examples/cython/extending.pyx.rst index bc31488d7..e2bba5aa4 100644 --- a/doc/source/reference/random/examples/cython/extending.pyx.rst +++ b/doc/source/reference/random/examples/cython/extending.pyx.rst @@ -1,5 +1,5 @@ extending.pyx ------------- -.. literalinclude:: ../../../../../../numpy/random/examples/cython/extending.pyx +.. literalinclude:: ../../../../../../numpy/random/_examples/cython/extending.pyx :language: cython diff --git a/doc/source/reference/random/examples/cython/extending_distributions.pyx.rst b/doc/source/reference/random/examples/cython/extending_distributions.pyx.rst index a1bb01f45..f64921c67 100644 --- a/doc/source/reference/random/examples/cython/extending_distributions.pyx.rst +++ b/doc/source/reference/random/examples/cython/extending_distributions.pyx.rst @@ -1,5 +1,5 @@ extending_distributions.pyx --------------------------- -.. literalinclude:: ../../../../../../numpy/random/examples/cython/extending_distributions.pyx +.. literalinclude:: ../../../../../../numpy/random/_examples/cython/extending_distributions.pyx :language: cython diff --git a/doc/source/reference/random/examples/cython/setup.py.rst b/doc/source/reference/random/examples/cython/setup.py.rst index 381b45fd4..bc7a74c59 100644 --- a/doc/source/reference/random/examples/cython/setup.py.rst +++ b/doc/source/reference/random/examples/cython/setup.py.rst @@ -1,5 +1,5 @@ setup.py -------- -.. literalinclude:: ../../../../../../numpy/random/examples/cython/setup.py +.. literalinclude:: ../../../../../../numpy/random/_examples/cython/setup.py :language: python diff --git a/doc/source/reference/random/examples/numba.rst b/doc/source/reference/random/examples/numba.rst index a780afde7..b41a02568 100644 --- a/doc/source/reference/random/examples/numba.rst +++ b/doc/source/reference/random/examples/numba.rst @@ -1,5 +1,5 @@ Extending via Numba ------------------- -.. literalinclude:: ../../../../../numpy/random/examples/numba/extending.py +.. literalinclude:: ../../../../../numpy/random/_examples/numba/extending.py :language: python diff --git a/doc/source/reference/random/examples/numba_cffi.rst b/doc/source/reference/random/examples/numba_cffi.rst index ad4767a7a..fb2f85cce 100644 --- a/doc/source/reference/random/examples/numba_cffi.rst +++ b/doc/source/reference/random/examples/numba_cffi.rst @@ -1,5 +1,5 @@ Extending via Numba and CFFI ---------------------------- -.. literalinclude:: ../../../../../numpy/random/examples/numba/extending_distributions.py +.. literalinclude:: ../../../../../numpy/random/_examples/numba/extending_distributions.py :language: python diff --git a/doc/source/reference/random/extending.rst b/doc/source/reference/random/extending.rst index c63fb1a1b..7b1168c45 100644 --- a/doc/source/reference/random/extending.rst +++ b/doc/source/reference/random/extending.rst @@ -16,7 +16,7 @@ This example shows how numba can be used to produce gaussian samples using a pure Python implementation which is then compiled. The random numbers are provided by ``ctypes.next_double``. -.. literalinclude:: ../../../../numpy/random/examples/numba/extending.py +.. literalinclude:: ../../../../numpy/random/_examples/numba/extending.py :language: python :end-before: example 2 @@ -35,14 +35,14 @@ This example uses `PCG64` and the example from above. The usual caveats for writing high-performance code using Cython -- removing bounds checks and wrap around, providing array alignment information -- still apply. -.. literalinclude:: ../../../../numpy/random/examples/cython/extending_distributions.pyx +.. literalinclude:: ../../../../numpy/random/_examples/cython/extending_distributions.pyx :language: cython :end-before: example 2 The BitGenerator can also be directly accessed using the members of the basic RNG structure. -.. literalinclude:: ../../../../numpy/random/examples/cython/extending_distributions.pyx +.. literalinclude:: ../../../../numpy/random/_examples/cython/extending_distributions.pyx :language: cython :start-after: example 2 diff --git a/numpy/random/examples/cython/extending.pyx b/numpy/random/_examples/cython/extending.pyx index 2a866648d..2a866648d 100644 --- a/numpy/random/examples/cython/extending.pyx +++ b/numpy/random/_examples/cython/extending.pyx diff --git a/numpy/random/examples/cython/extending_distributions.pyx b/numpy/random/_examples/cython/extending_distributions.pyx index d17da45c1..d17da45c1 100644 --- a/numpy/random/examples/cython/extending_distributions.pyx +++ b/numpy/random/_examples/cython/extending_distributions.pyx diff --git a/numpy/random/examples/cython/setup.py b/numpy/random/_examples/cython/setup.py index 315527a2d..315527a2d 100644 --- a/numpy/random/examples/cython/setup.py +++ b/numpy/random/_examples/cython/setup.py diff --git a/numpy/random/examples/numba/extending.py b/numpy/random/_examples/numba/extending.py index 0d240596b..0d240596b 100644 --- a/numpy/random/examples/numba/extending.py +++ b/numpy/random/_examples/numba/extending.py diff --git a/numpy/random/examples/numba/extending_distributions.py b/numpy/random/_examples/numba/extending_distributions.py index 9233ccced..9233ccced 100644 --- a/numpy/random/examples/numba/extending_distributions.py +++ b/numpy/random/_examples/numba/extending_distributions.py diff --git a/numpy/random/examples/__init__.py b/numpy/random/examples/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/numpy/random/examples/__init__.py +++ /dev/null diff --git a/numpy/random/setup.py b/numpy/random/setup.py index 93d5144ea..776a018bc 100644 --- a/numpy/random/setup.py +++ b/numpy/random/setup.py @@ -34,7 +34,7 @@ def configuration(parent_package='', top_path=None): defs.append(('NPY_NO_DEPRECATED_API', 0)) config.add_data_dir('tests') - config.add_data_dir('examples') + config.add_data_dir('_examples') EXTRA_LINK_ARGS = [] # Math lib diff --git a/numpy/random/tests/test_extending.py b/numpy/random/tests/test_extending.py index 01e43b9e8..6f0f7a462 100644 --- a/numpy/random/tests/test_extending.py +++ b/numpy/random/tests/test_extending.py @@ -14,19 +14,19 @@ except ImportError: def test_cython(): curdir = os.getcwd() argv = sys.argv - examples = (os.path.dirname(__file__), '..', 'examples') + examples = (os.path.dirname(__file__), '..', '_examples') try: os.chdir(os.path.join(*examples)) sys.argv = argv[:1] + ['build'] with warnings.catch_warnings(record=True) as w: # setuptools issue gh-1885 warnings.filterwarnings('always', '', DeprecationWarning) - from numpy.random.examples.cython import setup + from numpy.random._examples.cython import setup finally: sys.argv = argv os.chdir(curdir) @pytest.mark.skipif(numba is None, reason="requires numba") def test_numba(): - from numpy.random.examples.numba import extending + from numpy.random._examples.numba import extending diff --git a/numpy/tests/test_public_api.py b/numpy/tests/test_public_api.py index ba3961bef..0484bb8cd 100644 --- a/numpy/tests/test_public_api.py +++ b/numpy/tests/test_public_api.py @@ -334,7 +334,6 @@ SKIP_LIST = [ "numpy.core.cversions", "numpy.core.generate_numpy_api", "numpy.distutils.msvc9compiler", - 'numpy.random.examples', ] |