numpy 1.9.3__zip → 1.10.0__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- numpy-1.10.0.post2/INSTALL.txt +200 -0
- numpy-1.10.0.post2/LICENSE.txt +30 -0
- numpy-1.10.0.post2/MANIFEST.in +31 -0
- numpy-1.10.0.post2/PKG-INFO +47 -0
- numpy-1.10.0.post2/cnew.txt +117 -0
- numpy-1.10.0.post2/cold.txt +44 -0
- numpy-1.10.0.post2/committers.txt +160 -0
- numpy-1.10.0.post2/cpre.txt +283 -0
- numpy-1.10.0.post2/crel.txt +161 -0
- numpy-1.10.0.post2/doc/release/1.10.0-notes.rst +439 -0
- numpy-1.10.0.post2/doc/source/conf.py +331 -0
- numpy-1.10.0.post2/doc/source/dev/development_environment.rst +211 -0
- numpy-1.10.0.post2/doc/source/dev/gitwash/development_workflow.rst +534 -0
- numpy-1.10.0.post2/doc/source/dev/gitwash/git_links.inc +95 -0
- numpy-1.10.0.post2/doc/source/dev/gitwash/index.rst +14 -0
- numpy-1.10.0.post2/doc/source/dev/index.rst +11 -0
- numpy-1.10.0.post2/doc/source/reference/arrays.classes.rst +490 -0
- numpy-1.10.0.post2/doc/source/reference/arrays.dtypes.rst +536 -0
- numpy-1.10.0.post2/doc/source/reference/arrays.indexing.rst +549 -0
- numpy-1.10.0.post2/doc/source/reference/arrays.interface.rst +337 -0
- numpy-1.10.0.post2/doc/source/reference/arrays.ndarray.rst +622 -0
- numpy-1.10.0.post2/doc/source/reference/arrays.scalars.rst +291 -0
- numpy-1.10.0.post2/doc/source/reference/c-api.array.rst +3393 -0
- numpy-1.10.0.post2/doc/source/reference/c-api.config.rst +103 -0
- numpy-1.10.0.post2/doc/source/reference/c-api.coremath.rst +420 -0
- numpy-1.10.0.post2/doc/source/reference/c-api.dtype.rst +376 -0
- numpy-1.10.0.post2/doc/source/reference/c-api.generalized-ufuncs.rst +191 -0
- numpy-1.10.0.post2/doc/source/reference/c-api.iterator.rst +1300 -0
- numpy-1.10.0.post2/doc/source/reference/c-api.types-and-structures.rst +1240 -0
- numpy-1.10.0.post2/doc/source/reference/c-api.ufunc.rst +413 -0
- numpy-1.10.0.post2/doc/source/reference/index.rst +43 -0
- numpy-1.10.0.post2/doc/source/reference/internals.code-explanations.rst +615 -0
- numpy-1.10.0.post2/doc/source/reference/routines.array-manipulation.rst +115 -0
- numpy-1.10.0.post2/doc/source/reference/routines.io.rst +78 -0
- numpy-1.10.0.post2/doc/source/reference/routines.linalg.rst +91 -0
- numpy-1.10.0.post2/doc/source/reference/routines.ma.rst +407 -0
- numpy-1.10.0.post2/doc/source/reference/routines.sort.rst +41 -0
- numpy-1.10.0.post2/doc/source/reference/routines.statistics.rst +57 -0
- numpy-1.10.0.post2/doc/source/reference/swig.interface-file.rst +1066 -0
- numpy-1.10.0.post2/doc/source/reference/swig.testing.rst +167 -0
- numpy-1.10.0.post2/doc/source/reference/ufuncs.rst +666 -0
- numpy-1.10.0.post2/doc/source/release.rst +20 -0
- numpy-1.10.0.post2/doc/source/user/basics.io.genfromtxt.rst +531 -0
- numpy-1.10.0.post2/doc/source/user/basics.rec.rst +7 -0
- numpy-1.10.0.post2/doc/source/user/c-info.beyond-basics.rst +560 -0
- numpy-1.10.0.post2/doc/source/user/c-info.how-to-extend.rst +642 -0
- numpy-1.10.0.post2/doc/source/user/c-info.python-as-glue.rst +1177 -0
- numpy-1.10.0.post2/doc/source/user/c-info.ufunc-tutorial.rst +1211 -0
- numpy-1.10.0.post2/doc/source/user/install.rst +194 -0
- numpy-1.10.0.post2/numpy/__init__.py +227 -0
- numpy-1.10.0.post2/numpy/_build_utils/README +8 -0
- numpy-1.10.0.post2/numpy/_build_utils/apple_accelerate.py +21 -0
- numpy-1.10.0.post2/numpy/_build_utils/common.py +138 -0
- numpy-1.10.0.post2/numpy/_build_utils/src/apple_sgemv_fix.c +227 -0
- numpy-1.10.0.post2/numpy/_build_utils/waf.py +531 -0
- numpy-1.10.0.post2/numpy/_import_tools.py +353 -0
- numpy-1.10.0.post2/numpy/add_newdocs.py +7611 -0
- numpy-1.10.0.post2/numpy/compat/_inspect.py +194 -0
- numpy-1.10.0.post2/numpy/compat/py3k.py +88 -0
- numpy-1.10.0.post2/numpy/compat/setup.py +12 -0
- numpy-1.10.0.post2/numpy/core/__init__.py +89 -0
- numpy-1.10.0.post2/numpy/core/_internal.py +761 -0
- numpy-1.10.0.post2/numpy/core/_methods.py +133 -0
- numpy-1.10.0.post2/numpy/core/arrayprint.py +760 -0
- numpy-1.10.0.post2/numpy/core/code_generators/cversions.txt +34 -0
- numpy-1.10.0.post2/numpy/core/code_generators/generate_ufunc_api.py +219 -0
- numpy-1.10.0.post2/numpy/core/code_generators/generate_umath.py +1017 -0
- numpy-1.10.0.post2/numpy/core/code_generators/numpy_api.py +415 -0
- numpy-1.10.0.post2/numpy/core/code_generators/ufunc_docstrings.py +3442 -0
- numpy-1.10.0.post2/numpy/core/defchararray.py +2689 -0
- numpy-1.10.0.post2/numpy/core/fromnumeric.py +3089 -0
- numpy-1.10.0.post2/numpy/core/function_base.py +203 -0
- numpy-1.10.0.post2/numpy/core/getlimits.py +308 -0
- numpy-1.10.0.post2/numpy/core/include/numpy/ndarrayobject.h +246 -0
- numpy-1.10.0.post2/numpy/core/include/numpy/ndarraytypes.h +1797 -0
- numpy-1.10.0.post2/numpy/core/include/numpy/npy_3kcompat.h +448 -0
- numpy-1.10.0.post2/numpy/core/include/numpy/npy_common.h +1051 -0
- numpy-1.10.0.post2/numpy/core/include/numpy/npy_cpu.h +92 -0
- numpy-1.10.0.post2/numpy/core/include/numpy/npy_endian.h +61 -0
- numpy-1.10.0.post2/numpy/core/include/numpy/npy_math.h +525 -0
- numpy-1.10.0.post2/numpy/core/include/numpy/numpyconfig.h +36 -0
- numpy-1.10.0.post2/numpy/core/machar.py +342 -0
- numpy-1.10.0.post2/numpy/core/memmap.py +311 -0
- numpy-1.10.0.post2/numpy/core/numeric.py +2893 -0
- numpy-1.10.0.post2/numpy/core/numerictypes.py +1036 -0
- numpy-1.10.0.post2/numpy/core/records.py +846 -0
- numpy-1.10.0.post2/numpy/core/setup.py +983 -0
- numpy-1.10.0.post2/numpy/core/setup_common.py +352 -0
- numpy-1.10.0.post2/numpy/core/shape_base.py +350 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/alloc.c +244 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/arrayobject.c +1858 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/arraytypes.c.src +4738 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/arraytypes.h +37 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/buffer.c +981 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/calculation.c +1224 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/cblasfuncs.c +812 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/cblasfuncs.h +10 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/common.c +911 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/common.h +250 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/compiled_base.c +1664 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/compiled_base.h +24 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/conversion_utils.c +1217 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/convert.c +590 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/convert_datatype.c +2155 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/ctors.c +3838 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/datetime.c +3821 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/datetime_busday.c +1322 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/datetime_busdaycal.c +552 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/datetime_strings.c +1772 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/descriptor.c +3719 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/dtype_transfer.c +4239 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/einsum.c.src +3005 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/getset.c +986 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/hashdescr.c +318 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/item_selection.c +2413 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/iterators.c +2192 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/lowlevel_strided_loops.c.src +1769 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/mapping.c +3380 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/mapping.h +77 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/methods.c +2514 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/multiarray_tests.c.src +1035 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/multiarraymodule.c +4628 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/multiarraymodule.h +15 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/nditer_api.c +2809 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/nditer_constr.c +3160 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/nditer_pywrap.c +2499 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/number.c +1106 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/number.h +77 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/numpymemoryview.c +308 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/numpyos.c +683 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/scalarapi.c +870 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/scalartypes.c.src +4343 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/scalartypes.h +55 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/shape.c +1131 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/ucsnarrow.c +174 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/vdot.c +180 -0
- numpy-1.10.0.post2/numpy/core/src/multiarray/vdot.h +18 -0
- numpy-1.10.0.post2/numpy/core/src/npymath/ieee754.c.src +808 -0
- numpy-1.10.0.post2/numpy/core/src/npymath/npy_math.c.src +597 -0
- numpy-1.10.0.post2/numpy/core/src/npymath/npy_math_complex.c.src +1788 -0
- numpy-1.10.0.post2/numpy/core/src/npymath/npy_math_private.h +544 -0
- numpy-1.10.0.post2/numpy/core/src/npysort/heapsort.c.src +402 -0
- numpy-1.10.0.post2/numpy/core/src/npysort/mergesort.c.src +488 -0
- numpy-1.10.0.post2/numpy/core/src/npysort/npysort_common.h +360 -0
- numpy-1.10.0.post2/numpy/core/src/npysort/quicksort.c.src +523 -0
- numpy-1.10.0.post2/numpy/core/src/npysort/selection.c.src +426 -0
- numpy-1.10.0.post2/numpy/core/src/private/npy_cblas.h +584 -0
- numpy-1.10.0.post2/numpy/core/src/private/npy_config.h +101 -0
- numpy-1.10.0.post2/numpy/core/src/private/npy_import.h +32 -0
- numpy-1.10.0.post2/numpy/core/src/private/npy_partition.h.src +122 -0
- numpy-1.10.0.post2/numpy/core/src/private/npy_sort.h +196 -0
- numpy-1.10.0.post2/numpy/core/src/private/templ_common.h.src +43 -0
- numpy-1.10.0.post2/numpy/core/src/private/ufunc_override.h +397 -0
- numpy-1.10.0.post2/numpy/core/src/umath/funcs.inc.src +356 -0
- numpy-1.10.0.post2/numpy/core/src/umath/loops.c.src +2675 -0
- numpy-1.10.0.post2/numpy/core/src/umath/loops.h.src +497 -0
- numpy-1.10.0.post2/numpy/core/src/umath/operand_flag_tests.c.src +105 -0
- numpy-1.10.0.post2/numpy/core/src/umath/scalarmath.c.src +1738 -0
- numpy-1.10.0.post2/numpy/core/src/umath/simd.inc.src +903 -0
- numpy-1.10.0.post2/numpy/core/src/umath/test_rational.c.src +1404 -0
- numpy-1.10.0.post2/numpy/core/src/umath/ufunc_object.c +5703 -0
- numpy-1.10.0.post2/numpy/core/src/umath/ufunc_type_resolution.c +2159 -0
- numpy-1.10.0.post2/numpy/core/src/umath/umath_tests.c.src +392 -0
- numpy-1.10.0.post2/numpy/core/src/umath/umathmodule.c +443 -0
- numpy-1.10.0.post2/numpy/core/tests/test_abc.py +47 -0
- numpy-1.10.0.post2/numpy/core/tests/test_api.py +515 -0
- numpy-1.10.0.post2/numpy/core/tests/test_arrayprint.py +171 -0
- numpy-1.10.0.post2/numpy/core/tests/test_datetime.py +1820 -0
- numpy-1.10.0.post2/numpy/core/tests/test_defchararray.py +703 -0
- numpy-1.10.0.post2/numpy/core/tests/test_deprecations.py +619 -0
- numpy-1.10.0.post2/numpy/core/tests/test_dtype.py +578 -0
- numpy-1.10.0.post2/numpy/core/tests/test_einsum.py +627 -0
- numpy-1.10.0.post2/numpy/core/tests/test_errstate.py +52 -0
- numpy-1.10.0.post2/numpy/core/tests/test_function_base.py +142 -0
- numpy-1.10.0.post2/numpy/core/tests/test_getlimits.py +77 -0
- numpy-1.10.0.post2/numpy/core/tests/test_half.py +436 -0
- numpy-1.10.0.post2/numpy/core/tests/test_indexerrors.py +126 -0
- numpy-1.10.0.post2/numpy/core/tests/test_indexing.py +1047 -0
- numpy-1.10.0.post2/numpy/core/tests/test_item_selection.py +73 -0
- numpy-1.10.0.post2/numpy/core/tests/test_machar.py +29 -0
- numpy-1.10.0.post2/numpy/core/tests/test_memmap.py +130 -0
- numpy-1.10.0.post2/numpy/core/tests/test_multiarray.py +5924 -0
- numpy-1.10.0.post2/numpy/core/tests/test_multiarray_assignment.py +84 -0
- numpy-1.10.0.post2/numpy/core/tests/test_nditer.py +2638 -0
- numpy-1.10.0.post2/numpy/core/tests/test_numeric.py +2204 -0
- numpy-1.10.0.post2/numpy/core/tests/test_numerictypes.py +382 -0
- numpy-1.10.0.post2/numpy/core/tests/test_print.py +248 -0
- numpy-1.10.0.post2/numpy/core/tests/test_records.py +299 -0
- numpy-1.10.0.post2/numpy/core/tests/test_regression.py +2177 -0
- numpy-1.10.0.post2/numpy/core/tests/test_scalarinherit.py +41 -0
- numpy-1.10.0.post2/numpy/core/tests/test_scalarmath.py +316 -0
- numpy-1.10.0.post2/numpy/core/tests/test_shape_base.py +319 -0
- numpy-1.10.0.post2/numpy/core/tests/test_ufunc.py +1227 -0
- numpy-1.10.0.post2/numpy/core/tests/test_umath.py +1933 -0
- numpy-1.10.0.post2/numpy/core/tests/test_umath_complex.py +538 -0
- numpy-1.10.0.post2/numpy/core/tests/test_unicode.py +360 -0
- numpy-1.10.0.post2/numpy/distutils/__init__.py +23 -0
- numpy-1.10.0.post2/numpy/distutils/ccompiler.py +690 -0
- numpy-1.10.0.post2/numpy/distutils/command/autodist.py +94 -0
- numpy-1.10.0.post2/numpy/distutils/command/build.py +47 -0
- numpy-1.10.0.post2/numpy/distutils/command/build_clib.py +295 -0
- numpy-1.10.0.post2/numpy/distutils/command/build_ext.py +522 -0
- numpy-1.10.0.post2/numpy/distutils/command/config.py +437 -0
- numpy-1.10.0.post2/numpy/distutils/exec_command.py +651 -0
- numpy-1.10.0.post2/numpy/distutils/fcompiler/compaq.py +128 -0
- numpy-1.10.0.post2/numpy/distutils/fcompiler/gnu.py +403 -0
- numpy-1.10.0.post2/numpy/distutils/fcompiler/intel.py +217 -0
- numpy-1.10.0.post2/numpy/distutils/fcompiler/pg.py +63 -0
- numpy-1.10.0.post2/numpy/distutils/fcompiler/sun.py +55 -0
- numpy-1.10.0.post2/numpy/distutils/intelccompiler.py +95 -0
- numpy-1.10.0.post2/numpy/distutils/lib2def.py +116 -0
- numpy-1.10.0.post2/numpy/distutils/mingw32ccompiler.py +599 -0
- numpy-1.10.0.post2/numpy/distutils/misc_util.py +2306 -0
- numpy-1.10.0.post2/numpy/distutils/msvc9compiler.py +23 -0
- numpy-1.10.0.post2/numpy/distutils/msvccompiler.py +17 -0
- numpy-1.10.0.post2/numpy/distutils/npy_pkg_config.py +451 -0
- numpy-1.10.0.post2/numpy/distutils/system_info.py +2397 -0
- numpy-1.10.0.post2/numpy/distutils/tests/f2py_ext/tests/test_fib2.py +12 -0
- numpy-1.10.0.post2/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py +11 -0
- numpy-1.10.0.post2/numpy/distutils/tests/gen_ext/tests/test_fib3.py +11 -0
- numpy-1.10.0.post2/numpy/distutils/tests/pyrex_ext/tests/test_primes.py +13 -0
- numpy-1.10.0.post2/numpy/distutils/tests/swig_ext/__init__.py +1 -0
- numpy-1.10.0.post2/numpy/distutils/tests/swig_ext/tests/test_example.py +17 -0
- numpy-1.10.0.post2/numpy/distutils/tests/swig_ext/tests/test_example2.py +15 -0
- numpy-1.10.0.post2/numpy/distutils/tests/test_fcompiler_gnu.py +60 -0
- numpy-1.10.0.post2/numpy/distutils/tests/test_fcompiler_intel.py +36 -0
- numpy-1.10.0.post2/numpy/distutils/tests/test_misc_util.py +79 -0
- numpy-1.10.0.post2/numpy/distutils/tests/test_npy_pkg_config.py +102 -0
- numpy-1.10.0.post2/numpy/distutils/tests/test_system_info.py +209 -0
- numpy-1.10.0.post2/numpy/distutils/unixccompiler.py +125 -0
- numpy-1.10.0.post2/numpy/doc/byteswapping.py +156 -0
- numpy-1.10.0.post2/numpy/doc/creation.py +144 -0
- numpy-1.10.0.post2/numpy/doc/glossary.py +423 -0
- numpy-1.10.0.post2/numpy/doc/indexing.py +439 -0
- numpy-1.10.0.post2/numpy/doc/structured_arrays.py +290 -0
- numpy-1.10.0.post2/numpy/f2py/__init__.py +49 -0
- numpy-1.10.0.post2/numpy/f2py/__main__.py +25 -0
- numpy-1.10.0.post2/numpy/f2py/auxfuncs.py +858 -0
- numpy-1.10.0.post2/numpy/f2py/capi_maps.py +851 -0
- numpy-1.10.0.post2/numpy/f2py/cb_rules.py +554 -0
- numpy-1.10.0.post2/numpy/f2py/cfuncs.py +1261 -0
- numpy-1.10.0.post2/numpy/f2py/common_rules.py +150 -0
- numpy-1.10.0.post2/numpy/f2py/crackfortran.py +3314 -0
- numpy-1.10.0.post2/numpy/f2py/diagnose.py +156 -0
- numpy-1.10.0.post2/numpy/f2py/f2py2e.py +656 -0
- numpy-1.10.0.post2/numpy/f2py/f2py_testing.py +48 -0
- numpy-1.10.0.post2/numpy/f2py/f90mod_rules.py +272 -0
- numpy-1.10.0.post2/numpy/f2py/func2subr.py +299 -0
- numpy-1.10.0.post2/numpy/f2py/rules.py +1475 -0
- numpy-1.10.0.post2/numpy/f2py/setup.py +117 -0
- numpy-1.10.0.post2/numpy/f2py/src/fortranobject.c +1037 -0
- numpy-1.10.0.post2/numpy/f2py/src/fortranobject.h +162 -0
- numpy-1.10.0.post2/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c +223 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_array_from_pyobj.py +593 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_assumed_shape.py +35 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_callback.py +136 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_kind.py +36 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_mixed.py +40 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_regression.py +34 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_return_character.py +148 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_return_complex.py +170 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_return_integer.py +180 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_return_logical.py +189 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_return_real.py +206 -0
- numpy-1.10.0.post2/numpy/f2py/tests/test_size.py +44 -0
- numpy-1.10.0.post2/numpy/f2py/tests/util.py +367 -0
- numpy-1.10.0.post2/numpy/f2py/use_rules.py +115 -0
- numpy-1.10.0.post2/numpy/fft/fftpack.c +1501 -0
- numpy-1.10.0.post2/numpy/fft/fftpack.h +28 -0
- numpy-1.10.0.post2/numpy/fft/fftpack.py +1241 -0
- numpy-1.10.0.post2/numpy/fft/fftpack_litemodule.c +363 -0
- numpy-1.10.0.post2/numpy/fft/info.py +187 -0
- numpy-1.10.0.post2/numpy/fft/setup.py +19 -0
- numpy-1.10.0.post2/numpy/fft/tests/test_fftpack.py +166 -0
- numpy-1.10.0.post2/numpy/fft/tests/test_helper.py +78 -0
- numpy-1.10.0.post2/numpy/lib/_iotools.py +917 -0
- numpy-1.10.0.post2/numpy/lib/arraypad.py +1497 -0
- numpy-1.10.0.post2/numpy/lib/arraysetops.py +480 -0
- numpy-1.10.0.post2/numpy/lib/arrayterator.py +226 -0
- numpy-1.10.0.post2/numpy/lib/financial.py +737 -0
- numpy-1.10.0.post2/numpy/lib/format.py +814 -0
- numpy-1.10.0.post2/numpy/lib/function_base.py +4150 -0
- numpy-1.10.0.post2/numpy/lib/index_tricks.py +874 -0
- numpy-1.10.0.post2/numpy/lib/info.py +152 -0
- numpy-1.10.0.post2/numpy/lib/nanfunctions.py +1237 -0
- numpy-1.10.0.post2/numpy/lib/npyio.py +1992 -0
- numpy-1.10.0.post2/numpy/lib/polynomial.py +1277 -0
- numpy-1.10.0.post2/numpy/lib/recfunctions.py +1003 -0
- numpy-1.10.0.post2/numpy/lib/setup.py +12 -0
- numpy-1.10.0.post2/numpy/lib/shape_base.py +872 -0
- numpy-1.10.0.post2/numpy/lib/stride_tricks.py +200 -0
- numpy-1.10.0.post2/numpy/lib/tests/data/py2-objarr.npy +0 -0
- numpy-1.10.0.post2/numpy/lib/tests/data/py2-objarr.npz +0 -0
- numpy-1.10.0.post2/numpy/lib/tests/data/py3-objarr.npy +0 -0
- numpy-1.10.0.post2/numpy/lib/tests/data/py3-objarr.npz +0 -0
- numpy-1.10.0.post2/numpy/lib/tests/test__iotools.py +348 -0
- numpy-1.10.0.post2/numpy/lib/tests/test__version.py +70 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_arraypad.py +1047 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_arraysetops.py +309 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_financial.py +163 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_format.py +841 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_function_base.py +2555 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_index_tricks.py +326 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_io.py +1916 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_nanfunctions.py +707 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_packbits.py +26 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_polynomial.py +188 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_recfunctions.py +734 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_shape_base.py +386 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_stride_tricks.py +405 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_twodim_base.py +535 -0
- numpy-1.10.0.post2/numpy/lib/tests/test_type_check.py +332 -0
- numpy-1.10.0.post2/numpy/lib/twodim_base.py +1007 -0
- numpy-1.10.0.post2/numpy/lib/type_check.py +596 -0
- numpy-1.10.0.post2/numpy/lib/utils.py +1122 -0
- numpy-1.10.0.post2/numpy/linalg/lapack_lite/python_xerbla.c +46 -0
- numpy-1.10.0.post2/numpy/linalg/lapack_litemodule.c +358 -0
- numpy-1.10.0.post2/numpy/linalg/linalg.py +2406 -0
- numpy-1.10.0.post2/numpy/linalg/tests/test_build.py +59 -0
- numpy-1.10.0.post2/numpy/linalg/tests/test_linalg.py +1351 -0
- numpy-1.10.0.post2/numpy/linalg/tests/test_regression.py +95 -0
- numpy-1.10.0.post2/numpy/linalg/umath_linalg.c.src +3236 -0
- numpy-1.10.0.post2/numpy/ma/__init__.py +56 -0
- numpy-1.10.0.post2/numpy/ma/bench.py +131 -0
- numpy-1.10.0.post2/numpy/ma/core.py +7608 -0
- numpy-1.10.0.post2/numpy/ma/extras.py +1953 -0
- numpy-1.10.0.post2/numpy/ma/mrecords.py +796 -0
- numpy-1.10.0.post2/numpy/ma/setup.py +13 -0
- numpy-1.10.0.post2/numpy/ma/tests/test_core.py +4100 -0
- numpy-1.10.0.post2/numpy/ma/tests/test_extras.py +1132 -0
- numpy-1.10.0.post2/numpy/ma/tests/test_mrecords.py +520 -0
- numpy-1.10.0.post2/numpy/ma/tests/test_old_ma.py +879 -0
- numpy-1.10.0.post2/numpy/ma/tests/test_regression.py +80 -0
- numpy-1.10.0.post2/numpy/ma/tests/test_subclassing.py +338 -0
- numpy-1.10.0.post2/numpy/ma/testutils.py +289 -0
- numpy-1.10.0.post2/numpy/ma/timer_comparison.py +440 -0
- numpy-1.10.0.post2/numpy/matlib.py +358 -0
- numpy-1.10.0.post2/numpy/matrixlib/defmatrix.py +1232 -0
- numpy-1.10.0.post2/numpy/matrixlib/tests/test_defmatrix.py +449 -0
- numpy-1.10.0.post2/numpy/matrixlib/tests/test_multiarray.py +23 -0
- numpy-1.10.0.post2/numpy/matrixlib/tests/test_numeric.py +23 -0
- numpy-1.10.0.post2/numpy/matrixlib/tests/test_regression.py +37 -0
- numpy-1.10.0.post2/numpy/polynomial/_polybase.py +962 -0
- numpy-1.10.0.post2/numpy/polynomial/chebyshev.py +2056 -0
- numpy-1.10.0.post2/numpy/polynomial/hermite.py +1831 -0
- numpy-1.10.0.post2/numpy/polynomial/hermite_e.py +1828 -0
- numpy-1.10.0.post2/numpy/polynomial/laguerre.py +1780 -0
- numpy-1.10.0.post2/numpy/polynomial/legendre.py +1808 -0
- numpy-1.10.0.post2/numpy/polynomial/polyutils.py +403 -0
- numpy-1.10.0.post2/numpy/random/mtrand/distributions.c +912 -0
- numpy-1.10.0.post2/numpy/random/mtrand/mtrand.c +34805 -0
- numpy-1.10.0.post2/numpy/random/mtrand/mtrand.pyx +4766 -0
- numpy-1.10.0.post2/numpy/random/setup.py +61 -0
- numpy-1.10.0.post2/numpy/random/tests/test_random.py +723 -0
- numpy-1.10.0.post2/numpy/random/tests/test_regression.py +117 -0
- numpy-1.10.0.post2/numpy/setup.py +29 -0
- numpy-1.10.0.post2/numpy/testing/__init__.py +15 -0
- numpy-1.10.0.post2/numpy/testing/decorators.py +271 -0
- numpy-1.10.0.post2/numpy/testing/noseclasses.py +353 -0
- numpy-1.10.0.post2/numpy/testing/nosetester.py +511 -0
- numpy-1.10.0.post2/numpy/testing/print_coercion_tables.py +91 -0
- numpy-1.10.0.post2/numpy/testing/setup.py +20 -0
- numpy-1.10.0.post2/numpy/testing/tests/test_decorators.py +182 -0
- numpy-1.10.0.post2/numpy/testing/tests/test_utils.py +781 -0
- numpy-1.10.0.post2/numpy/testing/utils.py +1831 -0
- numpy-1.10.0.post2/numpy/tests/test_ctypeslib.py +106 -0
- numpy-1.10.0.post2/numpy/tests/test_matlib.py +55 -0
- numpy-1.10.0.post2/numpy/tests/test_scripts.py +69 -0
- numpy-1.10.0.post2/numpy/version.py +10 -0
- numpy-1.10.0.post2/setup.py +260 -0
- numpy-1.10.0.post2/site.cfg.example +193 -0
- numpy-1.10.0.post2/tmp.txt +789 -0
- numpy-1.10.0.post2/tools/swig/README +145 -0
- numpy-1.10.0.post2/tools/swig/numpy.i +3161 -0
- numpy-1.10.0.post2/tools/swig/test/Array.i +135 -0
- numpy-1.10.0.post2/tools/swig/test/ArrayZ.cxx +131 -0
- numpy-1.10.0.post2/tools/swig/test/ArrayZ.h +56 -0
- numpy-1.10.0.post2/tools/swig/test/Flat.cxx +36 -0
- numpy-1.10.0.post2/tools/swig/test/Flat.h +34 -0
- numpy-1.10.0.post2/tools/swig/test/Flat.i +36 -0
- numpy-1.10.0.post2/tools/swig/test/Makefile +37 -0
- numpy-1.10.0.post2/tools/swig/test/setup.py +71 -0
- numpy-1.10.0.post2/tools/swig/test/testArray.py +385 -0
- numpy-1.10.0.post2/tools/swig/test/testFarray.py +159 -0
- numpy-1.10.0.post2/tools/swig/test/testFlat.py +200 -0
- numpy-1.10.0.post2/tools/swig/test/testFortran.py +173 -0
- numpy-1.10.0.post2/tools/swig/test/testMatrix.py +362 -0
- numpy-1.10.0.post2/tools/swig/test/testSuperTensor.py +388 -0
- numpy-1.10.0.post2/tools/swig/test/testTensor.py +402 -0
- numpy-1.10.0.post2/tools/swig/test/testVector.py +381 -0
- numpy-1.9.3/INSTALL.txt +0 -138
- numpy-1.9.3/LICENSE.txt +0 -30
- numpy-1.9.3/MANIFEST.in +0 -26
- numpy-1.9.3/PKG-INFO +0 -39
- numpy-1.9.3/doc/release/1.9.3-notes.rst +0 -23
- numpy-1.9.3/doc/source/conf.py +0 -331
- numpy-1.9.3/doc/source/dev/gitwash/branch_list.png +0 -0
- numpy-1.9.3/doc/source/dev/gitwash/branch_list_compare.png +0 -0
- numpy-1.9.3/doc/source/dev/gitwash/development_workflow.rst +0 -568
- numpy-1.9.3/doc/source/dev/gitwash/git_links.inc +0 -88
- numpy-1.9.3/doc/source/dev/gitwash/index.rst +0 -14
- numpy-1.9.3/doc/source/dev/index.rst +0 -10
- numpy-1.9.3/doc/source/reference/arrays.classes.rst +0 -427
- numpy-1.9.3/doc/source/reference/arrays.dtypes.rst +0 -534
- numpy-1.9.3/doc/source/reference/arrays.indexing.rst +0 -550
- numpy-1.9.3/doc/source/reference/arrays.interface.rst +0 -336
- numpy-1.9.3/doc/source/reference/arrays.ndarray.rst +0 -609
- numpy-1.9.3/doc/source/reference/arrays.scalars.rst +0 -291
- numpy-1.9.3/doc/source/reference/c-api.array.rst +0 -3362
- numpy-1.9.3/doc/source/reference/c-api.config.rst +0 -103
- numpy-1.9.3/doc/source/reference/c-api.coremath.rst +0 -420
- numpy-1.9.3/doc/source/reference/c-api.dtype.rst +0 -376
- numpy-1.9.3/doc/source/reference/c-api.generalized-ufuncs.rst +0 -171
- numpy-1.9.3/doc/source/reference/c-api.iterator.rst +0 -1298
- numpy-1.9.3/doc/source/reference/c-api.types-and-structures.rst +0 -1204
- numpy-1.9.3/doc/source/reference/c-api.ufunc.rst +0 -399
- numpy-1.9.3/doc/source/reference/index.rst +0 -44
- numpy-1.9.3/doc/source/reference/internals.code-explanations.rst +0 -666
- numpy-1.9.3/doc/source/reference/routines.array-manipulation.rst +0 -113
- numpy-1.9.3/doc/source/reference/routines.io.rst +0 -74
- numpy-1.9.3/doc/source/reference/routines.linalg.rst +0 -88
- numpy-1.9.3/doc/source/reference/routines.ma.rst +0 -405
- numpy-1.9.3/doc/source/reference/routines.sort.rst +0 -42
- numpy-1.9.3/doc/source/reference/routines.statistics.rst +0 -55
- numpy-1.9.3/doc/source/reference/swig.interface-file.rst +0 -1055
- numpy-1.9.3/doc/source/reference/swig.testing.rst +0 -166
- numpy-1.9.3/doc/source/reference/ufuncs.rst +0 -651
- numpy-1.9.3/doc/source/release.rst +0 -19
- numpy-1.9.3/doc/source/user/basics.io.genfromtxt.rst +0 -531
- numpy-1.9.3/doc/source/user/basics.rec.rst +0 -7
- numpy-1.9.3/doc/source/user/c-info.beyond-basics.rst +0 -560
- numpy-1.9.3/doc/source/user/c-info.how-to-extend.rst +0 -642
- numpy-1.9.3/doc/source/user/c-info.python-as-glue.rst +0 -1528
- numpy-1.9.3/doc/source/user/c-info.ufunc-tutorial.rst +0 -1211
- numpy-1.9.3/doc/source/user/install.rst +0 -180
- numpy-1.9.3/numpy/__init__.py +0 -216
- numpy-1.9.3/numpy/_import_tools.py +0 -348
- numpy-1.9.3/numpy/add_newdocs.py +0 -7518
- numpy-1.9.3/numpy/compat/_inspect.py +0 -221
- numpy-1.9.3/numpy/compat/py3k.py +0 -89
- numpy-1.9.3/numpy/compat/setup.py +0 -12
- numpy-1.9.3/numpy/core/__init__.py +0 -78
- numpy-1.9.3/numpy/core/_internal.py +0 -570
- numpy-1.9.3/numpy/core/_methods.py +0 -134
- numpy-1.9.3/numpy/core/arrayprint.py +0 -752
- numpy-1.9.3/numpy/core/blasdot/_dotblas.c +0 -1255
- numpy-1.9.3/numpy/core/blasdot/apple_sgemv_patch.c +0 -216
- numpy-1.9.3/numpy/core/blasdot/cblas.h +0 -578
- numpy-1.9.3/numpy/core/code_generators/cversions.txt +0 -31
- numpy-1.9.3/numpy/core/code_generators/generate_ufunc_api.py +0 -219
- numpy-1.9.3/numpy/core/code_generators/generate_umath.py +0 -972
- numpy-1.9.3/numpy/core/code_generators/numpy_api.py +0 -412
- numpy-1.9.3/numpy/core/code_generators/ufunc_docstrings.py +0 -3419
- numpy-1.9.3/numpy/core/defchararray.py +0 -2687
- numpy-1.9.3/numpy/core/fromnumeric.py +0 -2938
- numpy-1.9.3/numpy/core/function_base.py +0 -190
- numpy-1.9.3/numpy/core/getlimits.py +0 -306
- numpy-1.9.3/numpy/core/include/numpy/fenv/fenv.c +0 -38
- numpy-1.9.3/numpy/core/include/numpy/fenv/fenv.h +0 -224
- numpy-1.9.3/numpy/core/include/numpy/ndarrayobject.h +0 -237
- numpy-1.9.3/numpy/core/include/numpy/ndarraytypes.h +0 -1820
- numpy-1.9.3/numpy/core/include/numpy/npy_3kcompat.h +0 -506
- numpy-1.9.3/numpy/core/include/numpy/npy_common.h +0 -1038
- numpy-1.9.3/numpy/core/include/numpy/npy_cpu.h +0 -122
- numpy-1.9.3/numpy/core/include/numpy/npy_endian.h +0 -49
- numpy-1.9.3/numpy/core/include/numpy/npy_math.h +0 -479
- numpy-1.9.3/numpy/core/include/numpy/numpyconfig.h +0 -35
- numpy-1.9.3/numpy/core/machar.py +0 -338
- numpy-1.9.3/numpy/core/memmap.py +0 -308
- numpy-1.9.3/numpy/core/numeric.py +0 -2842
- numpy-1.9.3/numpy/core/numerictypes.py +0 -1042
- numpy-1.9.3/numpy/core/records.py +0 -804
- numpy-1.9.3/numpy/core/setup.py +0 -1016
- numpy-1.9.3/numpy/core/setup_common.py +0 -330
- numpy-1.9.3/numpy/core/shape_base.py +0 -277
- numpy-1.9.3/numpy/core/src/multiarray/alloc.c +0 -241
- numpy-1.9.3/numpy/core/src/multiarray/arrayobject.c +0 -1791
- numpy-1.9.3/numpy/core/src/multiarray/arraytypes.c.src +0 -4372
- numpy-1.9.3/numpy/core/src/multiarray/arraytypes.h +0 -13
- numpy-1.9.3/numpy/core/src/multiarray/buffer.c +0 -954
- numpy-1.9.3/numpy/core/src/multiarray/calculation.c +0 -1229
- numpy-1.9.3/numpy/core/src/multiarray/common.c +0 -798
- numpy-1.9.3/numpy/core/src/multiarray/common.h +0 -328
- numpy-1.9.3/numpy/core/src/multiarray/conversion_utils.c +0 -1240
- numpy-1.9.3/numpy/core/src/multiarray/convert.c +0 -589
- numpy-1.9.3/numpy/core/src/multiarray/convert_datatype.c +0 -2199
- numpy-1.9.3/numpy/core/src/multiarray/ctors.c +0 -3785
- numpy-1.9.3/numpy/core/src/multiarray/datetime.c +0 -3823
- numpy-1.9.3/numpy/core/src/multiarray/datetime_busday.c +0 -1322
- numpy-1.9.3/numpy/core/src/multiarray/datetime_busdaycal.c +0 -552
- numpy-1.9.3/numpy/core/src/multiarray/datetime_strings.c +0 -1772
- numpy-1.9.3/numpy/core/src/multiarray/descriptor.c +0 -3658
- numpy-1.9.3/numpy/core/src/multiarray/dtype_transfer.c +0 -4232
- numpy-1.9.3/numpy/core/src/multiarray/einsum.c.src +0 -3013
- numpy-1.9.3/numpy/core/src/multiarray/getset.c +0 -984
- numpy-1.9.3/numpy/core/src/multiarray/hashdescr.c +0 -319
- numpy-1.9.3/numpy/core/src/multiarray/item_selection.c +0 -2711
- numpy-1.9.3/numpy/core/src/multiarray/iterators.c +0 -2160
- numpy-1.9.3/numpy/core/src/multiarray/lowlevel_strided_loops.c.src +0 -1767
- numpy-1.9.3/numpy/core/src/multiarray/mapping.c +0 -3316
- numpy-1.9.3/numpy/core/src/multiarray/mapping.h +0 -73
- numpy-1.9.3/numpy/core/src/multiarray/methods.c +0 -2497
- numpy-1.9.3/numpy/core/src/multiarray/multiarray_tests.c.src +0 -977
- numpy-1.9.3/numpy/core/src/multiarray/multiarraymodule.c +0 -4200
- numpy-1.9.3/numpy/core/src/multiarray/multiarraymodule.h +0 -4
- numpy-1.9.3/numpy/core/src/multiarray/nditer_api.c +0 -2809
- numpy-1.9.3/numpy/core/src/multiarray/nditer_constr.c +0 -3159
- numpy-1.9.3/numpy/core/src/multiarray/nditer_pywrap.c +0 -2492
- numpy-1.9.3/numpy/core/src/multiarray/number.c +0 -1057
- numpy-1.9.3/numpy/core/src/multiarray/number.h +0 -76
- numpy-1.9.3/numpy/core/src/multiarray/numpymemoryview.c +0 -309
- numpy-1.9.3/numpy/core/src/multiarray/numpyos.c +0 -683
- numpy-1.9.3/numpy/core/src/multiarray/scalarapi.c +0 -861
- numpy-1.9.3/numpy/core/src/multiarray/scalartypes.c.src +0 -4270
- numpy-1.9.3/numpy/core/src/multiarray/scalartypes.h +0 -52
- numpy-1.9.3/numpy/core/src/multiarray/shape.c +0 -1141
- numpy-1.9.3/numpy/core/src/multiarray/ucsnarrow.c +0 -173
- numpy-1.9.3/numpy/core/src/npymath/ieee754.c.src +0 -814
- numpy-1.9.3/numpy/core/src/npymath/npy_math.c.src +0 -527
- numpy-1.9.3/numpy/core/src/npymath/npy_math_complex.c.src +0 -291
- numpy-1.9.3/numpy/core/src/npymath/npy_math_private.h +0 -539
- numpy-1.9.3/numpy/core/src/npysort/heapsort.c.src +0 -341
- numpy-1.9.3/numpy/core/src/npysort/mergesort.c.src +0 -428
- numpy-1.9.3/numpy/core/src/npysort/npysort_common.h +0 -367
- numpy-1.9.3/numpy/core/src/npysort/quicksort.c.src +0 -363
- numpy-1.9.3/numpy/core/src/npysort/selection.c.src +0 -474
- numpy-1.9.3/numpy/core/src/private/npy_config.h +0 -68
- numpy-1.9.3/numpy/core/src/private/npy_partition.h.src +0 -138
- numpy-1.9.3/numpy/core/src/private/npy_sort.h +0 -194
- numpy-1.9.3/numpy/core/src/private/scalarmathmodule.h.src +0 -42
- numpy-1.9.3/numpy/core/src/private/ufunc_override.h +0 -384
- numpy-1.9.3/numpy/core/src/scalarmathmodule.c.src +0 -1980
- numpy-1.9.3/numpy/core/src/umath/funcs.inc.src +0 -715
- numpy-1.9.3/numpy/core/src/umath/loops.c.src +0 -2654
- numpy-1.9.3/numpy/core/src/umath/loops.h.src +0 -501
- numpy-1.9.3/numpy/core/src/umath/operand_flag_tests.c.src +0 -105
- numpy-1.9.3/numpy/core/src/umath/simd.inc.src +0 -881
- numpy-1.9.3/numpy/core/src/umath/test_rational.c.src +0 -1404
- numpy-1.9.3/numpy/core/src/umath/ufunc_object.c +0 -5520
- numpy-1.9.3/numpy/core/src/umath/ufunc_type_resolution.c +0 -2164
- numpy-1.9.3/numpy/core/src/umath/umath_tests.c.src +0 -341
- numpy-1.9.3/numpy/core/src/umath/umathmodule.c +0 -561
- numpy-1.9.3/numpy/core/tests/test_abc.py +0 -45
- numpy-1.9.3/numpy/core/tests/test_api.py +0 -514
- numpy-1.9.3/numpy/core/tests/test_arrayprint.py +0 -167
- numpy-1.9.3/numpy/core/tests/test_blasdot.py +0 -249
- numpy-1.9.3/numpy/core/tests/test_datetime.py +0 -1781
- numpy-1.9.3/numpy/core/tests/test_defchararray.py +0 -642
- numpy-1.9.3/numpy/core/tests/test_deprecations.py +0 -512
- numpy-1.9.3/numpy/core/tests/test_dtype.py +0 -542
- numpy-1.9.3/numpy/core/tests/test_einsum.py +0 -583
- numpy-1.9.3/numpy/core/tests/test_errstate.py +0 -51
- numpy-1.9.3/numpy/core/tests/test_function_base.py +0 -111
- numpy-1.9.3/numpy/core/tests/test_getlimits.py +0 -86
- numpy-1.9.3/numpy/core/tests/test_half.py +0 -439
- numpy-1.9.3/numpy/core/tests/test_indexerrors.py +0 -127
- numpy-1.9.3/numpy/core/tests/test_indexing.py +0 -1014
- numpy-1.9.3/numpy/core/tests/test_item_selection.py +0 -70
- numpy-1.9.3/numpy/core/tests/test_machar.py +0 -30
- numpy-1.9.3/numpy/core/tests/test_memmap.py +0 -127
- numpy-1.9.3/numpy/core/tests/test_multiarray.py +0 -4645
- numpy-1.9.3/numpy/core/tests/test_multiarray_assignment.py +0 -80
- numpy-1.9.3/numpy/core/tests/test_nditer.py +0 -2630
- numpy-1.9.3/numpy/core/tests/test_numeric.py +0 -2117
- numpy-1.9.3/numpy/core/tests/test_numerictypes.py +0 -377
- numpy-1.9.3/numpy/core/tests/test_print.py +0 -245
- numpy-1.9.3/numpy/core/tests/test_records.py +0 -185
- numpy-1.9.3/numpy/core/tests/test_regression.py +0 -2115
- numpy-1.9.3/numpy/core/tests/test_scalarinherit.py +0 -34
- numpy-1.9.3/numpy/core/tests/test_scalarmath.py +0 -275
- numpy-1.9.3/numpy/core/tests/test_shape_base.py +0 -250
- numpy-1.9.3/numpy/core/tests/test_ufunc.py +0 -1153
- numpy-1.9.3/numpy/core/tests/test_umath.py +0 -1695
- numpy-1.9.3/numpy/core/tests/test_umath_complex.py +0 -537
- numpy-1.9.3/numpy/core/tests/test_unicode.py +0 -357
- numpy-1.9.3/numpy/distutils/__init__.py +0 -39
- numpy-1.9.3/numpy/distutils/ccompiler.py +0 -656
- numpy-1.9.3/numpy/distutils/command/autodist.py +0 -43
- numpy-1.9.3/numpy/distutils/command/build.py +0 -39
- numpy-1.9.3/numpy/distutils/command/build_clib.py +0 -284
- numpy-1.9.3/numpy/distutils/command/build_ext.py +0 -515
- numpy-1.9.3/numpy/distutils/command/config.py +0 -476
- numpy-1.9.3/numpy/distutils/exec_command.py +0 -618
- numpy-1.9.3/numpy/distutils/fcompiler/compaq.py +0 -128
- numpy-1.9.3/numpy/distutils/fcompiler/gnu.py +0 -390
- numpy-1.9.3/numpy/distutils/fcompiler/intel.py +0 -205
- numpy-1.9.3/numpy/distutils/fcompiler/pg.py +0 -60
- numpy-1.9.3/numpy/distutils/fcompiler/sun.py +0 -52
- numpy-1.9.3/numpy/distutils/intelccompiler.py +0 -45
- numpy-1.9.3/numpy/distutils/lib2def.py +0 -116
- numpy-1.9.3/numpy/distutils/mingw32ccompiler.py +0 -582
- numpy-1.9.3/numpy/distutils/misc_util.py +0 -2271
- numpy-1.9.3/numpy/distutils/npy_pkg_config.py +0 -464
- numpy-1.9.3/numpy/distutils/system_info.py +0 -2319
- numpy-1.9.3/numpy/distutils/tests/f2py_ext/tests/test_fib2.py +0 -13
- numpy-1.9.3/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py +0 -12
- numpy-1.9.3/numpy/distutils/tests/gen_ext/tests/test_fib3.py +0 -12
- numpy-1.9.3/numpy/distutils/tests/pyrex_ext/tests/test_primes.py +0 -14
- numpy-1.9.3/numpy/distutils/tests/swig_ext/tests/test_example.py +0 -18
- numpy-1.9.3/numpy/distutils/tests/swig_ext/tests/test_example2.py +0 -16
- numpy-1.9.3/numpy/distutils/tests/test_fcompiler_gnu.py +0 -53
- numpy-1.9.3/numpy/distutils/tests/test_fcompiler_intel.py +0 -36
- numpy-1.9.3/numpy/distutils/tests/test_misc_util.py +0 -75
- numpy-1.9.3/numpy/distutils/tests/test_npy_pkg_config.py +0 -98
- numpy-1.9.3/numpy/distutils/unixccompiler.py +0 -113
- numpy-1.9.3/numpy/doc/byteswapping.py +0 -147
- numpy-1.9.3/numpy/doc/creation.py +0 -144
- numpy-1.9.3/numpy/doc/glossary.py +0 -418
- numpy-1.9.3/numpy/doc/indexing.py +0 -437
- numpy-1.9.3/numpy/doc/structured_arrays.py +0 -223
- numpy-1.9.3/numpy/f2py/__init__.py +0 -49
- numpy-1.9.3/numpy/f2py/auxfuncs.py +0 -711
- numpy-1.9.3/numpy/f2py/capi_maps.py +0 -773
- numpy-1.9.3/numpy/f2py/cb_rules.py +0 -539
- numpy-1.9.3/numpy/f2py/cfuncs.py +0 -1224
- numpy-1.9.3/numpy/f2py/common_rules.py +0 -132
- numpy-1.9.3/numpy/f2py/crackfortran.py +0 -2870
- numpy-1.9.3/numpy/f2py/diagnose.py +0 -149
- numpy-1.9.3/numpy/f2py/f2py2e.py +0 -598
- numpy-1.9.3/numpy/f2py/f2py_testing.py +0 -46
- numpy-1.9.3/numpy/f2py/f90mod_rules.py +0 -246
- numpy-1.9.3/numpy/f2py/func2subr.py +0 -291
- numpy-1.9.3/numpy/f2py/rules.py +0 -1448
- numpy-1.9.3/numpy/f2py/setup.py +0 -129
- numpy-1.9.3/numpy/f2py/src/fortranobject.c +0 -972
- numpy-1.9.3/numpy/f2py/src/fortranobject.h +0 -162
- numpy-1.9.3/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c +0 -223
- numpy-1.9.3/numpy/f2py/tests/test_array_from_pyobj.py +0 -559
- numpy-1.9.3/numpy/f2py/tests/test_assumed_shape.py +0 -37
- numpy-1.9.3/numpy/f2py/tests/test_callback.py +0 -132
- numpy-1.9.3/numpy/f2py/tests/test_kind.py +0 -36
- numpy-1.9.3/numpy/f2py/tests/test_mixed.py +0 -41
- numpy-1.9.3/numpy/f2py/tests/test_regression.py +0 -32
- numpy-1.9.3/numpy/f2py/tests/test_return_character.py +0 -142
- numpy-1.9.3/numpy/f2py/tests/test_return_complex.py +0 -169
- numpy-1.9.3/numpy/f2py/tests/test_return_integer.py +0 -178
- numpy-1.9.3/numpy/f2py/tests/test_return_logical.py +0 -187
- numpy-1.9.3/numpy/f2py/tests/test_return_real.py +0 -203
- numpy-1.9.3/numpy/f2py/tests/test_size.py +0 -47
- numpy-1.9.3/numpy/f2py/tests/util.py +0 -353
- numpy-1.9.3/numpy/f2py/use_rules.py +0 -109
- numpy-1.9.3/numpy/fft/fftpack.c +0 -1501
- numpy-1.9.3/numpy/fft/fftpack.h +0 -28
- numpy-1.9.3/numpy/fft/fftpack.py +0 -1169
- numpy-1.9.3/numpy/fft/fftpack_litemodule.c +0 -371
- numpy-1.9.3/numpy/fft/info.py +0 -179
- numpy-1.9.3/numpy/fft/setup.py +0 -20
- numpy-1.9.3/numpy/fft/tests/test_fftpack.py +0 -75
- numpy-1.9.3/numpy/fft/tests/test_helper.py +0 -78
- numpy-1.9.3/numpy/lib/_iotools.py +0 -891
- numpy-1.9.3/numpy/lib/arraypad.py +0 -1475
- numpy-1.9.3/numpy/lib/arraysetops.py +0 -464
- numpy-1.9.3/numpy/lib/arrayterator.py +0 -226
- numpy-1.9.3/numpy/lib/financial.py +0 -737
- numpy-1.9.3/numpy/lib/format.py +0 -771
- numpy-1.9.3/numpy/lib/function_base.py +0 -3884
- numpy-1.9.3/numpy/lib/index_tricks.py +0 -869
- numpy-1.9.3/numpy/lib/info.py +0 -151
- numpy-1.9.3/numpy/lib/nanfunctions.py +0 -1158
- numpy-1.9.3/numpy/lib/npyio.py +0 -1871
- numpy-1.9.3/numpy/lib/polynomial.py +0 -1271
- numpy-1.9.3/numpy/lib/recfunctions.py +0 -1003
- numpy-1.9.3/numpy/lib/setup.py +0 -23
- numpy-1.9.3/numpy/lib/shape_base.py +0 -865
- numpy-1.9.3/numpy/lib/src/_compiled_base.c +0 -1761
- numpy-1.9.3/numpy/lib/stride_tricks.py +0 -123
- numpy-1.9.3/numpy/lib/tests/test__iotools.py +0 -326
- numpy-1.9.3/numpy/lib/tests/test__version.py +0 -57
- numpy-1.9.3/numpy/lib/tests/test_arraypad.py +0 -560
- numpy-1.9.3/numpy/lib/tests/test_arraysetops.py +0 -301
- numpy-1.9.3/numpy/lib/tests/test_financial.py +0 -160
- numpy-1.9.3/numpy/lib/tests/test_format.py +0 -716
- numpy-1.9.3/numpy/lib/tests/test_function_base.py +0 -2145
- numpy-1.9.3/numpy/lib/tests/test_index_tricks.py +0 -289
- numpy-1.9.3/numpy/lib/tests/test_io.py +0 -1754
- numpy-1.9.3/numpy/lib/tests/test_nanfunctions.py +0 -774
- numpy-1.9.3/numpy/lib/tests/test_polynomial.py +0 -177
- numpy-1.9.3/numpy/lib/tests/test_recfunctions.py +0 -705
- numpy-1.9.3/numpy/lib/tests/test_shape_base.py +0 -368
- numpy-1.9.3/numpy/lib/tests/test_stride_tricks.py +0 -238
- numpy-1.9.3/numpy/lib/tests/test_twodim_base.py +0 -504
- numpy-1.9.3/numpy/lib/tests/test_type_check.py +0 -328
- numpy-1.9.3/numpy/lib/twodim_base.py +0 -1003
- numpy-1.9.3/numpy/lib/type_check.py +0 -605
- numpy-1.9.3/numpy/lib/utils.py +0 -1176
- numpy-1.9.3/numpy/linalg/lapack_lite/python_xerbla.c +0 -47
- numpy-1.9.3/numpy/linalg/lapack_litemodule.c +0 -362
- numpy-1.9.3/numpy/linalg/linalg.py +0 -2136
- numpy-1.9.3/numpy/linalg/tests/test_build.py +0 -53
- numpy-1.9.3/numpy/linalg/tests/test_linalg.py +0 -1156
- numpy-1.9.3/numpy/linalg/tests/test_regression.py +0 -90
- numpy-1.9.3/numpy/linalg/umath_linalg.c.src +0 -3210
- numpy-1.9.3/numpy/ma/__init__.py +0 -58
- numpy-1.9.3/numpy/ma/bench.py +0 -166
- numpy-1.9.3/numpy/ma/core.py +0 -7374
- numpy-1.9.3/numpy/ma/extras.py +0 -1932
- numpy-1.9.3/numpy/ma/mrecords.py +0 -734
- numpy-1.9.3/numpy/ma/setup.py +0 -20
- numpy-1.9.3/numpy/ma/tests/test_core.py +0 -3706
- numpy-1.9.3/numpy/ma/tests/test_extras.py +0 -954
- numpy-1.9.3/numpy/ma/tests/test_mrecords.py +0 -521
- numpy-1.9.3/numpy/ma/tests/test_old_ma.py +0 -869
- numpy-1.9.3/numpy/ma/tests/test_regression.py +0 -75
- numpy-1.9.3/numpy/ma/tests/test_subclassing.py +0 -236
- numpy-1.9.3/numpy/ma/testutils.py +0 -240
- numpy-1.9.3/numpy/ma/timer_comparison.py +0 -459
- numpy-1.9.3/numpy/matlib.py +0 -358
- numpy-1.9.3/numpy/matrixlib/defmatrix.py +0 -1094
- numpy-1.9.3/numpy/matrixlib/tests/test_defmatrix.py +0 -400
- numpy-1.9.3/numpy/matrixlib/tests/test_multiarray.py +0 -18
- numpy-1.9.3/numpy/matrixlib/tests/test_numeric.py +0 -10
- numpy-1.9.3/numpy/matrixlib/tests/test_regression.py +0 -34
- numpy-1.9.3/numpy/polynomial/_polybase.py +0 -962
- numpy-1.9.3/numpy/polynomial/chebyshev.py +0 -2056
- numpy-1.9.3/numpy/polynomial/hermite.py +0 -1789
- numpy-1.9.3/numpy/polynomial/hermite_e.py +0 -1786
- numpy-1.9.3/numpy/polynomial/laguerre.py +0 -1781
- numpy-1.9.3/numpy/polynomial/legendre.py +0 -1809
- numpy-1.9.3/numpy/polynomial/polytemplate.py +0 -927
- numpy-1.9.3/numpy/polynomial/polyutils.py +0 -403
- numpy-1.9.3/numpy/random/mtrand/distributions.c +0 -892
- numpy-1.9.3/numpy/random/mtrand/mtrand.c +0 -36656
- numpy-1.9.3/numpy/random/mtrand/mtrand.pyx +0 -4706
- numpy-1.9.3/numpy/random/setup.py +0 -74
- numpy-1.9.3/numpy/random/tests/test_random.py +0 -707
- numpy-1.9.3/numpy/random/tests/test_regression.py +0 -86
- numpy-1.9.3/numpy/setup.py +0 -27
- numpy-1.9.3/numpy/testing/__init__.py +0 -16
- numpy-1.9.3/numpy/testing/decorators.py +0 -271
- numpy-1.9.3/numpy/testing/noseclasses.py +0 -353
- numpy-1.9.3/numpy/testing/nosetester.py +0 -504
- numpy-1.9.3/numpy/testing/print_coercion_tables.py +0 -89
- numpy-1.9.3/numpy/testing/setup.py +0 -20
- numpy-1.9.3/numpy/testing/tests/test_decorators.py +0 -185
- numpy-1.9.3/numpy/testing/tests/test_utils.py +0 -558
- numpy-1.9.3/numpy/testing/utils.py +0 -1715
- numpy-1.9.3/numpy/tests/test_ctypeslib.py +0 -102
- numpy-1.9.3/numpy/tests/test_matlib.py +0 -55
- numpy-1.9.3/numpy/version.py +0 -10
- numpy-1.9.3/setup.py +0 -251
- numpy-1.9.3/site.cfg.example +0 -157
- numpy-1.9.3/tools/swig/README +0 -135
- numpy-1.9.3/tools/swig/numpy.i +0 -3085
- numpy-1.9.3/tools/swig/test/Array.i +0 -102
- numpy-1.9.3/tools/swig/test/Makefile +0 -34
- numpy-1.9.3/tools/swig/test/setup.py +0 -64
- numpy-1.9.3/tools/swig/test/testArray.py +0 -284
- numpy-1.9.3/tools/swig/test/testFarray.py +0 -159
- numpy-1.9.3/tools/swig/test/testFortran.py +0 -173
- numpy-1.9.3/tools/swig/test/testMatrix.py +0 -362
- numpy-1.9.3/tools/swig/test/testSuperTensor.py +0 -388
- numpy-1.9.3/tools/swig/test/testTensor.py +0 -402
- numpy-1.9.3/tools/swig/test/testVector.py +0 -381
- {numpy-1.9.3 → numpy-1.10.0.post2}/BENTO_BUILD.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/COMPATIBILITY +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/DEV_README.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/README.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/THANKS.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/Makefile +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/BUGS.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/FAQ.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/HISTORY.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/Makefile +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/OLDNEWS.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/README.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/Release-1.x.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/Release-2.x.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/Release-3.x.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/Release-4.x.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/TESTING.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/THANKS.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/TODO.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/apps.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/bugs.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/collectinput.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/commands.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/default.css +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/docutils.conf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/ex1/arr.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/ex1/bar.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/ex1/foo.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/ex1/foobar-smart.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/ex1/foobar.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/ex1/foobarmodule.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/ex1/runme +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2py.1 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2py2e.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/README.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/aerostructure.jpg +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/flow.jpg +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/mk_html.sh +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/mk_pdf.sh +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/mk_ps.sh +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/src/examples/exp1.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/src/examples/exp1mess.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/src/examples/exp1session.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/src/examples/foo.pyf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/src/examples/foom.pyf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/f2python9-final/structure.jpg +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/fortranobject.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/hello.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/index.html +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/intro.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/multiarray/array_from_pyobj.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/multiarray/bar.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/multiarray/foo.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/multiarray/fortran_array_from_pyobj.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/multiarray/fun.pyf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/multiarray/run.pyf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/multiarray/transpose.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/multiarrays.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/notes.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/oldnews.html +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/options.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/pyforttest.pyf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/pytest.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/python9.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/signaturefile.tex +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/simple.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/simple_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/using_F_compiler.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/f2py/win32_notes.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/postprocess.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.3.0-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.4.0-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.5.0-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.6.0-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.6.1-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.6.2-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.7.0-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.7.1-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.7.2-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.8.0-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.8.1-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.8.2-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.9.0-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.9.1-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/1.9.2-notes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/release/time_based_proposal.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/.git +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/.gitignore +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/Makefile +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/README.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_static/scipyshiny_small.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/layout.html +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/searchbox.html +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/sourcelink.html +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/css/extend.css +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/css/pygments.css +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/css/scipy-central.css +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/css/spc-bootstrap.css +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/css/spc-extend.css +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/all-icons.svg +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/contents.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/create-new-account-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/external-link-icon-shrunk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/external-link-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/external-link-icon.svg +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/external-link-list-icon-tiniest.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/external-link-list-icon-tiny.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/external-link-list-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ad.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ae.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-af.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ag.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ai.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-al.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-am.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ao.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-aq.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ar.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-as.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-at.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-au.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-aw.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-az.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ba.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bb.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bd.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-be.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bf.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bg.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bh.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bi.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bj.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bl.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bn.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bo.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-br.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bs.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bt.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bw.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-by.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-bz.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ca.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cc.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cd.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cf.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cg.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ch.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ci.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ck.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cl.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cn.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-co.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cu.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cv.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cw.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cx.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cy.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-cz.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-de.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-dj.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-dk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-dm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-do.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-dz.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ec.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ee.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-eg.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-er.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-es.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-et.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-fi.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-fj.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-fk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-fm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-fo.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-fr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ga.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gb.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gd.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ge.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gf.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gg.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gh.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gi.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gl.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gn.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gq.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gs.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gt.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gu.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gw.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-gy.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-hk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-hm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-hn.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-hr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ht.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-hu.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-id.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ie.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-il.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-im.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-in.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-io.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-iq.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ir.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-is.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-it.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-je.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-jm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-jo.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-jp.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ke.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-kg.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-kh.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ki.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-km.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-kn.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-kp.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-kr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-kw.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ky.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-kz.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-la.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-lb.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-lc.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-li.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-lk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-lr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ls.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-lt.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-lu.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-lv.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ly.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ma.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mc.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-md.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-me.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mf.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mg.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mh.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ml.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mn.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mo.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mp.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mq.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ms.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mt.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mu.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mv.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mw.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mx.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-my.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-mz.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-na.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-nc.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ne.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-nf.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ng.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ni.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-nl.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-no.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-np.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-nr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-nu.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-nz.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-om.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pa.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pe.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pf.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pg.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ph.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pl.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pn.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ps.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pt.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-pw.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-py.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-qa.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-re.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ro.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-rs.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ru.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-rw.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sa.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sb.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sc.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sd.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-se.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sg.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sh.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-si.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sj.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sl.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sn.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-so.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-st.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sv.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sy.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-sz.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tc.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-td.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tf.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tg.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-th.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tj.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tl.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tn.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-to.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tr.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tt.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tv.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tw.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-tz.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ua.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ug.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-um.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-us.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-uy.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-uz.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-va.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-vc.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ve.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-vg.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-vi.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-vn.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-vu.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-wf.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ws.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-ye.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-za.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-zm.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/flags/flag-zw.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/glyphicons-halflings-white.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/glyphicons-halflings.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/important-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/information-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/internet-web-browser.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/multiple-file-icon-shrunk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/multiple-file-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/multiple-file-icon.svg +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/multiple-file-list-icon-tiny.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/multiple-file-list-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/navigation.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/person-list-icon-tiny.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/person-list-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/scipy-logo.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/scipy_org_logo.gif +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/scipycentral_logo.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/scipyshiny_small.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/send-email-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/single-file-icon-shrunk.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/single-file-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/single-file-icon.svg +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/single-file-list-icon-tiniest.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/single-file-list-icon-tiny.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/single-file-list-icon.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/transparent-pixel.gif +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/img/ui-anim_basic_16x16.gif +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/js/copybutton.js +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/accordion.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/alerts.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/bootstrap.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/breadcrumbs.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/button-groups.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/buttons.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/carousel.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/close.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/code.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/component-animations.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/dropdowns.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/forms.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/grid.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/hero-unit.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/labels-badges.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/layouts.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/media.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/mixins.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/modals.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/navbar.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/navs.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/pager.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/pagination.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/popovers.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/progress-bars.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/reset.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/responsive-1200px-min.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/responsive-767px-max.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/responsive-768px-979px.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/responsive-navbar.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/responsive-utilities.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/responsive.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/scaffolding.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/sprites.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/tables.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/thumbnails.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/tooltip.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/type.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/utilities.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/variables.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/bootstrap/wells.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/spc-bootstrap.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/spc-content.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/spc-extend.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/spc-footer.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/spc-header.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/spc-rightsidebar.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/less/spc-utils.less +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/static/scipy.css_t +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/_theme/scipy/theme.conf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/conf.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/index.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/test_autodoc.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/test_autodoc_2.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/test_autodoc_3.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/test_autodoc_4.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/scipy-sphinx-theme/test_optimize.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/_templates/autosummary/class.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/_templates/indexcontent.html +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/_templates/indexsidebar.html +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/_templates/layout.html +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/about.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/bugs.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/contents.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/dev/gitwash/configure_git.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/dev/gitwash/development_setup.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/dev/gitwash/dot2_dot3.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/dev/gitwash/following_latest.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/dev/gitwash/forking_button.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/dev/gitwash/git_development.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/dev/gitwash/git_intro.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/dev/gitwash/git_resources.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/dev/gitwash/pull_button.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/dev/gitwash_links.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/advanced.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/allocarr.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/allocarr_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/array.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/array_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/calculate.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/calculate_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/callback.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/callback2.pyf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/callback_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/common.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/common_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/compile_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/distutils.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/extcallback.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/extcallback_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/fib1.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/fib1.pyf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/fib2.pyf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/fib3.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/ftype.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/ftype_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/getting-started.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/index.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/moddata.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/moddata_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/python-usage.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/run_main_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/scalar.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/scalar_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/setup_example.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/signature-file.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/spam.pyf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/spam_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/string.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/string_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/usage.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/var.pyf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/f2py/var_session.dat +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/glossary.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/license.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/datetime-proposal.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/datetime-proposal3.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/deferred-ufunc-evaluation.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/generalized-ufuncs.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/groupby_additions.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/index.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/math_config_clean.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/missing-data.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/new-iterator-ufunc.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/newbugtracker.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/npy-format.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/structured_array_extensions.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/ufunc-overrides.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/neps/warnfix.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/arrays.datetime.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/arrays.nditer.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/arrays.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/c-api.deprecations.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/c-api.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/distutils.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/figures/dtype-hierarchy.dia +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/figures/dtype-hierarchy.pdf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/figures/dtype-hierarchy.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/figures/threefundamental.fig +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/figures/threefundamental.pdf +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/figures/threefundamental.png +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/internals.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/maskedarray.baseclass.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/maskedarray.generic.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/maskedarray.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.array-creation.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.bitwise.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.char.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.ctypeslib.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.datetime.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.dtype.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.dual.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.emath.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.err.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.fft.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.financial.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.functional.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.help.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.indexing.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.logic.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.math.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.matlib.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.numarray.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.oldnumeric.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.other.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.padding.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.polynomials.chebyshev.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.polynomials.classes.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.polynomials.hermite.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.polynomials.hermite_e.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.polynomials.laguerre.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.polynomials.legendre.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.polynomials.package.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.polynomials.poly1d.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.polynomials.polynomial.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.polynomials.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.random.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.set.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.testing.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/routines.window.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/reference/swig.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/basics.broadcasting.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/basics.byteswapping.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/basics.creation.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/basics.indexing.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/basics.io.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/basics.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/basics.subclassing.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/basics.types.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/c-info.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/howtofind.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/index.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/introduction.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/misc.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/performance.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/source/user/whatisnumpy.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/.git +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/.gitignore +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/.travis.yml +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/LICENSE.txt +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/MANIFEST.in +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/README.rst +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/comment_eater.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/compiler_unparse.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/docscrape.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/docscrape_sphinx.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/linkcode.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/numpydoc.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/phantom_import.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/plot_directive.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/tests/test_docscrape.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/tests/test_linkcode.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/tests/test_phantom_import.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/tests/test_plot_directive.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/tests/test_traitsdoc.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/numpydoc/traitsdoc.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/doc/sphinxext/setup.py +0 -0
- {numpy-1.9.3/numpy/core/code_generators → numpy-1.10.0.post2/numpy/_build_utils}/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/compat/__init__.py +0 -0
- {numpy-1.9.3/numpy/distutils/tests/f2py_ext → numpy-1.10.0.post2/numpy/core/code_generators}/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/code_generators/genapi.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/code_generators/generate_numpy_api.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/cversions.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/_neighborhood_iterator_imp.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/_numpyconfig.h.in +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/arrayobject.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/arrayscalars.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/halffloat.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/noprefix.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/npy_1_7_deprecated_api.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/npy_interrupt.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/npy_no_deprecated_api.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/npy_os.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/old_defines.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/oldnumeric.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/ufuncobject.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/include/numpy/utils.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/info.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/mlib.ini.in +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/npymath.ini.in +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/dummymodule.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/_datetime.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/alloc.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/array_assign.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/array_assign.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/array_assign_array.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/array_assign_scalar.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/arrayobject.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/buffer.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/calculation.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/conversion_utils.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/convert.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/convert_datatype.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/ctors.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/datetime_busday.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/datetime_busdaycal.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/datetime_strings.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/descriptor.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/flagsobject.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/getset.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/hashdescr.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/item_selection.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/iterators.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/methods.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/nditer_impl.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/nditer_pywrap.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/nditer_templ.c.src +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/numpymemoryview.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/numpyos.h +0 -0
- {numpy-1.9.3/numpy/core/blasdot → numpy-1.10.0.post2/numpy/core/src/multiarray}/python_xerbla.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/refcount.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/refcount.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/sequence.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/sequence.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/shape.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/ucsnarrow.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/usertypes.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/multiarray/usertypes.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/npymath/_signbit.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/npymath/halffloat.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/npymath/npy_math_common.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/npysort/binsearch.c.src +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/private/lowlevel_strided_loops.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/private/npy_binsearch.h.src +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/private/npy_fpmath.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/private/npy_pycompat.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/umath/reduction.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/umath/reduction.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/umath/struct_ufunc_test.c.src +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/umath/ufunc_object.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/src/umath/ufunc_type_resolution.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/tests/data/astype_copy.pkl +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/tests/data/recarray_from_file.fits +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/core/tests/test_scalarprint.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/ctypeslib.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/__version__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/bdist_rpm.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/build_py.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/build_scripts.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/build_src.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/config_compiler.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/develop.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/egg_info.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/install.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/install_clib.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/install_data.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/install_headers.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/command/sdist.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/compat.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/conv_template.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/core.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/cpuinfo.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/environment.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/extension.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/absoft.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/g95.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/hpux.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/ibm.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/lahey.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/mips.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/nag.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/none.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/pathf95.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/fcompiler/vast.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/from_template.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/info.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/line_endings.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/log.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/mingw/gfortran_vs2003_hack.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/numpy_distribution.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/pathccompiler.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/setup.py +0 -0
- {numpy-1.9.3/numpy/distutils/tests/f2py_f90_ext → numpy-1.10.0.post2/numpy/distutils/tests/f2py_ext}/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/f2py_ext/setup.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/f2py_ext/src/fib1.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/f2py_ext/src/fib2.pyf +0 -0
- {numpy-1.9.3/numpy/distutils/tests/gen_ext → numpy-1.10.0.post2/numpy/distutils/tests/f2py_f90_ext}/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/f2py_f90_ext/include/body.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/f2py_f90_ext/setup.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/f2py_f90_ext/src/foo_free.f90 +0 -0
- {numpy-1.9.3/numpy/distutils/tests/pyrex_ext → numpy-1.10.0.post2/numpy/distutils/tests/gen_ext}/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/gen_ext/setup.py +0 -0
- {numpy-1.9.3/numpy/distutils/tests/swig_ext → numpy-1.10.0.post2/numpy/distutils/tests/pyrex_ext}/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/pyrex_ext/primes.pyx +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/pyrex_ext/setup.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/setup.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/swig_ext/setup.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/swig_ext/src/example.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/swig_ext/src/example.i +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/swig_ext/src/zoo.cc +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/swig_ext/src/zoo.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/swig_ext/src/zoo.i +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/distutils/tests/test_exec_command.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/basics.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/broadcasting.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/constants.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/howtofind.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/internals.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/io.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/jargon.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/methods_vs_functions.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/misc.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/performance.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/subclassing.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/doc/ufuncs.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/dual.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/__version__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/info.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/assumed_shape/.f2py_f2cmap +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/assumed_shape/foo_free.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/assumed_shape/foo_mod.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/assumed_shape/foo_use.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/assumed_shape/precision.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/kind/foo.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/mixed/foo.f +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/mixed/foo_fixed.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/mixed/foo_free.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/regression/inout.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/f2py/tests/src/size/foo.f90 +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/fft/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/fft/helper.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/_datasource.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/_version.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/scimath.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/tests/data/python3.npy +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/tests/data/win64python2.npy +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/tests/test__datasource.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/tests/test_arrayterator.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/tests/test_regression.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/tests/test_ufunclike.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/tests/test_utils.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/ufunclike.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/lib/user_array.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/linalg/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/linalg/info.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/linalg/lapack_lite/blas_lite.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/linalg/lapack_lite/dlamch.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/linalg/lapack_lite/dlapack_lite.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/linalg/lapack_lite/f2c.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/linalg/lapack_lite/f2c_lite.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/linalg/lapack_lite/zlapack_lite.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/linalg/setup.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/linalg/tests/test_deprecations.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/ma/version.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/matrixlib/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/matrixlib/setup.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/polynomial.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/setup.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/tests/test_chebyshev.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/tests/test_classes.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/tests/test_hermite.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/tests/test_hermite_e.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/tests/test_laguerre.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/tests/test_legendre.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/tests/test_polynomial.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/tests/test_polyutils.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/polynomial/tests/test_printing.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/__init__.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/info.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/mtrand/Python.pxi +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/mtrand/distributions.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/mtrand/generate_mtrand_c.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/mtrand/initarray.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/mtrand/initarray.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/mtrand/mtrand_py_helper.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/mtrand/numpy.pxd +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/mtrand/randomkit.c +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/random/mtrand/randomkit.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/numpy/testing/tests/test_doctesting.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/setupegg.py +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/Makefile +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/pyfragments.swg +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Array1.cxx +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Array1.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Array2.cxx +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Array2.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Farray.cxx +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Farray.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Farray.i +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Fortran.cxx +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Fortran.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Fortran.i +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Matrix.cxx +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Matrix.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Matrix.i +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/SuperTensor.cxx +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/SuperTensor.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/SuperTensor.i +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Tensor.cxx +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Tensor.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Tensor.i +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Vector.cxx +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Vector.h +0 -0
- {numpy-1.9.3 → numpy-1.10.0.post2}/tools/swig/test/Vector.i +0 -0
|
@@ -1,4645 +0,0 @@
|
|
|
1
|
-
from __future__ import division, absolute_import, print_function
|
|
2
|
-
|
|
3
|
-
import tempfile
|
|
4
|
-
import sys
|
|
5
|
-
import os
|
|
6
|
-
import shutil
|
|
7
|
-
import warnings
|
|
8
|
-
import operator
|
|
9
|
-
import io
|
|
10
|
-
if sys.version_info[0] >= 3:
|
|
11
|
-
import builtins
|
|
12
|
-
else:
|
|
13
|
-
import __builtin__ as builtins
|
|
14
|
-
from decimal import Decimal
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import numpy as np
|
|
18
|
-
from nose import SkipTest
|
|
19
|
-
from numpy.core import *
|
|
20
|
-
from numpy.compat import asbytes, getexception, strchar, sixu
|
|
21
|
-
from test_print import in_foreign_locale
|
|
22
|
-
from numpy.core.multiarray_tests import (
|
|
23
|
-
test_neighborhood_iterator, test_neighborhood_iterator_oob,
|
|
24
|
-
test_pydatamem_seteventhook_start, test_pydatamem_seteventhook_end,
|
|
25
|
-
test_inplace_increment, get_buffer_info, test_as_c_array
|
|
26
|
-
)
|
|
27
|
-
from numpy.testing import (
|
|
28
|
-
TestCase, run_module_suite, assert_, assert_raises,
|
|
29
|
-
assert_equal, assert_almost_equal, assert_array_equal,
|
|
30
|
-
assert_array_almost_equal, assert_allclose,
|
|
31
|
-
assert_array_less, runstring, dec
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
# Need to test an object that does not fully implement math interface
|
|
35
|
-
from datetime import timedelta
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if sys.version_info[:2] > (3, 2):
|
|
39
|
-
# In Python 3.3 the representation of empty shape, strides and suboffsets
|
|
40
|
-
# is an empty tuple instead of None.
|
|
41
|
-
# http://docs.python.org/dev/whatsnew/3.3.html#api-changes
|
|
42
|
-
EMPTY = ()
|
|
43
|
-
else:
|
|
44
|
-
EMPTY = None
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class TestFlags(TestCase):
|
|
48
|
-
def setUp(self):
|
|
49
|
-
self.a = arange(10)
|
|
50
|
-
|
|
51
|
-
def test_writeable(self):
|
|
52
|
-
mydict = locals()
|
|
53
|
-
self.a.flags.writeable = False
|
|
54
|
-
self.assertRaises(ValueError, runstring, 'self.a[0] = 3', mydict)
|
|
55
|
-
self.assertRaises(ValueError, runstring, 'self.a[0:1].itemset(3)', mydict)
|
|
56
|
-
self.a.flags.writeable = True
|
|
57
|
-
self.a[0] = 5
|
|
58
|
-
self.a[0] = 0
|
|
59
|
-
|
|
60
|
-
def test_otherflags(self):
|
|
61
|
-
assert_equal(self.a.flags.carray, True)
|
|
62
|
-
assert_equal(self.a.flags.farray, False)
|
|
63
|
-
assert_equal(self.a.flags.behaved, True)
|
|
64
|
-
assert_equal(self.a.flags.fnc, False)
|
|
65
|
-
assert_equal(self.a.flags.forc, True)
|
|
66
|
-
assert_equal(self.a.flags.owndata, True)
|
|
67
|
-
assert_equal(self.a.flags.writeable, True)
|
|
68
|
-
assert_equal(self.a.flags.aligned, True)
|
|
69
|
-
assert_equal(self.a.flags.updateifcopy, False)
|
|
70
|
-
|
|
71
|
-
def test_string_align(self):
|
|
72
|
-
a = np.zeros(4, dtype=np.dtype('|S4'))
|
|
73
|
-
assert_(a.flags.aligned)
|
|
74
|
-
# not power of two are accessed bytewise and thus considered aligned
|
|
75
|
-
a = np.zeros(5, dtype=np.dtype('|S4'))
|
|
76
|
-
assert_(a.flags.aligned)
|
|
77
|
-
|
|
78
|
-
def test_void_align(self):
|
|
79
|
-
a = np.zeros(4, dtype=np.dtype([("a", "i4"), ("b", "i4")]))
|
|
80
|
-
assert_(a.flags.aligned)
|
|
81
|
-
|
|
82
|
-
class TestHash(TestCase):
|
|
83
|
-
# see #3793
|
|
84
|
-
def test_int(self):
|
|
85
|
-
for st, ut, s in [(np.int8, np.uint8, 8),
|
|
86
|
-
(np.int16, np.uint16, 16),
|
|
87
|
-
(np.int32, np.uint32, 32),
|
|
88
|
-
(np.int64, np.uint64, 64)]:
|
|
89
|
-
for i in range(1, s):
|
|
90
|
-
assert_equal(hash(st(-2**i)), hash(-2**i),
|
|
91
|
-
err_msg="%r: -2**%d" % (st, i))
|
|
92
|
-
assert_equal(hash(st(2**(i - 1))), hash(2**(i - 1)),
|
|
93
|
-
err_msg="%r: 2**%d" % (st, i - 1))
|
|
94
|
-
assert_equal(hash(st(2**i - 1)), hash(2**i - 1),
|
|
95
|
-
err_msg="%r: 2**%d - 1" % (st, i))
|
|
96
|
-
|
|
97
|
-
i = max(i - 1, 1)
|
|
98
|
-
assert_equal(hash(ut(2**(i - 1))), hash(2**(i - 1)),
|
|
99
|
-
err_msg="%r: 2**%d" % (ut, i - 1))
|
|
100
|
-
assert_equal(hash(ut(2**i - 1)), hash(2**i - 1),
|
|
101
|
-
err_msg="%r: 2**%d - 1" % (ut, i))
|
|
102
|
-
|
|
103
|
-
class TestAttributes(TestCase):
|
|
104
|
-
def setUp(self):
|
|
105
|
-
self.one = arange(10)
|
|
106
|
-
self.two = arange(20).reshape(4, 5)
|
|
107
|
-
self.three = arange(60, dtype=float64).reshape(2, 5, 6)
|
|
108
|
-
|
|
109
|
-
def test_attributes(self):
|
|
110
|
-
assert_equal(self.one.shape, (10,))
|
|
111
|
-
assert_equal(self.two.shape, (4, 5))
|
|
112
|
-
assert_equal(self.three.shape, (2, 5, 6))
|
|
113
|
-
self.three.shape = (10, 3, 2)
|
|
114
|
-
assert_equal(self.three.shape, (10, 3, 2))
|
|
115
|
-
self.three.shape = (2, 5, 6)
|
|
116
|
-
assert_equal(self.one.strides, (self.one.itemsize,))
|
|
117
|
-
num = self.two.itemsize
|
|
118
|
-
assert_equal(self.two.strides, (5*num, num))
|
|
119
|
-
num = self.three.itemsize
|
|
120
|
-
assert_equal(self.three.strides, (30*num, 6*num, num))
|
|
121
|
-
assert_equal(self.one.ndim, 1)
|
|
122
|
-
assert_equal(self.two.ndim, 2)
|
|
123
|
-
assert_equal(self.three.ndim, 3)
|
|
124
|
-
num = self.two.itemsize
|
|
125
|
-
assert_equal(self.two.size, 20)
|
|
126
|
-
assert_equal(self.two.nbytes, 20*num)
|
|
127
|
-
assert_equal(self.two.itemsize, self.two.dtype.itemsize)
|
|
128
|
-
assert_equal(self.two.base, arange(20))
|
|
129
|
-
|
|
130
|
-
def test_dtypeattr(self):
|
|
131
|
-
assert_equal(self.one.dtype, dtype(int_))
|
|
132
|
-
assert_equal(self.three.dtype, dtype(float_))
|
|
133
|
-
assert_equal(self.one.dtype.char, 'l')
|
|
134
|
-
assert_equal(self.three.dtype.char, 'd')
|
|
135
|
-
self.assertTrue(self.three.dtype.str[0] in '<>')
|
|
136
|
-
assert_equal(self.one.dtype.str[1], 'i')
|
|
137
|
-
assert_equal(self.three.dtype.str[1], 'f')
|
|
138
|
-
|
|
139
|
-
def test_int_subclassing(self):
|
|
140
|
-
# Regression test for https://github.com/numpy/numpy/pull/3526
|
|
141
|
-
|
|
142
|
-
numpy_int = np.int_(0)
|
|
143
|
-
|
|
144
|
-
if sys.version_info[0] >= 3:
|
|
145
|
-
# On Py3k int_ should not inherit from int, because it's not fixed-width anymore
|
|
146
|
-
assert_equal(isinstance(numpy_int, int), False)
|
|
147
|
-
else:
|
|
148
|
-
# Otherwise, it should inherit from int...
|
|
149
|
-
assert_equal(isinstance(numpy_int, int), True)
|
|
150
|
-
|
|
151
|
-
# ... and fast-path checks on C-API level should also work
|
|
152
|
-
from numpy.core.multiarray_tests import test_int_subclass
|
|
153
|
-
assert_equal(test_int_subclass(numpy_int), True)
|
|
154
|
-
|
|
155
|
-
def test_stridesattr(self):
|
|
156
|
-
x = self.one
|
|
157
|
-
def make_array(size, offset, strides):
|
|
158
|
-
return ndarray(size, buffer=x, dtype=int,
|
|
159
|
-
offset=offset*x.itemsize,
|
|
160
|
-
strides=strides*x.itemsize)
|
|
161
|
-
assert_equal(make_array(4, 4, -1), array([4, 3, 2, 1]))
|
|
162
|
-
self.assertRaises(ValueError, make_array, 4, 4, -2)
|
|
163
|
-
self.assertRaises(ValueError, make_array, 4, 2, -1)
|
|
164
|
-
self.assertRaises(ValueError, make_array, 8, 3, 1)
|
|
165
|
-
assert_equal(make_array(8, 3, 0), np.array([3]*8))
|
|
166
|
-
# Check behavior reported in gh-2503:
|
|
167
|
-
self.assertRaises(ValueError, make_array, (2, 3), 5, array([-2, -3]))
|
|
168
|
-
make_array(0, 0, 10)
|
|
169
|
-
|
|
170
|
-
def test_set_stridesattr(self):
|
|
171
|
-
x = self.one
|
|
172
|
-
def make_array(size, offset, strides):
|
|
173
|
-
try:
|
|
174
|
-
r = ndarray([size], dtype=int, buffer=x, offset=offset*x.itemsize)
|
|
175
|
-
except:
|
|
176
|
-
raise RuntimeError(getexception())
|
|
177
|
-
r.strides = strides=strides*x.itemsize
|
|
178
|
-
return r
|
|
179
|
-
assert_equal(make_array(4, 4, -1), array([4, 3, 2, 1]))
|
|
180
|
-
assert_equal(make_array(7, 3, 1), array([3, 4, 5, 6, 7, 8, 9]))
|
|
181
|
-
self.assertRaises(ValueError, make_array, 4, 4, -2)
|
|
182
|
-
self.assertRaises(ValueError, make_array, 4, 2, -1)
|
|
183
|
-
self.assertRaises(RuntimeError, make_array, 8, 3, 1)
|
|
184
|
-
# Check that the true extent of the array is used.
|
|
185
|
-
# Test relies on as_strided base not exposing a buffer.
|
|
186
|
-
x = np.lib.stride_tricks.as_strided(arange(1), (10, 10), (0, 0))
|
|
187
|
-
def set_strides(arr, strides):
|
|
188
|
-
arr.strides = strides
|
|
189
|
-
self.assertRaises(ValueError, set_strides, x, (10*x.itemsize, x.itemsize))
|
|
190
|
-
|
|
191
|
-
# Test for offset calculations:
|
|
192
|
-
x = np.lib.stride_tricks.as_strided(np.arange(10, dtype=np.int8)[-1],
|
|
193
|
-
shape=(10,), strides=(-1,))
|
|
194
|
-
self.assertRaises(ValueError, set_strides, x[::-1], -1)
|
|
195
|
-
a = x[::-1]
|
|
196
|
-
a.strides = 1
|
|
197
|
-
a[::2].strides = 2
|
|
198
|
-
|
|
199
|
-
def test_fill(self):
|
|
200
|
-
for t in "?bhilqpBHILQPfdgFDGO":
|
|
201
|
-
x = empty((3, 2, 1), t)
|
|
202
|
-
y = empty((3, 2, 1), t)
|
|
203
|
-
x.fill(1)
|
|
204
|
-
y[...] = 1
|
|
205
|
-
assert_equal(x, y)
|
|
206
|
-
|
|
207
|
-
def test_fill_max_uint64(self):
|
|
208
|
-
x = empty((3, 2, 1), dtype=uint64)
|
|
209
|
-
y = empty((3, 2, 1), dtype=uint64)
|
|
210
|
-
value = 2**64 - 1
|
|
211
|
-
y[...] = value
|
|
212
|
-
x.fill(value)
|
|
213
|
-
assert_array_equal(x, y)
|
|
214
|
-
|
|
215
|
-
def test_fill_struct_array(self):
|
|
216
|
-
# Filling from a scalar
|
|
217
|
-
x = array([(0, 0.0), (1, 1.0)], dtype='i4,f8')
|
|
218
|
-
x.fill(x[0])
|
|
219
|
-
assert_equal(x['f1'][1], x['f1'][0])
|
|
220
|
-
# Filling from a tuple that can be converted
|
|
221
|
-
# to a scalar
|
|
222
|
-
x = np.zeros(2, dtype=[('a', 'f8'), ('b', 'i4')])
|
|
223
|
-
x.fill((3.5, -2))
|
|
224
|
-
assert_array_equal(x['a'], [3.5, 3.5])
|
|
225
|
-
assert_array_equal(x['b'], [-2, -2])
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
class TestArrayConstruction(TestCase):
|
|
229
|
-
def test_array(self):
|
|
230
|
-
d = np.ones(6)
|
|
231
|
-
r = np.array([d, d])
|
|
232
|
-
assert_equal(r, np.ones((2, 6)))
|
|
233
|
-
|
|
234
|
-
d = np.ones(6)
|
|
235
|
-
tgt = np.ones((2, 6))
|
|
236
|
-
r = np.array([d, d])
|
|
237
|
-
assert_equal(r, tgt)
|
|
238
|
-
tgt[1] = 2
|
|
239
|
-
r = np.array([d, d + 1])
|
|
240
|
-
assert_equal(r, tgt)
|
|
241
|
-
|
|
242
|
-
d = np.ones(6)
|
|
243
|
-
r = np.array([[d, d]])
|
|
244
|
-
assert_equal(r, np.ones((1, 2, 6)))
|
|
245
|
-
|
|
246
|
-
d = np.ones(6)
|
|
247
|
-
r = np.array([[d, d], [d, d]])
|
|
248
|
-
assert_equal(r, np.ones((2, 2, 6)))
|
|
249
|
-
|
|
250
|
-
d = np.ones((6, 6))
|
|
251
|
-
r = np.array([d, d])
|
|
252
|
-
assert_equal(r, np.ones((2, 6, 6)))
|
|
253
|
-
|
|
254
|
-
d = np.ones((6, ))
|
|
255
|
-
r = np.array([[d, d + 1], d + 2])
|
|
256
|
-
assert_equal(len(r), 2)
|
|
257
|
-
assert_equal(r[0], [d, d + 1])
|
|
258
|
-
assert_equal(r[1], d + 2)
|
|
259
|
-
|
|
260
|
-
tgt = np.ones((2, 3), dtype=np.bool)
|
|
261
|
-
tgt[0, 2] = False
|
|
262
|
-
tgt[1, 0:2] = False
|
|
263
|
-
r = np.array([[True, True, False], [False, False, True]])
|
|
264
|
-
assert_equal(r, tgt)
|
|
265
|
-
r = np.array([[True, False], [True, False], [False, True]])
|
|
266
|
-
assert_equal(r, tgt.T)
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
class TestAssignment(TestCase):
|
|
270
|
-
def test_assignment_broadcasting(self):
|
|
271
|
-
a = np.arange(6).reshape(2, 3)
|
|
272
|
-
|
|
273
|
-
# Broadcasting the input to the output
|
|
274
|
-
a[...] = np.arange(3)
|
|
275
|
-
assert_equal(a, [[0, 1, 2], [0, 1, 2]])
|
|
276
|
-
a[...] = np.arange(2).reshape(2, 1)
|
|
277
|
-
assert_equal(a, [[0, 0, 0], [1, 1, 1]])
|
|
278
|
-
|
|
279
|
-
# For compatibility with <= 1.5, a limited version of broadcasting
|
|
280
|
-
# the output to the input.
|
|
281
|
-
#
|
|
282
|
-
# This behavior is inconsistent with NumPy broadcasting
|
|
283
|
-
# in general, because it only uses one of the two broadcasting
|
|
284
|
-
# rules (adding a new "1" dimension to the left of the shape),
|
|
285
|
-
# applied to the output instead of an input. In NumPy 2.0, this kind
|
|
286
|
-
# of broadcasting assignment will likely be disallowed.
|
|
287
|
-
a[...] = np.arange(6)[::-1].reshape(1, 2, 3)
|
|
288
|
-
assert_equal(a, [[5, 4, 3], [2, 1, 0]])
|
|
289
|
-
# The other type of broadcasting would require a reduction operation.
|
|
290
|
-
def assign(a, b):
|
|
291
|
-
a[...] = b
|
|
292
|
-
assert_raises(ValueError, assign, a, np.arange(12).reshape(2, 2, 3))
|
|
293
|
-
|
|
294
|
-
def test_assignment_errors(self):
|
|
295
|
-
# Address issue #2276
|
|
296
|
-
class C:
|
|
297
|
-
pass
|
|
298
|
-
a = np.zeros(1)
|
|
299
|
-
def assign(v):
|
|
300
|
-
a[0] = v
|
|
301
|
-
assert_raises((AttributeError, TypeError), assign, C())
|
|
302
|
-
assert_raises(ValueError, assign, [1])
|
|
303
|
-
|
|
304
|
-
class TestDtypedescr(TestCase):
|
|
305
|
-
def test_construction(self):
|
|
306
|
-
d1 = dtype('i4')
|
|
307
|
-
assert_equal(d1, dtype(int32))
|
|
308
|
-
d2 = dtype('f8')
|
|
309
|
-
assert_equal(d2, dtype(float64))
|
|
310
|
-
|
|
311
|
-
def test_byteorders(self):
|
|
312
|
-
self.assertNotEqual(dtype('<i4'), dtype('>i4'))
|
|
313
|
-
self.assertNotEqual(dtype([('a', '<i4')]), dtype([('a', '>i4')]))
|
|
314
|
-
|
|
315
|
-
class TestZeroRank(TestCase):
|
|
316
|
-
def setUp(self):
|
|
317
|
-
self.d = array(0), array('x', object)
|
|
318
|
-
|
|
319
|
-
def test_ellipsis_subscript(self):
|
|
320
|
-
a, b = self.d
|
|
321
|
-
self.assertEqual(a[...], 0)
|
|
322
|
-
self.assertEqual(b[...], 'x')
|
|
323
|
-
self.assertTrue(a[...].base is a) # `a[...] is a` in numpy <1.9.
|
|
324
|
-
self.assertTrue(b[...].base is b) # `b[...] is b` in numpy <1.9.
|
|
325
|
-
|
|
326
|
-
def test_empty_subscript(self):
|
|
327
|
-
a, b = self.d
|
|
328
|
-
self.assertEqual(a[()], 0)
|
|
329
|
-
self.assertEqual(b[()], 'x')
|
|
330
|
-
self.assertTrue(type(a[()]) is a.dtype.type)
|
|
331
|
-
self.assertTrue(type(b[()]) is str)
|
|
332
|
-
|
|
333
|
-
def test_invalid_subscript(self):
|
|
334
|
-
a, b = self.d
|
|
335
|
-
self.assertRaises(IndexError, lambda x: x[0], a)
|
|
336
|
-
self.assertRaises(IndexError, lambda x: x[0], b)
|
|
337
|
-
self.assertRaises(IndexError, lambda x: x[array([], int)], a)
|
|
338
|
-
self.assertRaises(IndexError, lambda x: x[array([], int)], b)
|
|
339
|
-
|
|
340
|
-
def test_ellipsis_subscript_assignment(self):
|
|
341
|
-
a, b = self.d
|
|
342
|
-
a[...] = 42
|
|
343
|
-
self.assertEqual(a, 42)
|
|
344
|
-
b[...] = ''
|
|
345
|
-
self.assertEqual(b.item(), '')
|
|
346
|
-
|
|
347
|
-
def test_empty_subscript_assignment(self):
|
|
348
|
-
a, b = self.d
|
|
349
|
-
a[()] = 42
|
|
350
|
-
self.assertEqual(a, 42)
|
|
351
|
-
b[()] = ''
|
|
352
|
-
self.assertEqual(b.item(), '')
|
|
353
|
-
|
|
354
|
-
def test_invalid_subscript_assignment(self):
|
|
355
|
-
a, b = self.d
|
|
356
|
-
def assign(x, i, v):
|
|
357
|
-
x[i] = v
|
|
358
|
-
self.assertRaises(IndexError, assign, a, 0, 42)
|
|
359
|
-
self.assertRaises(IndexError, assign, b, 0, '')
|
|
360
|
-
self.assertRaises(ValueError, assign, a, (), '')
|
|
361
|
-
|
|
362
|
-
def test_newaxis(self):
|
|
363
|
-
a, b = self.d
|
|
364
|
-
self.assertEqual(a[newaxis].shape, (1,))
|
|
365
|
-
self.assertEqual(a[..., newaxis].shape, (1,))
|
|
366
|
-
self.assertEqual(a[newaxis, ...].shape, (1,))
|
|
367
|
-
self.assertEqual(a[..., newaxis].shape, (1,))
|
|
368
|
-
self.assertEqual(a[newaxis, ..., newaxis].shape, (1, 1))
|
|
369
|
-
self.assertEqual(a[..., newaxis, newaxis].shape, (1, 1))
|
|
370
|
-
self.assertEqual(a[newaxis, newaxis, ...].shape, (1, 1))
|
|
371
|
-
self.assertEqual(a[(newaxis,)*10].shape, (1,)*10)
|
|
372
|
-
|
|
373
|
-
def test_invalid_newaxis(self):
|
|
374
|
-
a, b = self.d
|
|
375
|
-
def subscript(x, i): x[i]
|
|
376
|
-
self.assertRaises(IndexError, subscript, a, (newaxis, 0))
|
|
377
|
-
self.assertRaises(IndexError, subscript, a, (newaxis,)*50)
|
|
378
|
-
|
|
379
|
-
def test_constructor(self):
|
|
380
|
-
x = ndarray(())
|
|
381
|
-
x[()] = 5
|
|
382
|
-
self.assertEqual(x[()], 5)
|
|
383
|
-
y = ndarray((), buffer=x)
|
|
384
|
-
y[()] = 6
|
|
385
|
-
self.assertEqual(x[()], 6)
|
|
386
|
-
|
|
387
|
-
def test_output(self):
|
|
388
|
-
x = array(2)
|
|
389
|
-
self.assertRaises(ValueError, add, x, [1], x)
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
class TestScalarIndexing(TestCase):
|
|
393
|
-
def setUp(self):
|
|
394
|
-
self.d = array([0, 1])[0]
|
|
395
|
-
|
|
396
|
-
def test_ellipsis_subscript(self):
|
|
397
|
-
a = self.d
|
|
398
|
-
self.assertEqual(a[...], 0)
|
|
399
|
-
self.assertEqual(a[...].shape, ())
|
|
400
|
-
|
|
401
|
-
def test_empty_subscript(self):
|
|
402
|
-
a = self.d
|
|
403
|
-
self.assertEqual(a[()], 0)
|
|
404
|
-
self.assertEqual(a[()].shape, ())
|
|
405
|
-
|
|
406
|
-
def test_invalid_subscript(self):
|
|
407
|
-
a = self.d
|
|
408
|
-
self.assertRaises(IndexError, lambda x: x[0], a)
|
|
409
|
-
self.assertRaises(IndexError, lambda x: x[array([], int)], a)
|
|
410
|
-
|
|
411
|
-
def test_invalid_subscript_assignment(self):
|
|
412
|
-
a = self.d
|
|
413
|
-
def assign(x, i, v):
|
|
414
|
-
x[i] = v
|
|
415
|
-
self.assertRaises(TypeError, assign, a, 0, 42)
|
|
416
|
-
|
|
417
|
-
def test_newaxis(self):
|
|
418
|
-
a = self.d
|
|
419
|
-
self.assertEqual(a[newaxis].shape, (1,))
|
|
420
|
-
self.assertEqual(a[..., newaxis].shape, (1,))
|
|
421
|
-
self.assertEqual(a[newaxis, ...].shape, (1,))
|
|
422
|
-
self.assertEqual(a[..., newaxis].shape, (1,))
|
|
423
|
-
self.assertEqual(a[newaxis, ..., newaxis].shape, (1, 1))
|
|
424
|
-
self.assertEqual(a[..., newaxis, newaxis].shape, (1, 1))
|
|
425
|
-
self.assertEqual(a[newaxis, newaxis, ...].shape, (1, 1))
|
|
426
|
-
self.assertEqual(a[(newaxis,)*10].shape, (1,)*10)
|
|
427
|
-
|
|
428
|
-
def test_invalid_newaxis(self):
|
|
429
|
-
a = self.d
|
|
430
|
-
def subscript(x, i): x[i]
|
|
431
|
-
self.assertRaises(IndexError, subscript, a, (newaxis, 0))
|
|
432
|
-
self.assertRaises(IndexError, subscript, a, (newaxis,)*50)
|
|
433
|
-
|
|
434
|
-
def test_overlapping_assignment(self):
|
|
435
|
-
# With positive strides
|
|
436
|
-
a = np.arange(4)
|
|
437
|
-
a[:-1] = a[1:]
|
|
438
|
-
assert_equal(a, [1, 2, 3, 3])
|
|
439
|
-
|
|
440
|
-
a = np.arange(4)
|
|
441
|
-
a[1:] = a[:-1]
|
|
442
|
-
assert_equal(a, [0, 0, 1, 2])
|
|
443
|
-
|
|
444
|
-
# With positive and negative strides
|
|
445
|
-
a = np.arange(4)
|
|
446
|
-
a[:] = a[::-1]
|
|
447
|
-
assert_equal(a, [3, 2, 1, 0])
|
|
448
|
-
|
|
449
|
-
a = np.arange(6).reshape(2, 3)
|
|
450
|
-
a[::-1,:] = a[:, ::-1]
|
|
451
|
-
assert_equal(a, [[5, 4, 3], [2, 1, 0]])
|
|
452
|
-
|
|
453
|
-
a = np.arange(6).reshape(2, 3)
|
|
454
|
-
a[::-1, ::-1] = a[:, ::-1]
|
|
455
|
-
assert_equal(a, [[3, 4, 5], [0, 1, 2]])
|
|
456
|
-
|
|
457
|
-
# With just one element overlapping
|
|
458
|
-
a = np.arange(5)
|
|
459
|
-
a[:3] = a[2:]
|
|
460
|
-
assert_equal(a, [2, 3, 4, 3, 4])
|
|
461
|
-
|
|
462
|
-
a = np.arange(5)
|
|
463
|
-
a[2:] = a[:3]
|
|
464
|
-
assert_equal(a, [0, 1, 0, 1, 2])
|
|
465
|
-
|
|
466
|
-
a = np.arange(5)
|
|
467
|
-
a[2::-1] = a[2:]
|
|
468
|
-
assert_equal(a, [4, 3, 2, 3, 4])
|
|
469
|
-
|
|
470
|
-
a = np.arange(5)
|
|
471
|
-
a[2:] = a[2::-1]
|
|
472
|
-
assert_equal(a, [0, 1, 2, 1, 0])
|
|
473
|
-
|
|
474
|
-
a = np.arange(5)
|
|
475
|
-
a[2::-1] = a[:1:-1]
|
|
476
|
-
assert_equal(a, [2, 3, 4, 3, 4])
|
|
477
|
-
|
|
478
|
-
a = np.arange(5)
|
|
479
|
-
a[:1:-1] = a[2::-1]
|
|
480
|
-
assert_equal(a, [0, 1, 0, 1, 2])
|
|
481
|
-
|
|
482
|
-
class TestCreation(TestCase):
|
|
483
|
-
def test_from_attribute(self):
|
|
484
|
-
class x(object):
|
|
485
|
-
def __array__(self, dtype=None):
|
|
486
|
-
pass
|
|
487
|
-
self.assertRaises(ValueError, array, x())
|
|
488
|
-
|
|
489
|
-
def test_from_string(self) :
|
|
490
|
-
types = np.typecodes['AllInteger'] + np.typecodes['Float']
|
|
491
|
-
nstr = ['123', '123']
|
|
492
|
-
result = array([123, 123], dtype=int)
|
|
493
|
-
for type in types :
|
|
494
|
-
msg = 'String conversion for %s' % type
|
|
495
|
-
assert_equal(array(nstr, dtype=type), result, err_msg=msg)
|
|
496
|
-
|
|
497
|
-
def test_void(self):
|
|
498
|
-
arr = np.array([], dtype='V')
|
|
499
|
-
assert_equal(arr.dtype.kind, 'V')
|
|
500
|
-
|
|
501
|
-
def test_zeros(self):
|
|
502
|
-
types = np.typecodes['AllInteger'] + np.typecodes['AllFloat']
|
|
503
|
-
for dt in types:
|
|
504
|
-
d = np.zeros((13,), dtype=dt)
|
|
505
|
-
assert_equal(np.count_nonzero(d), 0)
|
|
506
|
-
# true for ieee floats
|
|
507
|
-
assert_equal(d.sum(), 0)
|
|
508
|
-
assert_(not d.any())
|
|
509
|
-
|
|
510
|
-
d = np.zeros(2, dtype='(2,4)i4')
|
|
511
|
-
assert_equal(np.count_nonzero(d), 0)
|
|
512
|
-
assert_equal(d.sum(), 0)
|
|
513
|
-
assert_(not d.any())
|
|
514
|
-
|
|
515
|
-
d = np.zeros(2, dtype='4i4')
|
|
516
|
-
assert_equal(np.count_nonzero(d), 0)
|
|
517
|
-
assert_equal(d.sum(), 0)
|
|
518
|
-
assert_(not d.any())
|
|
519
|
-
|
|
520
|
-
d = np.zeros(2, dtype='(2,4)i4, (2,4)i4')
|
|
521
|
-
assert_equal(np.count_nonzero(d), 0)
|
|
522
|
-
|
|
523
|
-
@dec.slow
|
|
524
|
-
def test_zeros_big(self):
|
|
525
|
-
# test big array as they might be allocated different by the sytem
|
|
526
|
-
types = np.typecodes['AllInteger'] + np.typecodes['AllFloat']
|
|
527
|
-
for dt in types:
|
|
528
|
-
d = np.zeros((30 * 1024**2,), dtype=dt)
|
|
529
|
-
assert_(not d.any())
|
|
530
|
-
|
|
531
|
-
def test_zeros_obj(self):
|
|
532
|
-
# test initialization from PyLong(0)
|
|
533
|
-
d = np.zeros((13,), dtype=object)
|
|
534
|
-
assert_array_equal(d, [0] * 13)
|
|
535
|
-
assert_equal(np.count_nonzero(d), 0)
|
|
536
|
-
|
|
537
|
-
def test_zeros_obj_obj(self):
|
|
538
|
-
d = zeros(10, dtype=[('k', object, 2)])
|
|
539
|
-
assert_array_equal(d['k'], 0)
|
|
540
|
-
|
|
541
|
-
def test_zeros_like_like_zeros(self):
|
|
542
|
-
# test zeros_like returns the same as zeros
|
|
543
|
-
for c in np.typecodes['All']:
|
|
544
|
-
if c == 'V':
|
|
545
|
-
continue
|
|
546
|
-
d = zeros((3,3), dtype=c)
|
|
547
|
-
assert_array_equal(zeros_like(d), d)
|
|
548
|
-
assert_equal(zeros_like(d).dtype, d.dtype)
|
|
549
|
-
# explicitly check some special cases
|
|
550
|
-
d = zeros((3,3), dtype='S5')
|
|
551
|
-
assert_array_equal(zeros_like(d), d)
|
|
552
|
-
assert_equal(zeros_like(d).dtype, d.dtype)
|
|
553
|
-
d = zeros((3,3), dtype='U5')
|
|
554
|
-
assert_array_equal(zeros_like(d), d)
|
|
555
|
-
assert_equal(zeros_like(d).dtype, d.dtype)
|
|
556
|
-
|
|
557
|
-
d = zeros((3,3), dtype='<i4')
|
|
558
|
-
assert_array_equal(zeros_like(d), d)
|
|
559
|
-
assert_equal(zeros_like(d).dtype, d.dtype)
|
|
560
|
-
d = zeros((3,3), dtype='>i4')
|
|
561
|
-
assert_array_equal(zeros_like(d), d)
|
|
562
|
-
assert_equal(zeros_like(d).dtype, d.dtype)
|
|
563
|
-
|
|
564
|
-
d = zeros((3,3), dtype='<M8[s]')
|
|
565
|
-
assert_array_equal(zeros_like(d), d)
|
|
566
|
-
assert_equal(zeros_like(d).dtype, d.dtype)
|
|
567
|
-
d = zeros((3,3), dtype='>M8[s]')
|
|
568
|
-
assert_array_equal(zeros_like(d), d)
|
|
569
|
-
assert_equal(zeros_like(d).dtype, d.dtype)
|
|
570
|
-
|
|
571
|
-
d = zeros((3,3), dtype='f4,f4')
|
|
572
|
-
assert_array_equal(zeros_like(d), d)
|
|
573
|
-
assert_equal(zeros_like(d).dtype, d.dtype)
|
|
574
|
-
|
|
575
|
-
def test_empty_unicode(self):
|
|
576
|
-
# don't throw decode errors on garbage memory
|
|
577
|
-
for i in range(5, 100, 5):
|
|
578
|
-
d = np.empty(i, dtype='U')
|
|
579
|
-
str(d)
|
|
580
|
-
|
|
581
|
-
def test_sequence_non_homogenous(self):
|
|
582
|
-
assert_equal(np.array([4, 2**80]).dtype, np.object)
|
|
583
|
-
assert_equal(np.array([4, 2**80, 4]).dtype, np.object)
|
|
584
|
-
assert_equal(np.array([2**80, 4]).dtype, np.object)
|
|
585
|
-
assert_equal(np.array([2**80] * 3).dtype, np.object)
|
|
586
|
-
assert_equal(np.array([[1, 1],[1j, 1j]]).dtype, np.complex)
|
|
587
|
-
assert_equal(np.array([[1j, 1j],[1, 1]]).dtype, np.complex)
|
|
588
|
-
assert_equal(np.array([[1, 1, 1],[1, 1j, 1.], [1, 1, 1]]).dtype, np.complex)
|
|
589
|
-
|
|
590
|
-
@dec.skipif(sys.version_info[0] >= 3)
|
|
591
|
-
def test_sequence_long(self):
|
|
592
|
-
assert_equal(np.array([long(4), long(4)]).dtype, np.long)
|
|
593
|
-
assert_equal(np.array([long(4), 2**80]).dtype, np.object)
|
|
594
|
-
assert_equal(np.array([long(4), 2**80, long(4)]).dtype, np.object)
|
|
595
|
-
assert_equal(np.array([2**80, long(4)]).dtype, np.object)
|
|
596
|
-
|
|
597
|
-
def test_non_sequence_sequence(self):
|
|
598
|
-
"""Should not segfault.
|
|
599
|
-
|
|
600
|
-
Class Fail breaks the sequence protocol for new style classes, i.e.,
|
|
601
|
-
those derived from object. Class Map is a mapping type indicated by
|
|
602
|
-
raising a ValueError. At some point we may raise a warning instead
|
|
603
|
-
of an error in the Fail case.
|
|
604
|
-
|
|
605
|
-
"""
|
|
606
|
-
class Fail(object):
|
|
607
|
-
def __len__(self):
|
|
608
|
-
return 1
|
|
609
|
-
|
|
610
|
-
def __getitem__(self, index):
|
|
611
|
-
raise ValueError()
|
|
612
|
-
|
|
613
|
-
class Map(object):
|
|
614
|
-
def __len__(self):
|
|
615
|
-
return 1
|
|
616
|
-
|
|
617
|
-
def __getitem__(self, index):
|
|
618
|
-
raise KeyError()
|
|
619
|
-
|
|
620
|
-
a = np.array([Map()])
|
|
621
|
-
assert_(a.shape == (1,))
|
|
622
|
-
assert_(a.dtype == np.dtype(object))
|
|
623
|
-
assert_raises(ValueError, np.array, [Fail()])
|
|
624
|
-
|
|
625
|
-
def test_no_len_object_type(self):
|
|
626
|
-
# gh-5100, want object array from iterable object without len()
|
|
627
|
-
class Point2:
|
|
628
|
-
def __init__(self):
|
|
629
|
-
pass
|
|
630
|
-
|
|
631
|
-
def __getitem__(self, ind):
|
|
632
|
-
if ind in [0, 1]:
|
|
633
|
-
return ind
|
|
634
|
-
else:
|
|
635
|
-
raise IndexError()
|
|
636
|
-
d = np.array([Point2(), Point2(), Point2()])
|
|
637
|
-
assert_equal(d.dtype, np.dtype(object))
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
class TestStructured(TestCase):
|
|
641
|
-
def test_subarray_field_access(self):
|
|
642
|
-
a = np.zeros((3, 5), dtype=[('a', ('i4', (2, 2)))])
|
|
643
|
-
a['a'] = np.arange(60).reshape(3, 5, 2, 2)
|
|
644
|
-
|
|
645
|
-
# Since the subarray is always in C-order, a transpose
|
|
646
|
-
# does not swap the subarray:
|
|
647
|
-
assert_array_equal(a.T['a'], a['a'].transpose(1, 0, 2, 3))
|
|
648
|
-
|
|
649
|
-
# In Fortran order, the subarray gets appended
|
|
650
|
-
# like in all other cases, not prepended as a special case
|
|
651
|
-
b = a.copy(order='F')
|
|
652
|
-
assert_equal(a['a'].shape, b['a'].shape)
|
|
653
|
-
assert_equal(a.T['a'].shape, a.T.copy()['a'].shape)
|
|
654
|
-
|
|
655
|
-
def test_subarray_comparison(self):
|
|
656
|
-
# Check that comparisons between record arrays with
|
|
657
|
-
# multi-dimensional field types work properly
|
|
658
|
-
a = np.rec.fromrecords(
|
|
659
|
-
[([1, 2, 3], 'a', [[1, 2], [3, 4]]), ([3, 3, 3], 'b', [[0, 0], [0, 0]])],
|
|
660
|
-
dtype=[('a', ('f4', 3)), ('b', np.object), ('c', ('i4', (2, 2)))])
|
|
661
|
-
b = a.copy()
|
|
662
|
-
assert_equal(a==b, [True, True])
|
|
663
|
-
assert_equal(a!=b, [False, False])
|
|
664
|
-
b[1].b = 'c'
|
|
665
|
-
assert_equal(a==b, [True, False])
|
|
666
|
-
assert_equal(a!=b, [False, True])
|
|
667
|
-
for i in range(3):
|
|
668
|
-
b[0].a = a[0].a
|
|
669
|
-
b[0].a[i] = 5
|
|
670
|
-
assert_equal(a==b, [False, False])
|
|
671
|
-
assert_equal(a!=b, [True, True])
|
|
672
|
-
for i in range(2):
|
|
673
|
-
for j in range(2):
|
|
674
|
-
b = a.copy()
|
|
675
|
-
b[0].c[i, j] = 10
|
|
676
|
-
assert_equal(a==b, [False, True])
|
|
677
|
-
assert_equal(a!=b, [True, False])
|
|
678
|
-
|
|
679
|
-
# Check that broadcasting with a subarray works
|
|
680
|
-
a = np.array([[(0,)], [(1,)]], dtype=[('a', 'f8')])
|
|
681
|
-
b = np.array([(0,), (0,), (1,)], dtype=[('a', 'f8')])
|
|
682
|
-
assert_equal(a==b, [[True, True, False], [False, False, True]])
|
|
683
|
-
assert_equal(b==a, [[True, True, False], [False, False, True]])
|
|
684
|
-
a = np.array([[(0,)], [(1,)]], dtype=[('a', 'f8', (1,))])
|
|
685
|
-
b = np.array([(0,), (0,), (1,)], dtype=[('a', 'f8', (1,))])
|
|
686
|
-
assert_equal(a==b, [[True, True, False], [False, False, True]])
|
|
687
|
-
assert_equal(b==a, [[True, True, False], [False, False, True]])
|
|
688
|
-
a = np.array([[([0, 0],)], [([1, 1],)]], dtype=[('a', 'f8', (2,))])
|
|
689
|
-
b = np.array([([0, 0],), ([0, 1],), ([1, 1],)], dtype=[('a', 'f8', (2,))])
|
|
690
|
-
assert_equal(a==b, [[True, False, False], [False, False, True]])
|
|
691
|
-
assert_equal(b==a, [[True, False, False], [False, False, True]])
|
|
692
|
-
|
|
693
|
-
# Check that broadcasting Fortran-style arrays with a subarray work
|
|
694
|
-
a = np.array([[([0, 0],)], [([1, 1],)]], dtype=[('a', 'f8', (2,))], order='F')
|
|
695
|
-
b = np.array([([0, 0],), ([0, 1],), ([1, 1],)], dtype=[('a', 'f8', (2,))])
|
|
696
|
-
assert_equal(a==b, [[True, False, False], [False, False, True]])
|
|
697
|
-
assert_equal(b==a, [[True, False, False], [False, False, True]])
|
|
698
|
-
|
|
699
|
-
# Check that incompatible sub-array shapes don't result to broadcasting
|
|
700
|
-
x = np.zeros((1,), dtype=[('a', ('f4', (1, 2))), ('b', 'i1')])
|
|
701
|
-
y = np.zeros((1,), dtype=[('a', ('f4', (2,))), ('b', 'i1')])
|
|
702
|
-
assert_equal(x == y, False)
|
|
703
|
-
|
|
704
|
-
x = np.zeros((1,), dtype=[('a', ('f4', (2, 1))), ('b', 'i1')])
|
|
705
|
-
y = np.zeros((1,), dtype=[('a', ('f4', (2,))), ('b', 'i1')])
|
|
706
|
-
assert_equal(x == y, False)
|
|
707
|
-
|
|
708
|
-
# Check that structured arrays that are different only in
|
|
709
|
-
# byte-order work
|
|
710
|
-
a = np.array([(5, 42), (10, 1)], dtype=[('a', '>i8'), ('b', '<f8')])
|
|
711
|
-
b = np.array([(5, 43), (10, 1)], dtype=[('a', '<i8'), ('b', '>f8')])
|
|
712
|
-
assert_equal(a == b, [False, True])
|
|
713
|
-
|
|
714
|
-
def test_casting(self):
|
|
715
|
-
# Check that casting a structured array to change its byte order
|
|
716
|
-
# works
|
|
717
|
-
a = np.array([(1,)], dtype=[('a', '<i4')])
|
|
718
|
-
assert_(np.can_cast(a.dtype, [('a', '>i4')], casting='unsafe'))
|
|
719
|
-
b = a.astype([('a', '>i4')])
|
|
720
|
-
assert_equal(b, a.byteswap().newbyteorder())
|
|
721
|
-
assert_equal(a['a'][0], b['a'][0])
|
|
722
|
-
|
|
723
|
-
# Check that equality comparison works on structured arrays if
|
|
724
|
-
# they are 'equiv'-castable
|
|
725
|
-
a = np.array([(5, 42), (10, 1)], dtype=[('a', '>i4'), ('b', '<f8')])
|
|
726
|
-
b = np.array([(42, 5), (1, 10)], dtype=[('b', '>f8'), ('a', '<i4')])
|
|
727
|
-
assert_(np.can_cast(a.dtype, b.dtype, casting='equiv'))
|
|
728
|
-
assert_equal(a == b, [True, True])
|
|
729
|
-
|
|
730
|
-
# Check that 'equiv' casting can reorder fields and change byte
|
|
731
|
-
# order
|
|
732
|
-
assert_(np.can_cast(a.dtype, b.dtype, casting='equiv'))
|
|
733
|
-
c = a.astype(b.dtype, casting='equiv')
|
|
734
|
-
assert_equal(a == c, [True, True])
|
|
735
|
-
|
|
736
|
-
# Check that 'safe' casting can change byte order and up-cast
|
|
737
|
-
# fields
|
|
738
|
-
t = [('a', '<i8'), ('b', '>f8')]
|
|
739
|
-
assert_(np.can_cast(a.dtype, t, casting='safe'))
|
|
740
|
-
c = a.astype(t, casting='safe')
|
|
741
|
-
assert_equal((c == np.array([(5, 42), (10, 1)], dtype=t)),
|
|
742
|
-
[True, True])
|
|
743
|
-
|
|
744
|
-
# Check that 'same_kind' casting can change byte order and
|
|
745
|
-
# change field widths within a "kind"
|
|
746
|
-
t = [('a', '<i4'), ('b', '>f4')]
|
|
747
|
-
assert_(np.can_cast(a.dtype, t, casting='same_kind'))
|
|
748
|
-
c = a.astype(t, casting='same_kind')
|
|
749
|
-
assert_equal((c == np.array([(5, 42), (10, 1)], dtype=t)),
|
|
750
|
-
[True, True])
|
|
751
|
-
|
|
752
|
-
# Check that casting fails if the casting rule should fail on
|
|
753
|
-
# any of the fields
|
|
754
|
-
t = [('a', '>i8'), ('b', '<f4')]
|
|
755
|
-
assert_(not np.can_cast(a.dtype, t, casting='safe'))
|
|
756
|
-
assert_raises(TypeError, a.astype, t, casting='safe')
|
|
757
|
-
t = [('a', '>i2'), ('b', '<f8')]
|
|
758
|
-
assert_(not np.can_cast(a.dtype, t, casting='equiv'))
|
|
759
|
-
assert_raises(TypeError, a.astype, t, casting='equiv')
|
|
760
|
-
t = [('a', '>i8'), ('b', '<i2')]
|
|
761
|
-
assert_(not np.can_cast(a.dtype, t, casting='same_kind'))
|
|
762
|
-
assert_raises(TypeError, a.astype, t, casting='same_kind')
|
|
763
|
-
assert_(not np.can_cast(a.dtype, b.dtype, casting='no'))
|
|
764
|
-
assert_raises(TypeError, a.astype, b.dtype, casting='no')
|
|
765
|
-
|
|
766
|
-
# Check that non-'unsafe' casting can't change the set of field names
|
|
767
|
-
for casting in ['no', 'safe', 'equiv', 'same_kind']:
|
|
768
|
-
t = [('a', '>i4')]
|
|
769
|
-
assert_(not np.can_cast(a.dtype, t, casting=casting))
|
|
770
|
-
t = [('a', '>i4'), ('b', '<f8'), ('c', 'i4')]
|
|
771
|
-
assert_(not np.can_cast(a.dtype, t, casting=casting))
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
class TestBool(TestCase):
|
|
775
|
-
def test_test_interning(self):
|
|
776
|
-
a0 = bool_(0)
|
|
777
|
-
b0 = bool_(False)
|
|
778
|
-
self.assertTrue(a0 is b0)
|
|
779
|
-
a1 = bool_(1)
|
|
780
|
-
b1 = bool_(True)
|
|
781
|
-
self.assertTrue(a1 is b1)
|
|
782
|
-
self.assertTrue(array([True])[0] is a1)
|
|
783
|
-
self.assertTrue(array(True)[()] is a1)
|
|
784
|
-
|
|
785
|
-
def test_sum(self):
|
|
786
|
-
d = np.ones(101, dtype=np.bool);
|
|
787
|
-
assert_equal(d.sum(), d.size)
|
|
788
|
-
assert_equal(d[::2].sum(), d[::2].size)
|
|
789
|
-
assert_equal(d[::-2].sum(), d[::-2].size)
|
|
790
|
-
|
|
791
|
-
d = np.frombuffer(b'\xff\xff' * 100, dtype=bool)
|
|
792
|
-
assert_equal(d.sum(), d.size)
|
|
793
|
-
assert_equal(d[::2].sum(), d[::2].size)
|
|
794
|
-
assert_equal(d[::-2].sum(), d[::-2].size)
|
|
795
|
-
|
|
796
|
-
def check_count_nonzero(self, power, length):
|
|
797
|
-
powers = [2 ** i for i in range(length)]
|
|
798
|
-
for i in range(2**power):
|
|
799
|
-
l = [(i & x) != 0 for x in powers]
|
|
800
|
-
a = np.array(l, dtype=np.bool)
|
|
801
|
-
c = builtins.sum(l)
|
|
802
|
-
self.assertEqual(np.count_nonzero(a), c)
|
|
803
|
-
av = a.view(np.uint8)
|
|
804
|
-
av *= 3
|
|
805
|
-
self.assertEqual(np.count_nonzero(a), c)
|
|
806
|
-
av *= 4
|
|
807
|
-
self.assertEqual(np.count_nonzero(a), c)
|
|
808
|
-
av[av != 0] = 0xFF
|
|
809
|
-
self.assertEqual(np.count_nonzero(a), c)
|
|
810
|
-
|
|
811
|
-
def test_count_nonzero(self):
|
|
812
|
-
# check all 12 bit combinations in a length 17 array
|
|
813
|
-
# covers most cases of the 16 byte unrolled code
|
|
814
|
-
self.check_count_nonzero(12, 17)
|
|
815
|
-
|
|
816
|
-
@dec.slow
|
|
817
|
-
def test_count_nonzero_all(self):
|
|
818
|
-
# check all combinations in a length 17 array
|
|
819
|
-
# covers all cases of the 16 byte unrolled code
|
|
820
|
-
self.check_count_nonzero(17, 17)
|
|
821
|
-
|
|
822
|
-
def test_count_nonzero_unaligned(self):
|
|
823
|
-
# prevent mistakes as e.g. gh-4060
|
|
824
|
-
for o in range(7):
|
|
825
|
-
a = np.zeros((18,), dtype=np.bool)[o+1:]
|
|
826
|
-
a[:o] = True
|
|
827
|
-
self.assertEqual(np.count_nonzero(a), builtins.sum(a.tolist()))
|
|
828
|
-
a = np.ones((18,), dtype=np.bool)[o+1:]
|
|
829
|
-
a[:o] = False
|
|
830
|
-
self.assertEqual(np.count_nonzero(a), builtins.sum(a.tolist()))
|
|
831
|
-
|
|
832
|
-
class TestMethods(TestCase):
|
|
833
|
-
def test_test_round(self):
|
|
834
|
-
assert_equal(array([1.2, 1.5]).round(), [1, 2])
|
|
835
|
-
assert_equal(array(1.5).round(), 2)
|
|
836
|
-
assert_equal(array([12.2, 15.5]).round(-1), [10, 20])
|
|
837
|
-
assert_equal(array([12.15, 15.51]).round(1), [12.2, 15.5])
|
|
838
|
-
|
|
839
|
-
def test_transpose(self):
|
|
840
|
-
a = array([[1, 2], [3, 4]])
|
|
841
|
-
assert_equal(a.transpose(), [[1, 3], [2, 4]])
|
|
842
|
-
self.assertRaises(ValueError, lambda: a.transpose(0))
|
|
843
|
-
self.assertRaises(ValueError, lambda: a.transpose(0, 0))
|
|
844
|
-
self.assertRaises(ValueError, lambda: a.transpose(0, 1, 2))
|
|
845
|
-
|
|
846
|
-
def test_sort(self):
|
|
847
|
-
# test ordering for floats and complex containing nans. It is only
|
|
848
|
-
# necessary to check the lessthan comparison, so sorts that
|
|
849
|
-
# only follow the insertion sort path are sufficient. We only
|
|
850
|
-
# test doubles and complex doubles as the logic is the same.
|
|
851
|
-
|
|
852
|
-
# check doubles
|
|
853
|
-
msg = "Test real sort order with nans"
|
|
854
|
-
a = np.array([np.nan, 1, 0])
|
|
855
|
-
b = sort(a)
|
|
856
|
-
assert_equal(b, a[::-1], msg)
|
|
857
|
-
# check complex
|
|
858
|
-
msg = "Test complex sort order with nans"
|
|
859
|
-
a = np.zeros(9, dtype=np.complex128)
|
|
860
|
-
a.real += [np.nan, np.nan, np.nan, 1, 0, 1, 1, 0, 0]
|
|
861
|
-
a.imag += [np.nan, 1, 0, np.nan, np.nan, 1, 0, 1, 0]
|
|
862
|
-
b = sort(a)
|
|
863
|
-
assert_equal(b, a[::-1], msg)
|
|
864
|
-
|
|
865
|
-
# all c scalar sorts use the same code with different types
|
|
866
|
-
# so it suffices to run a quick check with one type. The number
|
|
867
|
-
# of sorted items must be greater than ~50 to check the actual
|
|
868
|
-
# algorithm because quick and merge sort fall over to insertion
|
|
869
|
-
# sort for small arrays.
|
|
870
|
-
a = np.arange(101)
|
|
871
|
-
b = a[::-1].copy()
|
|
872
|
-
for kind in ['q', 'm', 'h'] :
|
|
873
|
-
msg = "scalar sort, kind=%s" % kind
|
|
874
|
-
c = a.copy();
|
|
875
|
-
c.sort(kind=kind)
|
|
876
|
-
assert_equal(c, a, msg)
|
|
877
|
-
c = b.copy();
|
|
878
|
-
c.sort(kind=kind)
|
|
879
|
-
assert_equal(c, a, msg)
|
|
880
|
-
|
|
881
|
-
# test complex sorts. These use the same code as the scalars
|
|
882
|
-
# but the compare fuction differs.
|
|
883
|
-
ai = a*1j + 1
|
|
884
|
-
bi = b*1j + 1
|
|
885
|
-
for kind in ['q', 'm', 'h'] :
|
|
886
|
-
msg = "complex sort, real part == 1, kind=%s" % kind
|
|
887
|
-
c = ai.copy();
|
|
888
|
-
c.sort(kind=kind)
|
|
889
|
-
assert_equal(c, ai, msg)
|
|
890
|
-
c = bi.copy();
|
|
891
|
-
c.sort(kind=kind)
|
|
892
|
-
assert_equal(c, ai, msg)
|
|
893
|
-
ai = a + 1j
|
|
894
|
-
bi = b + 1j
|
|
895
|
-
for kind in ['q', 'm', 'h'] :
|
|
896
|
-
msg = "complex sort, imag part == 1, kind=%s" % kind
|
|
897
|
-
c = ai.copy();
|
|
898
|
-
c.sort(kind=kind)
|
|
899
|
-
assert_equal(c, ai, msg)
|
|
900
|
-
c = bi.copy();
|
|
901
|
-
c.sort(kind=kind)
|
|
902
|
-
assert_equal(c, ai, msg)
|
|
903
|
-
|
|
904
|
-
# test string sorts.
|
|
905
|
-
s = 'aaaaaaaa'
|
|
906
|
-
a = np.array([s + chr(i) for i in range(101)])
|
|
907
|
-
b = a[::-1].copy()
|
|
908
|
-
for kind in ['q', 'm', 'h'] :
|
|
909
|
-
msg = "string sort, kind=%s" % kind
|
|
910
|
-
c = a.copy();
|
|
911
|
-
c.sort(kind=kind)
|
|
912
|
-
assert_equal(c, a, msg)
|
|
913
|
-
c = b.copy();
|
|
914
|
-
c.sort(kind=kind)
|
|
915
|
-
assert_equal(c, a, msg)
|
|
916
|
-
|
|
917
|
-
# test unicode sorts.
|
|
918
|
-
s = 'aaaaaaaa'
|
|
919
|
-
a = np.array([s + chr(i) for i in range(101)], dtype=np.unicode)
|
|
920
|
-
b = a[::-1].copy()
|
|
921
|
-
for kind in ['q', 'm', 'h'] :
|
|
922
|
-
msg = "unicode sort, kind=%s" % kind
|
|
923
|
-
c = a.copy();
|
|
924
|
-
c.sort(kind=kind)
|
|
925
|
-
assert_equal(c, a, msg)
|
|
926
|
-
c = b.copy();
|
|
927
|
-
c.sort(kind=kind)
|
|
928
|
-
assert_equal(c, a, msg)
|
|
929
|
-
|
|
930
|
-
# test object array sorts.
|
|
931
|
-
a = np.empty((101,), dtype=np.object)
|
|
932
|
-
a[:] = list(range(101))
|
|
933
|
-
b = a[::-1]
|
|
934
|
-
for kind in ['q', 'h', 'm'] :
|
|
935
|
-
msg = "object sort, kind=%s" % kind
|
|
936
|
-
c = a.copy();
|
|
937
|
-
c.sort(kind=kind)
|
|
938
|
-
assert_equal(c, a, msg)
|
|
939
|
-
c = b.copy();
|
|
940
|
-
c.sort(kind=kind)
|
|
941
|
-
assert_equal(c, a, msg)
|
|
942
|
-
|
|
943
|
-
# test record array sorts.
|
|
944
|
-
dt = np.dtype([('f', float), ('i', int)])
|
|
945
|
-
a = array([(i, i) for i in range(101)], dtype = dt)
|
|
946
|
-
b = a[::-1]
|
|
947
|
-
for kind in ['q', 'h', 'm'] :
|
|
948
|
-
msg = "object sort, kind=%s" % kind
|
|
949
|
-
c = a.copy();
|
|
950
|
-
c.sort(kind=kind)
|
|
951
|
-
assert_equal(c, a, msg)
|
|
952
|
-
c = b.copy();
|
|
953
|
-
c.sort(kind=kind)
|
|
954
|
-
assert_equal(c, a, msg)
|
|
955
|
-
|
|
956
|
-
# test datetime64 sorts.
|
|
957
|
-
a = np.arange(0, 101, dtype='datetime64[D]')
|
|
958
|
-
b = a[::-1]
|
|
959
|
-
for kind in ['q', 'h', 'm'] :
|
|
960
|
-
msg = "datetime64 sort, kind=%s" % kind
|
|
961
|
-
c = a.copy();
|
|
962
|
-
c.sort(kind=kind)
|
|
963
|
-
assert_equal(c, a, msg)
|
|
964
|
-
c = b.copy();
|
|
965
|
-
c.sort(kind=kind)
|
|
966
|
-
assert_equal(c, a, msg)
|
|
967
|
-
|
|
968
|
-
# test timedelta64 sorts.
|
|
969
|
-
a = np.arange(0, 101, dtype='timedelta64[D]')
|
|
970
|
-
b = a[::-1]
|
|
971
|
-
for kind in ['q', 'h', 'm'] :
|
|
972
|
-
msg = "timedelta64 sort, kind=%s" % kind
|
|
973
|
-
c = a.copy();
|
|
974
|
-
c.sort(kind=kind)
|
|
975
|
-
assert_equal(c, a, msg)
|
|
976
|
-
c = b.copy();
|
|
977
|
-
c.sort(kind=kind)
|
|
978
|
-
assert_equal(c, a, msg)
|
|
979
|
-
|
|
980
|
-
# check axis handling. This should be the same for all type
|
|
981
|
-
# specific sorts, so we only check it for one type and one kind
|
|
982
|
-
a = np.array([[3, 2], [1, 0]])
|
|
983
|
-
b = np.array([[1, 0], [3, 2]])
|
|
984
|
-
c = np.array([[2, 3], [0, 1]])
|
|
985
|
-
d = a.copy()
|
|
986
|
-
d.sort(axis=0)
|
|
987
|
-
assert_equal(d, b, "test sort with axis=0")
|
|
988
|
-
d = a.copy()
|
|
989
|
-
d.sort(axis=1)
|
|
990
|
-
assert_equal(d, c, "test sort with axis=1")
|
|
991
|
-
d = a.copy()
|
|
992
|
-
d.sort()
|
|
993
|
-
assert_equal(d, c, "test sort with default axis")
|
|
994
|
-
|
|
995
|
-
def test_copy(self):
|
|
996
|
-
def assert_fortran(arr):
|
|
997
|
-
assert_(arr.flags.fortran)
|
|
998
|
-
assert_(arr.flags.f_contiguous)
|
|
999
|
-
assert_(not arr.flags.c_contiguous)
|
|
1000
|
-
|
|
1001
|
-
def assert_c(arr):
|
|
1002
|
-
assert_(not arr.flags.fortran)
|
|
1003
|
-
assert_(not arr.flags.f_contiguous)
|
|
1004
|
-
assert_(arr.flags.c_contiguous)
|
|
1005
|
-
|
|
1006
|
-
a = np.empty((2, 2), order='F')
|
|
1007
|
-
# Test copying a Fortran array
|
|
1008
|
-
assert_c(a.copy())
|
|
1009
|
-
assert_c(a.copy('C'))
|
|
1010
|
-
assert_fortran(a.copy('F'))
|
|
1011
|
-
assert_fortran(a.copy('A'))
|
|
1012
|
-
|
|
1013
|
-
# Now test starting with a C array.
|
|
1014
|
-
a = np.empty((2, 2), order='C')
|
|
1015
|
-
assert_c(a.copy())
|
|
1016
|
-
assert_c(a.copy('C'))
|
|
1017
|
-
assert_fortran(a.copy('F'))
|
|
1018
|
-
assert_c(a.copy('A'))
|
|
1019
|
-
|
|
1020
|
-
def test_sort_order(self):
|
|
1021
|
-
# Test sorting an array with fields
|
|
1022
|
-
x1=np.array([21, 32, 14])
|
|
1023
|
-
x2=np.array(['my', 'first', 'name'])
|
|
1024
|
-
x3=np.array([3.1, 4.5, 6.2])
|
|
1025
|
-
r=np.rec.fromarrays([x1, x2, x3], names='id,word,number')
|
|
1026
|
-
|
|
1027
|
-
r.sort(order=['id'])
|
|
1028
|
-
assert_equal(r.id, array([14, 21, 32]))
|
|
1029
|
-
assert_equal(r.word, array(['name', 'my', 'first']))
|
|
1030
|
-
assert_equal(r.number, array([6.2, 3.1, 4.5]))
|
|
1031
|
-
|
|
1032
|
-
r.sort(order=['word'])
|
|
1033
|
-
assert_equal(r.id, array([32, 21, 14]))
|
|
1034
|
-
assert_equal(r.word, array(['first', 'my', 'name']))
|
|
1035
|
-
assert_equal(r.number, array([4.5, 3.1, 6.2]))
|
|
1036
|
-
|
|
1037
|
-
r.sort(order=['number'])
|
|
1038
|
-
assert_equal(r.id, array([21, 32, 14]))
|
|
1039
|
-
assert_equal(r.word, array(['my', 'first', 'name']))
|
|
1040
|
-
assert_equal(r.number, array([3.1, 4.5, 6.2]))
|
|
1041
|
-
|
|
1042
|
-
if sys.byteorder == 'little':
|
|
1043
|
-
strtype = '>i2'
|
|
1044
|
-
else:
|
|
1045
|
-
strtype = '<i2'
|
|
1046
|
-
mydtype = [('name', strchar + '5'), ('col2', strtype)]
|
|
1047
|
-
r = np.array([('a', 1), ('b', 255), ('c', 3), ('d', 258)],
|
|
1048
|
-
dtype= mydtype)
|
|
1049
|
-
r.sort(order='col2')
|
|
1050
|
-
assert_equal(r['col2'], [1, 3, 255, 258])
|
|
1051
|
-
assert_equal(r, np.array([('a', 1), ('c', 3), ('b', 255), ('d', 258)],
|
|
1052
|
-
dtype=mydtype))
|
|
1053
|
-
|
|
1054
|
-
def test_argsort(self):
|
|
1055
|
-
# all c scalar argsorts use the same code with different types
|
|
1056
|
-
# so it suffices to run a quick check with one type. The number
|
|
1057
|
-
# of sorted items must be greater than ~50 to check the actual
|
|
1058
|
-
# algorithm because quick and merge sort fall over to insertion
|
|
1059
|
-
# sort for small arrays.
|
|
1060
|
-
a = np.arange(101)
|
|
1061
|
-
b = a[::-1].copy()
|
|
1062
|
-
for kind in ['q', 'm', 'h'] :
|
|
1063
|
-
msg = "scalar argsort, kind=%s" % kind
|
|
1064
|
-
assert_equal(a.copy().argsort(kind=kind), a, msg)
|
|
1065
|
-
assert_equal(b.copy().argsort(kind=kind), b, msg)
|
|
1066
|
-
|
|
1067
|
-
# test complex argsorts. These use the same code as the scalars
|
|
1068
|
-
# but the compare fuction differs.
|
|
1069
|
-
ai = a*1j + 1
|
|
1070
|
-
bi = b*1j + 1
|
|
1071
|
-
for kind in ['q', 'm', 'h'] :
|
|
1072
|
-
msg = "complex argsort, kind=%s" % kind
|
|
1073
|
-
assert_equal(ai.copy().argsort(kind=kind), a, msg)
|
|
1074
|
-
assert_equal(bi.copy().argsort(kind=kind), b, msg)
|
|
1075
|
-
ai = a + 1j
|
|
1076
|
-
bi = b + 1j
|
|
1077
|
-
for kind in ['q', 'm', 'h'] :
|
|
1078
|
-
msg = "complex argsort, kind=%s" % kind
|
|
1079
|
-
assert_equal(ai.copy().argsort(kind=kind), a, msg)
|
|
1080
|
-
assert_equal(bi.copy().argsort(kind=kind), b, msg)
|
|
1081
|
-
|
|
1082
|
-
# test string argsorts.
|
|
1083
|
-
s = 'aaaaaaaa'
|
|
1084
|
-
a = np.array([s + chr(i) for i in range(101)])
|
|
1085
|
-
b = a[::-1].copy()
|
|
1086
|
-
r = np.arange(101)
|
|
1087
|
-
rr = r[::-1]
|
|
1088
|
-
for kind in ['q', 'm', 'h'] :
|
|
1089
|
-
msg = "string argsort, kind=%s" % kind
|
|
1090
|
-
assert_equal(a.copy().argsort(kind=kind), r, msg)
|
|
1091
|
-
assert_equal(b.copy().argsort(kind=kind), rr, msg)
|
|
1092
|
-
|
|
1093
|
-
# test unicode argsorts.
|
|
1094
|
-
s = 'aaaaaaaa'
|
|
1095
|
-
a = np.array([s + chr(i) for i in range(101)], dtype=np.unicode)
|
|
1096
|
-
b = a[::-1]
|
|
1097
|
-
r = np.arange(101)
|
|
1098
|
-
rr = r[::-1]
|
|
1099
|
-
for kind in ['q', 'm', 'h'] :
|
|
1100
|
-
msg = "unicode argsort, kind=%s" % kind
|
|
1101
|
-
assert_equal(a.copy().argsort(kind=kind), r, msg)
|
|
1102
|
-
assert_equal(b.copy().argsort(kind=kind), rr, msg)
|
|
1103
|
-
|
|
1104
|
-
# test object array argsorts.
|
|
1105
|
-
a = np.empty((101,), dtype=np.object)
|
|
1106
|
-
a[:] = list(range(101))
|
|
1107
|
-
b = a[::-1]
|
|
1108
|
-
r = np.arange(101)
|
|
1109
|
-
rr = r[::-1]
|
|
1110
|
-
for kind in ['q', 'm', 'h'] :
|
|
1111
|
-
msg = "object argsort, kind=%s" % kind
|
|
1112
|
-
assert_equal(a.copy().argsort(kind=kind), r, msg)
|
|
1113
|
-
assert_equal(b.copy().argsort(kind=kind), rr, msg)
|
|
1114
|
-
|
|
1115
|
-
# test structured array argsorts.
|
|
1116
|
-
dt = np.dtype([('f', float), ('i', int)])
|
|
1117
|
-
a = array([(i, i) for i in range(101)], dtype = dt)
|
|
1118
|
-
b = a[::-1]
|
|
1119
|
-
r = np.arange(101)
|
|
1120
|
-
rr = r[::-1]
|
|
1121
|
-
for kind in ['q', 'm', 'h'] :
|
|
1122
|
-
msg = "structured array argsort, kind=%s" % kind
|
|
1123
|
-
assert_equal(a.copy().argsort(kind=kind), r, msg)
|
|
1124
|
-
assert_equal(b.copy().argsort(kind=kind), rr, msg)
|
|
1125
|
-
|
|
1126
|
-
# test datetime64 argsorts.
|
|
1127
|
-
a = np.arange(0, 101, dtype='datetime64[D]')
|
|
1128
|
-
b = a[::-1]
|
|
1129
|
-
r = np.arange(101)
|
|
1130
|
-
rr = r[::-1]
|
|
1131
|
-
for kind in ['q', 'h', 'm'] :
|
|
1132
|
-
msg = "datetime64 argsort, kind=%s" % kind
|
|
1133
|
-
assert_equal(a.copy().argsort(kind=kind), r, msg)
|
|
1134
|
-
assert_equal(b.copy().argsort(kind=kind), rr, msg)
|
|
1135
|
-
|
|
1136
|
-
# test timedelta64 argsorts.
|
|
1137
|
-
a = np.arange(0, 101, dtype='timedelta64[D]')
|
|
1138
|
-
b = a[::-1]
|
|
1139
|
-
r = np.arange(101)
|
|
1140
|
-
rr = r[::-1]
|
|
1141
|
-
for kind in ['q', 'h', 'm'] :
|
|
1142
|
-
msg = "timedelta64 argsort, kind=%s" % kind
|
|
1143
|
-
assert_equal(a.copy().argsort(kind=kind), r, msg)
|
|
1144
|
-
assert_equal(b.copy().argsort(kind=kind), rr, msg)
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
# check axis handling. This should be the same for all type
|
|
1148
|
-
# specific argsorts, so we only check it for one type and one kind
|
|
1149
|
-
a = np.array([[3, 2], [1, 0]])
|
|
1150
|
-
b = np.array([[1, 1], [0, 0]])
|
|
1151
|
-
c = np.array([[1, 0], [1, 0]])
|
|
1152
|
-
assert_equal(a.copy().argsort(axis=0), b)
|
|
1153
|
-
assert_equal(a.copy().argsort(axis=1), c)
|
|
1154
|
-
assert_equal(a.copy().argsort(), c)
|
|
1155
|
-
# using None is known fail at this point
|
|
1156
|
-
#assert_equal(a.copy().argsort(axis=None, c)
|
|
1157
|
-
|
|
1158
|
-
# check that stable argsorts are stable
|
|
1159
|
-
r = np.arange(100)
|
|
1160
|
-
# scalars
|
|
1161
|
-
a = np.zeros(100)
|
|
1162
|
-
assert_equal(a.argsort(kind='m'), r)
|
|
1163
|
-
# complex
|
|
1164
|
-
a = np.zeros(100, dtype=np.complex)
|
|
1165
|
-
assert_equal(a.argsort(kind='m'), r)
|
|
1166
|
-
# string
|
|
1167
|
-
a = np.array(['aaaaaaaaa' for i in range(100)])
|
|
1168
|
-
assert_equal(a.argsort(kind='m'), r)
|
|
1169
|
-
# unicode
|
|
1170
|
-
a = np.array(['aaaaaaaaa' for i in range(100)], dtype=np.unicode)
|
|
1171
|
-
assert_equal(a.argsort(kind='m'), r)
|
|
1172
|
-
|
|
1173
|
-
def test_sort_unicode_kind(self):
|
|
1174
|
-
d = np.arange(10)
|
|
1175
|
-
k = b'\xc3\xa4'.decode("UTF8")
|
|
1176
|
-
assert_raises(ValueError, d.sort, kind=k)
|
|
1177
|
-
assert_raises(ValueError, d.argsort, kind=k)
|
|
1178
|
-
|
|
1179
|
-
def test_searchsorted(self):
|
|
1180
|
-
# test for floats and complex containing nans. The logic is the
|
|
1181
|
-
# same for all float types so only test double types for now.
|
|
1182
|
-
# The search sorted routines use the compare functions for the
|
|
1183
|
-
# array type, so this checks if that is consistent with the sort
|
|
1184
|
-
# order.
|
|
1185
|
-
|
|
1186
|
-
# check double
|
|
1187
|
-
a = np.array([0, 1, np.nan])
|
|
1188
|
-
msg = "Test real searchsorted with nans, side='l'"
|
|
1189
|
-
b = a.searchsorted(a, side='l')
|
|
1190
|
-
assert_equal(b, np.arange(3), msg)
|
|
1191
|
-
msg = "Test real searchsorted with nans, side='r'"
|
|
1192
|
-
b = a.searchsorted(a, side='r')
|
|
1193
|
-
assert_equal(b, np.arange(1, 4), msg)
|
|
1194
|
-
# check double complex
|
|
1195
|
-
a = np.zeros(9, dtype=np.complex128)
|
|
1196
|
-
a.real += [0, 0, 1, 1, 0, 1, np.nan, np.nan, np.nan]
|
|
1197
|
-
a.imag += [0, 1, 0, 1, np.nan, np.nan, 0, 1, np.nan]
|
|
1198
|
-
msg = "Test complex searchsorted with nans, side='l'"
|
|
1199
|
-
b = a.searchsorted(a, side='l')
|
|
1200
|
-
assert_equal(b, np.arange(9), msg)
|
|
1201
|
-
msg = "Test complex searchsorted with nans, side='r'"
|
|
1202
|
-
b = a.searchsorted(a, side='r')
|
|
1203
|
-
assert_equal(b, np.arange(1, 10), msg)
|
|
1204
|
-
msg = "Test searchsorted with little endian, side='l'"
|
|
1205
|
-
a = np.array([0, 128], dtype='<i4')
|
|
1206
|
-
b = a.searchsorted(np.array(128, dtype='<i4'))
|
|
1207
|
-
assert_equal(b, 1, msg)
|
|
1208
|
-
msg = "Test searchsorted with big endian, side='l'"
|
|
1209
|
-
a = np.array([0, 128], dtype='>i4')
|
|
1210
|
-
b = a.searchsorted(np.array(128, dtype='>i4'))
|
|
1211
|
-
assert_equal(b, 1, msg)
|
|
1212
|
-
|
|
1213
|
-
# Check 0 elements
|
|
1214
|
-
a = np.ones(0)
|
|
1215
|
-
b = a.searchsorted([0, 1, 2], 'l')
|
|
1216
|
-
assert_equal(b, [0, 0, 0])
|
|
1217
|
-
b = a.searchsorted([0, 1, 2], 'r')
|
|
1218
|
-
assert_equal(b, [0, 0, 0])
|
|
1219
|
-
a = np.ones(1)
|
|
1220
|
-
# Check 1 element
|
|
1221
|
-
b = a.searchsorted([0, 1, 2], 'l')
|
|
1222
|
-
assert_equal(b, [0, 0, 1])
|
|
1223
|
-
b = a.searchsorted([0, 1, 2], 'r')
|
|
1224
|
-
assert_equal(b, [0, 1, 1])
|
|
1225
|
-
# Check all elements equal
|
|
1226
|
-
a = np.ones(2)
|
|
1227
|
-
b = a.searchsorted([0, 1, 2], 'l')
|
|
1228
|
-
assert_equal(b, [0, 0, 2])
|
|
1229
|
-
b = a.searchsorted([0, 1, 2], 'r')
|
|
1230
|
-
assert_equal(b, [0, 2, 2])
|
|
1231
|
-
|
|
1232
|
-
# Test searching unaligned array
|
|
1233
|
-
a = np.arange(10)
|
|
1234
|
-
aligned = np.empty(a.itemsize * a.size + 1, 'uint8')
|
|
1235
|
-
unaligned = aligned[1:].view(a.dtype)
|
|
1236
|
-
unaligned[:] = a
|
|
1237
|
-
# Test searching unaligned array
|
|
1238
|
-
b = unaligned.searchsorted(a, 'l')
|
|
1239
|
-
assert_equal(b, a)
|
|
1240
|
-
b = unaligned.searchsorted(a, 'r')
|
|
1241
|
-
assert_equal(b, a + 1)
|
|
1242
|
-
# Test searching for unaligned keys
|
|
1243
|
-
b = a.searchsorted(unaligned, 'l')
|
|
1244
|
-
assert_equal(b, a)
|
|
1245
|
-
b = a.searchsorted(unaligned, 'r')
|
|
1246
|
-
assert_equal(b, a + 1)
|
|
1247
|
-
|
|
1248
|
-
# Test smart resetting of binsearch indices
|
|
1249
|
-
a = np.arange(5)
|
|
1250
|
-
b = a.searchsorted([6, 5, 4], 'l')
|
|
1251
|
-
assert_equal(b, [5, 5, 4])
|
|
1252
|
-
b = a.searchsorted([6, 5, 4], 'r')
|
|
1253
|
-
assert_equal(b, [5, 5, 5])
|
|
1254
|
-
|
|
1255
|
-
# Test all type specific binary search functions
|
|
1256
|
-
types = ''.join((np.typecodes['AllInteger'], np.typecodes['AllFloat'],
|
|
1257
|
-
np.typecodes['Datetime'], '?O'))
|
|
1258
|
-
for dt in types:
|
|
1259
|
-
if dt == 'M':
|
|
1260
|
-
dt = 'M8[D]'
|
|
1261
|
-
if dt == '?':
|
|
1262
|
-
a = np.arange(2, dtype=dt)
|
|
1263
|
-
out = np.arange(2)
|
|
1264
|
-
else:
|
|
1265
|
-
a = np.arange(0, 5, dtype=dt)
|
|
1266
|
-
out = np.arange(5)
|
|
1267
|
-
b = a.searchsorted(a, 'l')
|
|
1268
|
-
assert_equal(b, out)
|
|
1269
|
-
b = a.searchsorted(a, 'r')
|
|
1270
|
-
assert_equal(b, out + 1)
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
def test_searchsorted_unicode(self):
|
|
1274
|
-
# Test searchsorted on unicode strings.
|
|
1275
|
-
|
|
1276
|
-
# 1.6.1 contained a string length miscalculation in
|
|
1277
|
-
# arraytypes.c.src:UNICODE_compare() which manifested as
|
|
1278
|
-
# incorrect/inconsistent results from searchsorted.
|
|
1279
|
-
a = np.array(['P:\\20x_dapi_cy3\\20x_dapi_cy3_20100185_1',
|
|
1280
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100186_1',
|
|
1281
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100187_1',
|
|
1282
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100189_1',
|
|
1283
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100190_1',
|
|
1284
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100191_1',
|
|
1285
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100192_1',
|
|
1286
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100193_1',
|
|
1287
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100194_1',
|
|
1288
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100195_1',
|
|
1289
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100196_1',
|
|
1290
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100197_1',
|
|
1291
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100198_1',
|
|
1292
|
-
'P:\\20x_dapi_cy3\\20x_dapi_cy3_20100199_1'],
|
|
1293
|
-
dtype=np.unicode)
|
|
1294
|
-
ind = np.arange(len(a))
|
|
1295
|
-
assert_equal([a.searchsorted(v, 'left') for v in a], ind)
|
|
1296
|
-
assert_equal([a.searchsorted(v, 'right') for v in a], ind + 1)
|
|
1297
|
-
assert_equal([a.searchsorted(a[i], 'left') for i in ind], ind)
|
|
1298
|
-
assert_equal([a.searchsorted(a[i], 'right') for i in ind], ind + 1)
|
|
1299
|
-
|
|
1300
|
-
def test_searchsorted_with_sorter(self):
|
|
1301
|
-
a = np.array([5, 2, 1, 3, 4])
|
|
1302
|
-
s = np.argsort(a)
|
|
1303
|
-
assert_raises(TypeError, np.searchsorted, a, 0, sorter=(1, (2, 3)))
|
|
1304
|
-
assert_raises(TypeError, np.searchsorted, a, 0, sorter=[1.1])
|
|
1305
|
-
assert_raises(ValueError, np.searchsorted, a, 0, sorter=[1, 2, 3, 4])
|
|
1306
|
-
assert_raises(ValueError, np.searchsorted, a, 0, sorter=[1, 2, 3, 4, 5, 6])
|
|
1307
|
-
|
|
1308
|
-
# bounds check
|
|
1309
|
-
assert_raises(ValueError, np.searchsorted, a, 4, sorter=[0, 1, 2, 3, 5])
|
|
1310
|
-
assert_raises(ValueError, np.searchsorted, a, 0, sorter=[-1, 0, 1, 2, 3])
|
|
1311
|
-
assert_raises(ValueError, np.searchsorted, a, 0, sorter=[4, 0, -1, 2, 3])
|
|
1312
|
-
|
|
1313
|
-
a = np.random.rand(300)
|
|
1314
|
-
s = a.argsort()
|
|
1315
|
-
b = np.sort(a)
|
|
1316
|
-
k = np.linspace(0, 1, 20)
|
|
1317
|
-
assert_equal(b.searchsorted(k), a.searchsorted(k, sorter=s))
|
|
1318
|
-
|
|
1319
|
-
a = np.array([0, 1, 2, 3, 5]*20)
|
|
1320
|
-
s = a.argsort()
|
|
1321
|
-
k = [0, 1, 2, 3, 5]
|
|
1322
|
-
expected = [0, 20, 40, 60, 80]
|
|
1323
|
-
assert_equal(a.searchsorted(k, side='l', sorter=s), expected)
|
|
1324
|
-
expected = [20, 40, 60, 80, 100]
|
|
1325
|
-
assert_equal(a.searchsorted(k, side='r', sorter=s), expected)
|
|
1326
|
-
|
|
1327
|
-
# Test searching unaligned array
|
|
1328
|
-
keys = np.arange(10)
|
|
1329
|
-
a = keys.copy()
|
|
1330
|
-
np.random.shuffle(s)
|
|
1331
|
-
s = a.argsort()
|
|
1332
|
-
aligned = np.empty(a.itemsize * a.size + 1, 'uint8')
|
|
1333
|
-
unaligned = aligned[1:].view(a.dtype)
|
|
1334
|
-
# Test searching unaligned array
|
|
1335
|
-
unaligned[:] = a
|
|
1336
|
-
b = unaligned.searchsorted(keys, 'l', s)
|
|
1337
|
-
assert_equal(b, keys)
|
|
1338
|
-
b = unaligned.searchsorted(keys, 'r', s)
|
|
1339
|
-
assert_equal(b, keys + 1)
|
|
1340
|
-
# Test searching for unaligned keys
|
|
1341
|
-
unaligned[:] = keys
|
|
1342
|
-
b = a.searchsorted(unaligned, 'l', s)
|
|
1343
|
-
assert_equal(b, keys)
|
|
1344
|
-
b = a.searchsorted(unaligned, 'r', s)
|
|
1345
|
-
assert_equal(b, keys + 1)
|
|
1346
|
-
|
|
1347
|
-
# Test all type specific indirect binary search functions
|
|
1348
|
-
types = ''.join((np.typecodes['AllInteger'], np.typecodes['AllFloat'],
|
|
1349
|
-
np.typecodes['Datetime'], '?O'))
|
|
1350
|
-
for dt in types:
|
|
1351
|
-
if dt == 'M':
|
|
1352
|
-
dt = 'M8[D]'
|
|
1353
|
-
if dt == '?':
|
|
1354
|
-
a = np.array([1, 0], dtype=dt)
|
|
1355
|
-
# We want the sorter array to be of a type that is different
|
|
1356
|
-
# from np.intp in all platforms, to check for #4698
|
|
1357
|
-
s = np.array([1, 0], dtype=np.int16)
|
|
1358
|
-
out = np.array([1, 0])
|
|
1359
|
-
else:
|
|
1360
|
-
a = np.array([3, 4, 1, 2, 0], dtype=dt)
|
|
1361
|
-
# We want the sorter array to be of a type that is different
|
|
1362
|
-
# from np.intp in all platforms, to check for #4698
|
|
1363
|
-
s = np.array([4, 2, 3, 0, 1], dtype=np.int16)
|
|
1364
|
-
out = np.array([3, 4, 1, 2, 0], dtype=np.intp)
|
|
1365
|
-
b = a.searchsorted(a, 'l', s)
|
|
1366
|
-
assert_equal(b, out)
|
|
1367
|
-
b = a.searchsorted(a, 'r', s)
|
|
1368
|
-
assert_equal(b, out + 1)
|
|
1369
|
-
|
|
1370
|
-
# Test non-contiguous sorter array
|
|
1371
|
-
a = np.array([3, 4, 1, 2, 0])
|
|
1372
|
-
srt = np.empty((10,), dtype=np.intp)
|
|
1373
|
-
srt[1::2] = -1
|
|
1374
|
-
srt[::2] = [4, 2, 3, 0, 1]
|
|
1375
|
-
s = srt[::2]
|
|
1376
|
-
out = np.array([3, 4, 1, 2, 0], dtype=np.intp)
|
|
1377
|
-
b = a.searchsorted(a, 'l', s)
|
|
1378
|
-
assert_equal(b, out)
|
|
1379
|
-
b = a.searchsorted(a, 'r', s)
|
|
1380
|
-
assert_equal(b, out + 1)
|
|
1381
|
-
|
|
1382
|
-
def test_partition(self):
|
|
1383
|
-
d = np.arange(10)
|
|
1384
|
-
assert_raises(TypeError, np.partition, d, 2, kind=1)
|
|
1385
|
-
assert_raises(ValueError, np.partition, d, 2, kind="nonsense")
|
|
1386
|
-
assert_raises(ValueError, np.argpartition, d, 2, kind="nonsense")
|
|
1387
|
-
assert_raises(ValueError, d.partition, 2, axis=0, kind="nonsense")
|
|
1388
|
-
assert_raises(ValueError, d.argpartition, 2, axis=0, kind="nonsense")
|
|
1389
|
-
for k in ("introselect",):
|
|
1390
|
-
d = np.array([])
|
|
1391
|
-
assert_array_equal(np.partition(d, 0, kind=k), d)
|
|
1392
|
-
assert_array_equal(np.argpartition(d, 0, kind=k), d)
|
|
1393
|
-
d = np.ones((1))
|
|
1394
|
-
assert_array_equal(np.partition(d, 0, kind=k)[0], d)
|
|
1395
|
-
assert_array_equal(d[np.argpartition(d, 0, kind=k)],
|
|
1396
|
-
np.partition(d, 0, kind=k))
|
|
1397
|
-
|
|
1398
|
-
# kth not modified
|
|
1399
|
-
kth = np.array([30, 15, 5])
|
|
1400
|
-
okth = kth.copy()
|
|
1401
|
-
np.partition(np.arange(40), kth)
|
|
1402
|
-
assert_array_equal(kth, okth)
|
|
1403
|
-
|
|
1404
|
-
for r in ([2, 1], [1, 2], [1, 1]):
|
|
1405
|
-
d = np.array(r)
|
|
1406
|
-
tgt = np.sort(d)
|
|
1407
|
-
assert_array_equal(np.partition(d, 0, kind=k)[0], tgt[0])
|
|
1408
|
-
assert_array_equal(np.partition(d, 1, kind=k)[1], tgt[1])
|
|
1409
|
-
assert_array_equal(d[np.argpartition(d, 0, kind=k)],
|
|
1410
|
-
np.partition(d, 0, kind=k))
|
|
1411
|
-
assert_array_equal(d[np.argpartition(d, 1, kind=k)],
|
|
1412
|
-
np.partition(d, 1, kind=k))
|
|
1413
|
-
for i in range(d.size):
|
|
1414
|
-
d[i:].partition(0, kind=k)
|
|
1415
|
-
assert_array_equal(d, tgt)
|
|
1416
|
-
|
|
1417
|
-
for r in ([3, 2, 1], [1, 2, 3], [2, 1, 3], [2, 3, 1],
|
|
1418
|
-
[1, 1, 1], [1, 2, 2], [2, 2, 1], [1, 2, 1]):
|
|
1419
|
-
d = np.array(r)
|
|
1420
|
-
tgt = np.sort(d)
|
|
1421
|
-
assert_array_equal(np.partition(d, 0, kind=k)[0], tgt[0])
|
|
1422
|
-
assert_array_equal(np.partition(d, 1, kind=k)[1], tgt[1])
|
|
1423
|
-
assert_array_equal(np.partition(d, 2, kind=k)[2], tgt[2])
|
|
1424
|
-
assert_array_equal(d[np.argpartition(d, 0, kind=k)],
|
|
1425
|
-
np.partition(d, 0, kind=k))
|
|
1426
|
-
assert_array_equal(d[np.argpartition(d, 1, kind=k)],
|
|
1427
|
-
np.partition(d, 1, kind=k))
|
|
1428
|
-
assert_array_equal(d[np.argpartition(d, 2, kind=k)],
|
|
1429
|
-
np.partition(d, 2, kind=k))
|
|
1430
|
-
for i in range(d.size):
|
|
1431
|
-
d[i:].partition(0, kind=k)
|
|
1432
|
-
assert_array_equal(d, tgt)
|
|
1433
|
-
|
|
1434
|
-
d = np.ones((50))
|
|
1435
|
-
assert_array_equal(np.partition(d, 0, kind=k), d)
|
|
1436
|
-
assert_array_equal(d[np.argpartition(d, 0, kind=k)],
|
|
1437
|
-
np.partition(d, 0, kind=k))
|
|
1438
|
-
|
|
1439
|
-
# sorted
|
|
1440
|
-
d = np.arange((49))
|
|
1441
|
-
self.assertEqual(np.partition(d, 5, kind=k)[5], 5)
|
|
1442
|
-
self.assertEqual(np.partition(d, 15, kind=k)[15], 15)
|
|
1443
|
-
assert_array_equal(d[np.argpartition(d, 5, kind=k)],
|
|
1444
|
-
np.partition(d, 5, kind=k))
|
|
1445
|
-
assert_array_equal(d[np.argpartition(d, 15, kind=k)],
|
|
1446
|
-
np.partition(d, 15, kind=k))
|
|
1447
|
-
|
|
1448
|
-
# rsorted
|
|
1449
|
-
d = np.arange((47))[::-1]
|
|
1450
|
-
self.assertEqual(np.partition(d, 6, kind=k)[6], 6)
|
|
1451
|
-
self.assertEqual(np.partition(d, 16, kind=k)[16], 16)
|
|
1452
|
-
assert_array_equal(d[np.argpartition(d, 6, kind=k)],
|
|
1453
|
-
np.partition(d, 6, kind=k))
|
|
1454
|
-
assert_array_equal(d[np.argpartition(d, 16, kind=k)],
|
|
1455
|
-
np.partition(d, 16, kind=k))
|
|
1456
|
-
|
|
1457
|
-
assert_array_equal(np.partition(d, -6, kind=k),
|
|
1458
|
-
np.partition(d, 41, kind=k))
|
|
1459
|
-
assert_array_equal(np.partition(d, -16, kind=k),
|
|
1460
|
-
np.partition(d, 31, kind=k))
|
|
1461
|
-
assert_array_equal(d[np.argpartition(d, -6, kind=k)],
|
|
1462
|
-
np.partition(d, 41, kind=k))
|
|
1463
|
-
|
|
1464
|
-
# median of 3 killer, O(n^2) on pure median 3 pivot quickselect
|
|
1465
|
-
# exercises the median of median of 5 code used to keep O(n)
|
|
1466
|
-
d = np.arange(1000000)
|
|
1467
|
-
x = np.roll(d, d.size // 2)
|
|
1468
|
-
mid = x.size // 2 + 1
|
|
1469
|
-
assert_equal(np.partition(x, mid)[mid], mid)
|
|
1470
|
-
d = np.arange(1000001)
|
|
1471
|
-
x = np.roll(d, d.size // 2 + 1)
|
|
1472
|
-
mid = x.size // 2 + 1
|
|
1473
|
-
assert_equal(np.partition(x, mid)[mid], mid)
|
|
1474
|
-
|
|
1475
|
-
# max
|
|
1476
|
-
d = np.ones(10); d[1] = 4;
|
|
1477
|
-
assert_equal(np.partition(d, (2, -1))[-1], 4)
|
|
1478
|
-
assert_equal(np.partition(d, (2, -1))[2], 1)
|
|
1479
|
-
assert_equal(d[np.argpartition(d, (2, -1))][-1], 4)
|
|
1480
|
-
assert_equal(d[np.argpartition(d, (2, -1))][2], 1)
|
|
1481
|
-
d[1] = np.nan
|
|
1482
|
-
assert_(np.isnan(d[np.argpartition(d, (2, -1))][-1]))
|
|
1483
|
-
assert_(np.isnan(np.partition(d, (2, -1))[-1]))
|
|
1484
|
-
|
|
1485
|
-
# equal elements
|
|
1486
|
-
d = np.arange((47)) % 7
|
|
1487
|
-
tgt = np.sort(np.arange((47)) % 7)
|
|
1488
|
-
np.random.shuffle(d)
|
|
1489
|
-
for i in range(d.size):
|
|
1490
|
-
self.assertEqual(np.partition(d, i, kind=k)[i], tgt[i])
|
|
1491
|
-
assert_array_equal(d[np.argpartition(d, 6, kind=k)],
|
|
1492
|
-
np.partition(d, 6, kind=k))
|
|
1493
|
-
assert_array_equal(d[np.argpartition(d, 16, kind=k)],
|
|
1494
|
-
np.partition(d, 16, kind=k))
|
|
1495
|
-
for i in range(d.size):
|
|
1496
|
-
d[i:].partition(0, kind=k)
|
|
1497
|
-
assert_array_equal(d, tgt)
|
|
1498
|
-
|
|
1499
|
-
d = np.array([0, 1, 2, 3, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
|
1500
|
-
7, 7, 7, 7, 7, 9])
|
|
1501
|
-
kth = [0, 3, 19, 20]
|
|
1502
|
-
assert_equal(np.partition(d, kth, kind=k)[kth], (0, 3, 7, 7))
|
|
1503
|
-
assert_equal(d[np.argpartition(d, kth, kind=k)][kth], (0, 3, 7, 7))
|
|
1504
|
-
|
|
1505
|
-
d = np.array([2, 1])
|
|
1506
|
-
d.partition(0, kind=k)
|
|
1507
|
-
assert_raises(ValueError, d.partition, 2)
|
|
1508
|
-
assert_raises(ValueError, d.partition, 3, axis=1)
|
|
1509
|
-
assert_raises(ValueError, np.partition, d, 2)
|
|
1510
|
-
assert_raises(ValueError, np.partition, d, 2, axis=1)
|
|
1511
|
-
assert_raises(ValueError, d.argpartition, 2)
|
|
1512
|
-
assert_raises(ValueError, d.argpartition, 3, axis=1)
|
|
1513
|
-
assert_raises(ValueError, np.argpartition, d, 2)
|
|
1514
|
-
assert_raises(ValueError, np.argpartition, d, 2, axis=1)
|
|
1515
|
-
d = np.arange(10).reshape((2, 5))
|
|
1516
|
-
d.partition(1, axis=0, kind=k)
|
|
1517
|
-
d.partition(4, axis=1, kind=k)
|
|
1518
|
-
np.partition(d, 1, axis=0, kind=k)
|
|
1519
|
-
np.partition(d, 4, axis=1, kind=k)
|
|
1520
|
-
np.partition(d, 1, axis=None, kind=k)
|
|
1521
|
-
np.partition(d, 9, axis=None, kind=k)
|
|
1522
|
-
d.argpartition(1, axis=0, kind=k)
|
|
1523
|
-
d.argpartition(4, axis=1, kind=k)
|
|
1524
|
-
np.argpartition(d, 1, axis=0, kind=k)
|
|
1525
|
-
np.argpartition(d, 4, axis=1, kind=k)
|
|
1526
|
-
np.argpartition(d, 1, axis=None, kind=k)
|
|
1527
|
-
np.argpartition(d, 9, axis=None, kind=k)
|
|
1528
|
-
assert_raises(ValueError, d.partition, 2, axis=0)
|
|
1529
|
-
assert_raises(ValueError, d.partition, 11, axis=1)
|
|
1530
|
-
assert_raises(TypeError, d.partition, 2, axis=None)
|
|
1531
|
-
assert_raises(ValueError, np.partition, d, 9, axis=1)
|
|
1532
|
-
assert_raises(ValueError, np.partition, d, 11, axis=None)
|
|
1533
|
-
assert_raises(ValueError, d.argpartition, 2, axis=0)
|
|
1534
|
-
assert_raises(ValueError, d.argpartition, 11, axis=1)
|
|
1535
|
-
assert_raises(ValueError, np.argpartition, d, 9, axis=1)
|
|
1536
|
-
assert_raises(ValueError, np.argpartition, d, 11, axis=None)
|
|
1537
|
-
|
|
1538
|
-
td = [(dt, s) for dt in [np.int32, np.float32, np.complex64]
|
|
1539
|
-
for s in (9, 16)]
|
|
1540
|
-
for dt, s in td:
|
|
1541
|
-
aae = assert_array_equal
|
|
1542
|
-
at = self.assertTrue
|
|
1543
|
-
|
|
1544
|
-
d = np.arange(s, dtype=dt)
|
|
1545
|
-
np.random.shuffle(d)
|
|
1546
|
-
d1 = np.tile(np.arange(s, dtype=dt), (4, 1))
|
|
1547
|
-
map(np.random.shuffle, d1)
|
|
1548
|
-
d0 = np.transpose(d1)
|
|
1549
|
-
for i in range(d.size):
|
|
1550
|
-
p = np.partition(d, i, kind=k)
|
|
1551
|
-
self.assertEqual(p[i], i)
|
|
1552
|
-
# all before are smaller
|
|
1553
|
-
assert_array_less(p[:i], p[i])
|
|
1554
|
-
# all after are larger
|
|
1555
|
-
assert_array_less(p[i], p[i + 1:])
|
|
1556
|
-
aae(p, d[np.argpartition(d, i, kind=k)])
|
|
1557
|
-
|
|
1558
|
-
p = np.partition(d1, i, axis=1, kind=k)
|
|
1559
|
-
aae(p[:, i], np.array([i] * d1.shape[0], dtype=dt))
|
|
1560
|
-
# array_less does not seem to work right
|
|
1561
|
-
at((p[:, :i].T <= p[:, i]).all(),
|
|
1562
|
-
msg="%d: %r <= %r" % (i, p[:, i], p[:, :i].T))
|
|
1563
|
-
at((p[:, i + 1:].T > p[:, i]).all(),
|
|
1564
|
-
msg="%d: %r < %r" % (i, p[:, i], p[:, i + 1:].T))
|
|
1565
|
-
aae(p, d1[np.arange(d1.shape[0])[:, None],
|
|
1566
|
-
np.argpartition(d1, i, axis=1, kind=k)])
|
|
1567
|
-
|
|
1568
|
-
p = np.partition(d0, i, axis=0, kind=k)
|
|
1569
|
-
aae(p[i,:], np.array([i] * d1.shape[0],
|
|
1570
|
-
dtype=dt))
|
|
1571
|
-
# array_less does not seem to work right
|
|
1572
|
-
at((p[:i,:] <= p[i,:]).all(),
|
|
1573
|
-
msg="%d: %r <= %r" % (i, p[i,:], p[:i,:]))
|
|
1574
|
-
at((p[i + 1:,:] > p[i,:]).all(),
|
|
1575
|
-
msg="%d: %r < %r" % (i, p[i,:], p[:, i + 1:]))
|
|
1576
|
-
aae(p, d0[np.argpartition(d0, i, axis=0, kind=k),
|
|
1577
|
-
np.arange(d0.shape[1])[None,:]])
|
|
1578
|
-
|
|
1579
|
-
# check inplace
|
|
1580
|
-
dc = d.copy()
|
|
1581
|
-
dc.partition(i, kind=k)
|
|
1582
|
-
assert_equal(dc, np.partition(d, i, kind=k))
|
|
1583
|
-
dc = d0.copy()
|
|
1584
|
-
dc.partition(i, axis=0, kind=k)
|
|
1585
|
-
assert_equal(dc, np.partition(d0, i, axis=0, kind=k))
|
|
1586
|
-
dc = d1.copy()
|
|
1587
|
-
dc.partition(i, axis=1, kind=k)
|
|
1588
|
-
assert_equal(dc, np.partition(d1, i, axis=1, kind=k))
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
def assert_partitioned(self, d, kth):
|
|
1592
|
-
prev = 0
|
|
1593
|
-
for k in np.sort(kth):
|
|
1594
|
-
assert_array_less(d[prev:k], d[k], err_msg='kth %d' % k)
|
|
1595
|
-
assert_((d[k:] >= d[k]).all(),
|
|
1596
|
-
msg="kth %d, %r not greater equal %d" % (k, d[k:], d[k]))
|
|
1597
|
-
prev = k + 1
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
def test_partition_iterative(self):
|
|
1601
|
-
d = np.arange(17)
|
|
1602
|
-
kth = (0, 1, 2, 429, 231)
|
|
1603
|
-
assert_raises(ValueError, d.partition, kth)
|
|
1604
|
-
assert_raises(ValueError, d.argpartition, kth)
|
|
1605
|
-
d = np.arange(10).reshape((2, 5))
|
|
1606
|
-
assert_raises(ValueError, d.partition, kth, axis=0)
|
|
1607
|
-
assert_raises(ValueError, d.partition, kth, axis=1)
|
|
1608
|
-
assert_raises(ValueError, np.partition, d, kth, axis=1)
|
|
1609
|
-
assert_raises(ValueError, np.partition, d, kth, axis=None)
|
|
1610
|
-
|
|
1611
|
-
d = np.array([3, 4, 2, 1])
|
|
1612
|
-
p = np.partition(d, (0, 3))
|
|
1613
|
-
self.assert_partitioned(p, (0, 3))
|
|
1614
|
-
self.assert_partitioned(d[np.argpartition(d, (0, 3))], (0, 3))
|
|
1615
|
-
|
|
1616
|
-
assert_array_equal(p, np.partition(d, (-3, -1)))
|
|
1617
|
-
assert_array_equal(p, d[np.argpartition(d, (-3, -1))])
|
|
1618
|
-
|
|
1619
|
-
d = np.arange(17)
|
|
1620
|
-
np.random.shuffle(d)
|
|
1621
|
-
d.partition(range(d.size))
|
|
1622
|
-
assert_array_equal(np.arange(17), d)
|
|
1623
|
-
np.random.shuffle(d)
|
|
1624
|
-
assert_array_equal(np.arange(17), d[d.argpartition(range(d.size))])
|
|
1625
|
-
|
|
1626
|
-
# test unsorted kth
|
|
1627
|
-
d = np.arange(17)
|
|
1628
|
-
np.random.shuffle(d)
|
|
1629
|
-
keys = np.array([1, 3, 8, -2])
|
|
1630
|
-
np.random.shuffle(d)
|
|
1631
|
-
p = np.partition(d, keys)
|
|
1632
|
-
self.assert_partitioned(p, keys)
|
|
1633
|
-
p = d[np.argpartition(d, keys)]
|
|
1634
|
-
self.assert_partitioned(p, keys)
|
|
1635
|
-
np.random.shuffle(keys)
|
|
1636
|
-
assert_array_equal(np.partition(d, keys), p)
|
|
1637
|
-
assert_array_equal(d[np.argpartition(d, keys)], p)
|
|
1638
|
-
|
|
1639
|
-
# equal kth
|
|
1640
|
-
d = np.arange(20)[::-1]
|
|
1641
|
-
self.assert_partitioned(np.partition(d, [5]*4), [5])
|
|
1642
|
-
self.assert_partitioned(np.partition(d, [5]*4 + [6, 13]),
|
|
1643
|
-
[5]*4 + [6, 13])
|
|
1644
|
-
self.assert_partitioned(d[np.argpartition(d, [5]*4)], [5])
|
|
1645
|
-
self.assert_partitioned(d[np.argpartition(d, [5]*4 + [6, 13])],
|
|
1646
|
-
[5]*4 + [6, 13])
|
|
1647
|
-
|
|
1648
|
-
d = np.arange(12)
|
|
1649
|
-
np.random.shuffle(d)
|
|
1650
|
-
d1 = np.tile(np.arange(12), (4, 1))
|
|
1651
|
-
map(np.random.shuffle, d1)
|
|
1652
|
-
d0 = np.transpose(d1)
|
|
1653
|
-
|
|
1654
|
-
kth = (1, 6, 7, -1)
|
|
1655
|
-
p = np.partition(d1, kth, axis=1)
|
|
1656
|
-
pa = d1[np.arange(d1.shape[0])[:, None],
|
|
1657
|
-
d1.argpartition(kth, axis=1)]
|
|
1658
|
-
assert_array_equal(p, pa)
|
|
1659
|
-
for i in range(d1.shape[0]):
|
|
1660
|
-
self.assert_partitioned(p[i,:], kth)
|
|
1661
|
-
p = np.partition(d0, kth, axis=0)
|
|
1662
|
-
pa = d0[np.argpartition(d0, kth, axis=0),
|
|
1663
|
-
np.arange(d0.shape[1])[None,:]]
|
|
1664
|
-
assert_array_equal(p, pa)
|
|
1665
|
-
for i in range(d0.shape[1]):
|
|
1666
|
-
self.assert_partitioned(p[:, i], kth)
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
def test_partition_cdtype(self):
|
|
1670
|
-
d = array([('Galahad', 1.7, 38), ('Arthur', 1.8, 41),
|
|
1671
|
-
('Lancelot', 1.9, 38)],
|
|
1672
|
-
dtype=[('name', '|S10'), ('height', '<f8'), ('age', '<i4')])
|
|
1673
|
-
|
|
1674
|
-
tgt = np.sort(d, order=['age', 'height'])
|
|
1675
|
-
assert_array_equal(np.partition(d, range(d.size),
|
|
1676
|
-
order=['age', 'height']),
|
|
1677
|
-
tgt)
|
|
1678
|
-
assert_array_equal(d[np.argpartition(d, range(d.size),
|
|
1679
|
-
order=['age', 'height'])],
|
|
1680
|
-
tgt)
|
|
1681
|
-
for k in range(d.size):
|
|
1682
|
-
assert_equal(np.partition(d, k, order=['age', 'height'])[k],
|
|
1683
|
-
tgt[k])
|
|
1684
|
-
assert_equal(d[np.argpartition(d, k, order=['age', 'height'])][k],
|
|
1685
|
-
tgt[k])
|
|
1686
|
-
|
|
1687
|
-
d = array(['Galahad', 'Arthur', 'zebra', 'Lancelot'])
|
|
1688
|
-
tgt = np.sort(d)
|
|
1689
|
-
assert_array_equal(np.partition(d, range(d.size)), tgt)
|
|
1690
|
-
for k in range(d.size):
|
|
1691
|
-
assert_equal(np.partition(d, k)[k], tgt[k])
|
|
1692
|
-
assert_equal(d[np.argpartition(d, k)][k], tgt[k])
|
|
1693
|
-
|
|
1694
|
-
def test_partition_unicode_kind(self):
|
|
1695
|
-
d = np.arange(10)
|
|
1696
|
-
k = b'\xc3\xa4'.decode("UTF8")
|
|
1697
|
-
assert_raises(ValueError, d.partition, 2, kind=k)
|
|
1698
|
-
assert_raises(ValueError, d.argpartition, 2, kind=k)
|
|
1699
|
-
|
|
1700
|
-
def test_partition_fuzz(self):
|
|
1701
|
-
# a few rounds of random data testing
|
|
1702
|
-
for j in range(10, 30):
|
|
1703
|
-
for i in range(1, j - 2):
|
|
1704
|
-
d = np.arange(j)
|
|
1705
|
-
np.random.shuffle(d)
|
|
1706
|
-
d = d % np.random.randint(2, 30)
|
|
1707
|
-
idx = np.random.randint(d.size)
|
|
1708
|
-
kth = [0, idx, i, i + 1]
|
|
1709
|
-
tgt = np.sort(d)[kth]
|
|
1710
|
-
assert_array_equal(np.partition(d, kth)[kth], tgt,
|
|
1711
|
-
err_msg="data: %r\n kth: %r" % (d, kth))
|
|
1712
|
-
|
|
1713
|
-
def test_argpartition_gh5524(self):
|
|
1714
|
-
# A test for functionality of argpartition on lists.
|
|
1715
|
-
d = [6,7,3,2,9,0]
|
|
1716
|
-
p = np.argpartition(d,1)
|
|
1717
|
-
self.assert_partitioned(np.array(d)[p],[1])
|
|
1718
|
-
|
|
1719
|
-
def test_flatten(self):
|
|
1720
|
-
x0 = np.array([[1, 2, 3], [4, 5, 6]], np.int32)
|
|
1721
|
-
x1 = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], np.int32)
|
|
1722
|
-
y0 = np.array([1, 2, 3, 4, 5, 6], np.int32)
|
|
1723
|
-
y0f = np.array([1, 4, 2, 5, 3, 6], np.int32)
|
|
1724
|
-
y1 = np.array([1, 2, 3, 4, 5, 6, 7, 8], np.int32)
|
|
1725
|
-
y1f = np.array([1, 5, 3, 7, 2, 6, 4, 8], np.int32)
|
|
1726
|
-
assert_equal(x0.flatten(), y0)
|
|
1727
|
-
assert_equal(x0.flatten('F'), y0f)
|
|
1728
|
-
assert_equal(x0.flatten('F'), x0.T.flatten())
|
|
1729
|
-
assert_equal(x1.flatten(), y1)
|
|
1730
|
-
assert_equal(x1.flatten('F'), y1f)
|
|
1731
|
-
assert_equal(x1.flatten('F'), x1.T.flatten())
|
|
1732
|
-
|
|
1733
|
-
def test_dot(self):
|
|
1734
|
-
a = np.array([[1, 0], [0, 1]])
|
|
1735
|
-
b = np.array([[0, 1], [1, 0]])
|
|
1736
|
-
c = np.array([[9, 1], [1, -9]])
|
|
1737
|
-
|
|
1738
|
-
assert_equal(np.dot(a, b), a.dot(b))
|
|
1739
|
-
assert_equal(np.dot(np.dot(a, b), c), a.dot(b).dot(c))
|
|
1740
|
-
|
|
1741
|
-
# test passing in an output array
|
|
1742
|
-
c = np.zeros_like(a)
|
|
1743
|
-
a.dot(b, c)
|
|
1744
|
-
assert_equal(c, np.dot(a, b))
|
|
1745
|
-
|
|
1746
|
-
# test keyword args
|
|
1747
|
-
c = np.zeros_like(a)
|
|
1748
|
-
a.dot(b=b, out=c)
|
|
1749
|
-
assert_equal(c, np.dot(a, b))
|
|
1750
|
-
|
|
1751
|
-
@dec.skipif(True) # ufunc override disabled for 1.9
|
|
1752
|
-
def test_dot_override(self):
|
|
1753
|
-
class A(object):
|
|
1754
|
-
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
|
|
1755
|
-
return "A"
|
|
1756
|
-
|
|
1757
|
-
class B(object):
|
|
1758
|
-
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
|
|
1759
|
-
return NotImplemented
|
|
1760
|
-
|
|
1761
|
-
a = A()
|
|
1762
|
-
b = B()
|
|
1763
|
-
c = np.array([[1]])
|
|
1764
|
-
|
|
1765
|
-
assert_equal(np.dot(a, b), "A")
|
|
1766
|
-
assert_equal(c.dot(a), "A")
|
|
1767
|
-
assert_raises(TypeError, np.dot, b, c)
|
|
1768
|
-
assert_raises(TypeError, c.dot, b)
|
|
1769
|
-
|
|
1770
|
-
def test_diagonal(self):
|
|
1771
|
-
a = np.arange(12).reshape((3, 4))
|
|
1772
|
-
assert_equal(a.diagonal(), [0, 5, 10])
|
|
1773
|
-
assert_equal(a.diagonal(0), [0, 5, 10])
|
|
1774
|
-
assert_equal(a.diagonal(1), [1, 6, 11])
|
|
1775
|
-
assert_equal(a.diagonal(-1), [4, 9])
|
|
1776
|
-
|
|
1777
|
-
b = np.arange(8).reshape((2, 2, 2))
|
|
1778
|
-
assert_equal(b.diagonal(), [[0, 6], [1, 7]])
|
|
1779
|
-
assert_equal(b.diagonal(0), [[0, 6], [1, 7]])
|
|
1780
|
-
assert_equal(b.diagonal(1), [[2], [3]])
|
|
1781
|
-
assert_equal(b.diagonal(-1), [[4], [5]])
|
|
1782
|
-
assert_raises(ValueError, b.diagonal, axis1=0, axis2=0)
|
|
1783
|
-
assert_equal(b.diagonal(0, 1, 2), [[0, 3], [4, 7]])
|
|
1784
|
-
assert_equal(b.diagonal(0, 0, 1), [[0, 6], [1, 7]])
|
|
1785
|
-
assert_equal(b.diagonal(offset=1, axis1=0, axis2=2), [[1], [3]])
|
|
1786
|
-
# Order of axis argument doesn't matter:
|
|
1787
|
-
assert_equal(b.diagonal(0, 2, 1), [[0, 3], [4, 7]])
|
|
1788
|
-
|
|
1789
|
-
def test_diagonal_view_notwriteable(self):
|
|
1790
|
-
# this test is only for 1.9, the diagonal view will be
|
|
1791
|
-
# writeable in 1.10.
|
|
1792
|
-
a = np.eye(3).diagonal()
|
|
1793
|
-
assert_(not a.flags.writeable)
|
|
1794
|
-
assert_(not a.flags.owndata)
|
|
1795
|
-
|
|
1796
|
-
a = np.diagonal(np.eye(3))
|
|
1797
|
-
assert_(not a.flags.writeable)
|
|
1798
|
-
assert_(not a.flags.owndata)
|
|
1799
|
-
|
|
1800
|
-
a = np.diag(np.eye(3))
|
|
1801
|
-
assert_(not a.flags.writeable)
|
|
1802
|
-
assert_(not a.flags.owndata)
|
|
1803
|
-
|
|
1804
|
-
def test_diagonal_memleak(self):
|
|
1805
|
-
# Regression test for a bug that crept in at one point
|
|
1806
|
-
a = np.zeros((100, 100))
|
|
1807
|
-
assert_(sys.getrefcount(a) < 50)
|
|
1808
|
-
for i in range(100):
|
|
1809
|
-
a.diagonal()
|
|
1810
|
-
assert_(sys.getrefcount(a) < 50)
|
|
1811
|
-
|
|
1812
|
-
def test_put(self):
|
|
1813
|
-
icodes = np.typecodes['AllInteger']
|
|
1814
|
-
fcodes = np.typecodes['AllFloat']
|
|
1815
|
-
for dt in icodes + fcodes + 'O':
|
|
1816
|
-
tgt = np.array([0, 1, 0, 3, 0, 5], dtype=dt)
|
|
1817
|
-
|
|
1818
|
-
# test 1-d
|
|
1819
|
-
a = np.zeros(6, dtype=dt)
|
|
1820
|
-
a.put([1, 3, 5], [1, 3, 5])
|
|
1821
|
-
assert_equal(a, tgt)
|
|
1822
|
-
|
|
1823
|
-
# test 2-d
|
|
1824
|
-
a = np.zeros((2, 3), dtype=dt)
|
|
1825
|
-
a.put([1, 3, 5], [1, 3, 5])
|
|
1826
|
-
assert_equal(a, tgt.reshape(2, 3))
|
|
1827
|
-
|
|
1828
|
-
for dt in '?':
|
|
1829
|
-
tgt = np.array([False, True, False, True, False, True], dtype=dt)
|
|
1830
|
-
|
|
1831
|
-
# test 1-d
|
|
1832
|
-
a = np.zeros(6, dtype=dt)
|
|
1833
|
-
a.put([1, 3, 5], [True]*3)
|
|
1834
|
-
assert_equal(a, tgt)
|
|
1835
|
-
|
|
1836
|
-
# test 2-d
|
|
1837
|
-
a = np.zeros((2, 3), dtype=dt)
|
|
1838
|
-
a.put([1, 3, 5], [True]*3)
|
|
1839
|
-
assert_equal(a, tgt.reshape(2, 3))
|
|
1840
|
-
|
|
1841
|
-
# check must be writeable
|
|
1842
|
-
a = np.zeros(6)
|
|
1843
|
-
a.flags.writeable = False
|
|
1844
|
-
assert_raises(ValueError, a.put, [1, 3, 5], [1, 3, 5])
|
|
1845
|
-
|
|
1846
|
-
def test_ravel(self):
|
|
1847
|
-
a = np.array([[0, 1], [2, 3]])
|
|
1848
|
-
assert_equal(a.ravel(), [0, 1, 2, 3])
|
|
1849
|
-
assert_(not a.ravel().flags.owndata)
|
|
1850
|
-
assert_equal(a.ravel('F'), [0, 2, 1, 3])
|
|
1851
|
-
assert_equal(a.ravel(order='C'), [0, 1, 2, 3])
|
|
1852
|
-
assert_equal(a.ravel(order='F'), [0, 2, 1, 3])
|
|
1853
|
-
assert_equal(a.ravel(order='A'), [0, 1, 2, 3])
|
|
1854
|
-
assert_(not a.ravel(order='A').flags.owndata)
|
|
1855
|
-
assert_equal(a.ravel(order='K'), [0, 1, 2, 3])
|
|
1856
|
-
assert_(not a.ravel(order='K').flags.owndata)
|
|
1857
|
-
assert_equal(a.ravel(), a.reshape(-1))
|
|
1858
|
-
|
|
1859
|
-
a = np.array([[0, 1], [2, 3]], order='F')
|
|
1860
|
-
assert_equal(a.ravel(), [0, 1, 2, 3])
|
|
1861
|
-
assert_equal(a.ravel(order='A'), [0, 2, 1, 3])
|
|
1862
|
-
assert_equal(a.ravel(order='K'), [0, 2, 1, 3])
|
|
1863
|
-
assert_(not a.ravel(order='A').flags.owndata)
|
|
1864
|
-
assert_(not a.ravel(order='K').flags.owndata)
|
|
1865
|
-
assert_equal(a.ravel(), a.reshape(-1))
|
|
1866
|
-
assert_equal(a.ravel(order='A'), a.reshape(-1, order='A'))
|
|
1867
|
-
|
|
1868
|
-
a = np.array([[0, 1], [2, 3]])[::-1,:]
|
|
1869
|
-
assert_equal(a.ravel(), [2, 3, 0, 1])
|
|
1870
|
-
assert_equal(a.ravel(order='C'), [2, 3, 0, 1])
|
|
1871
|
-
assert_equal(a.ravel(order='F'), [2, 0, 3, 1])
|
|
1872
|
-
assert_equal(a.ravel(order='A'), [2, 3, 0, 1])
|
|
1873
|
-
# 'K' doesn't reverse the axes of negative strides
|
|
1874
|
-
assert_equal(a.ravel(order='K'), [2, 3, 0, 1])
|
|
1875
|
-
assert_(a.ravel(order='K').flags.owndata)
|
|
1876
|
-
|
|
1877
|
-
def test_conjugate(self):
|
|
1878
|
-
a = np.array([1-1j, 1+1j, 23+23.0j])
|
|
1879
|
-
ac = a.conj()
|
|
1880
|
-
assert_equal(a.real, ac.real)
|
|
1881
|
-
assert_equal(a.imag, -ac.imag)
|
|
1882
|
-
assert_equal(ac, a.conjugate())
|
|
1883
|
-
assert_equal(ac, np.conjugate(a))
|
|
1884
|
-
|
|
1885
|
-
a = np.array([1-1j, 1+1j, 23+23.0j], 'F')
|
|
1886
|
-
ac = a.conj()
|
|
1887
|
-
assert_equal(a.real, ac.real)
|
|
1888
|
-
assert_equal(a.imag, -ac.imag)
|
|
1889
|
-
assert_equal(ac, a.conjugate())
|
|
1890
|
-
assert_equal(ac, np.conjugate(a))
|
|
1891
|
-
|
|
1892
|
-
a = np.array([1, 2, 3])
|
|
1893
|
-
ac = a.conj()
|
|
1894
|
-
assert_equal(a, ac)
|
|
1895
|
-
assert_equal(ac, a.conjugate())
|
|
1896
|
-
assert_equal(ac, np.conjugate(a))
|
|
1897
|
-
|
|
1898
|
-
a = np.array([1.0, 2.0, 3.0])
|
|
1899
|
-
ac = a.conj()
|
|
1900
|
-
assert_equal(a, ac)
|
|
1901
|
-
assert_equal(ac, a.conjugate())
|
|
1902
|
-
assert_equal(ac, np.conjugate(a))
|
|
1903
|
-
|
|
1904
|
-
a = np.array([1-1j, 1+1j, 1, 2.0], object)
|
|
1905
|
-
ac = a.conj()
|
|
1906
|
-
assert_equal(ac, [k.conjugate() for k in a])
|
|
1907
|
-
assert_equal(ac, a.conjugate())
|
|
1908
|
-
assert_equal(ac, np.conjugate(a))
|
|
1909
|
-
|
|
1910
|
-
a = np.array([1-1j, 1, 2.0, 'f'], object)
|
|
1911
|
-
assert_raises(AttributeError, lambda: a.conj())
|
|
1912
|
-
assert_raises(AttributeError, lambda: a.conjugate())
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
class TestBinop(object):
|
|
1916
|
-
@dec.skipif(True) # ufunc override disabled for 1.9
|
|
1917
|
-
def test_ufunc_override_rop_precedence(self):
|
|
1918
|
-
# Check that __rmul__ and other right-hand operations have
|
|
1919
|
-
# precedence over __numpy_ufunc__
|
|
1920
|
-
|
|
1921
|
-
ops = {
|
|
1922
|
-
'__add__': ('__radd__', np.add, True),
|
|
1923
|
-
'__sub__': ('__rsub__', np.subtract, True),
|
|
1924
|
-
'__mul__': ('__rmul__', np.multiply, True),
|
|
1925
|
-
'__truediv__': ('__rtruediv__', np.true_divide, True),
|
|
1926
|
-
'__floordiv__': ('__rfloordiv__', np.floor_divide, True),
|
|
1927
|
-
'__mod__': ('__rmod__', np.remainder, True),
|
|
1928
|
-
'__divmod__': ('__rdivmod__', None, False),
|
|
1929
|
-
'__pow__': ('__rpow__', np.power, True),
|
|
1930
|
-
'__lshift__': ('__rlshift__', np.left_shift, True),
|
|
1931
|
-
'__rshift__': ('__rrshift__', np.right_shift, True),
|
|
1932
|
-
'__and__': ('__rand__', np.bitwise_and, True),
|
|
1933
|
-
'__xor__': ('__rxor__', np.bitwise_xor, True),
|
|
1934
|
-
'__or__': ('__ror__', np.bitwise_or, True),
|
|
1935
|
-
'__ge__': ('__le__', np.less_equal, False),
|
|
1936
|
-
'__gt__': ('__lt__', np.less, False),
|
|
1937
|
-
'__le__': ('__ge__', np.greater_equal, False),
|
|
1938
|
-
'__lt__': ('__gt__', np.greater, False),
|
|
1939
|
-
'__eq__': ('__eq__', np.equal, False),
|
|
1940
|
-
'__ne__': ('__ne__', np.not_equal, False),
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
class OtherNdarraySubclass(ndarray):
|
|
1944
|
-
pass
|
|
1945
|
-
|
|
1946
|
-
class OtherNdarraySubclassWithOverride(ndarray):
|
|
1947
|
-
def __numpy_ufunc__(self, *a, **kw):
|
|
1948
|
-
raise AssertionError(("__numpy_ufunc__ %r %r shouldn't have "
|
|
1949
|
-
"been called!") % (a, kw))
|
|
1950
|
-
|
|
1951
|
-
def check(op_name, ndsubclass):
|
|
1952
|
-
rop_name, np_op, has_iop = ops[op_name]
|
|
1953
|
-
|
|
1954
|
-
if has_iop:
|
|
1955
|
-
iop_name = '__i' + op_name[2:]
|
|
1956
|
-
iop = getattr(operator, iop_name)
|
|
1957
|
-
|
|
1958
|
-
if op_name == "__divmod__":
|
|
1959
|
-
op = divmod
|
|
1960
|
-
else:
|
|
1961
|
-
op = getattr(operator, op_name)
|
|
1962
|
-
|
|
1963
|
-
# Dummy class
|
|
1964
|
-
def __init__(self, *a, **kw):
|
|
1965
|
-
pass
|
|
1966
|
-
|
|
1967
|
-
def __numpy_ufunc__(self, *a, **kw):
|
|
1968
|
-
raise AssertionError(("__numpy_ufunc__ %r %r shouldn't have "
|
|
1969
|
-
"been called!") % (a, kw))
|
|
1970
|
-
|
|
1971
|
-
def __op__(self, *other):
|
|
1972
|
-
return "op"
|
|
1973
|
-
|
|
1974
|
-
def __rop__(self, *other):
|
|
1975
|
-
return "rop"
|
|
1976
|
-
|
|
1977
|
-
if ndsubclass:
|
|
1978
|
-
bases = (ndarray,)
|
|
1979
|
-
else:
|
|
1980
|
-
bases = (object,)
|
|
1981
|
-
|
|
1982
|
-
dct = {'__init__': __init__,
|
|
1983
|
-
'__numpy_ufunc__': __numpy_ufunc__,
|
|
1984
|
-
op_name: __op__}
|
|
1985
|
-
if op_name != rop_name:
|
|
1986
|
-
dct[rop_name] = __rop__
|
|
1987
|
-
|
|
1988
|
-
cls = type("Rop" + rop_name, bases, dct)
|
|
1989
|
-
|
|
1990
|
-
# Check behavior against both bare ndarray objects and a
|
|
1991
|
-
# ndarray subclasses with and without their own override
|
|
1992
|
-
obj = cls((1,), buffer=np.ones(1,))
|
|
1993
|
-
|
|
1994
|
-
arr_objs = [np.array([1]),
|
|
1995
|
-
np.array([2]).view(OtherNdarraySubclass),
|
|
1996
|
-
np.array([3]).view(OtherNdarraySubclassWithOverride),
|
|
1997
|
-
]
|
|
1998
|
-
|
|
1999
|
-
for arr in arr_objs:
|
|
2000
|
-
err_msg = "%r %r" % (op_name, arr,)
|
|
2001
|
-
|
|
2002
|
-
# Check that ndarray op gives up if it sees a non-subclass
|
|
2003
|
-
if not isinstance(obj, arr.__class__):
|
|
2004
|
-
assert_equal(getattr(arr, op_name)(obj),
|
|
2005
|
-
NotImplemented, err_msg=err_msg)
|
|
2006
|
-
|
|
2007
|
-
# Check that the Python binops have priority
|
|
2008
|
-
assert_equal(op(obj, arr), "op", err_msg=err_msg)
|
|
2009
|
-
if op_name == rop_name:
|
|
2010
|
-
assert_equal(op(arr, obj), "op", err_msg=err_msg)
|
|
2011
|
-
else:
|
|
2012
|
-
assert_equal(op(arr, obj), "rop", err_msg=err_msg)
|
|
2013
|
-
|
|
2014
|
-
# Check that Python binops have priority also for in-place ops
|
|
2015
|
-
if has_iop:
|
|
2016
|
-
assert_equal(getattr(arr, iop_name)(obj),
|
|
2017
|
-
NotImplemented, err_msg=err_msg)
|
|
2018
|
-
if op_name != "__pow__":
|
|
2019
|
-
# inplace pow requires the other object to be
|
|
2020
|
-
# integer-like?
|
|
2021
|
-
assert_equal(iop(arr, obj), "rop", err_msg=err_msg)
|
|
2022
|
-
|
|
2023
|
-
# Check that ufunc call __numpy_ufunc__ normally
|
|
2024
|
-
if np_op is not None:
|
|
2025
|
-
assert_raises(AssertionError, np_op, arr, obj,
|
|
2026
|
-
err_msg=err_msg)
|
|
2027
|
-
assert_raises(AssertionError, np_op, obj, arr,
|
|
2028
|
-
err_msg=err_msg)
|
|
2029
|
-
|
|
2030
|
-
# Check all binary operations
|
|
2031
|
-
for op_name in sorted(ops.keys()):
|
|
2032
|
-
yield check, op_name, True
|
|
2033
|
-
yield check, op_name, False
|
|
2034
|
-
|
|
2035
|
-
@dec.skipif(True) # ufunc override disabled for 1.9
|
|
2036
|
-
def test_ufunc_override_rop_simple(self):
|
|
2037
|
-
# Check parts of the binary op overriding behavior in an
|
|
2038
|
-
# explicit test case that is easier to understand.
|
|
2039
|
-
|
|
2040
|
-
class SomeClass(object):
|
|
2041
|
-
def __numpy_ufunc__(self, *a, **kw):
|
|
2042
|
-
return "ufunc"
|
|
2043
|
-
def __mul__(self, other):
|
|
2044
|
-
return 123
|
|
2045
|
-
def __rmul__(self, other):
|
|
2046
|
-
return 321
|
|
2047
|
-
def __gt__(self, other):
|
|
2048
|
-
return "yep"
|
|
2049
|
-
def __lt__(self, other):
|
|
2050
|
-
return "nope"
|
|
2051
|
-
|
|
2052
|
-
class SomeClass2(SomeClass, ndarray):
|
|
2053
|
-
def __numpy_ufunc__(self, ufunc, method, i, inputs, **kw):
|
|
2054
|
-
if ufunc is np.multiply:
|
|
2055
|
-
return "ufunc"
|
|
2056
|
-
else:
|
|
2057
|
-
inputs = list(inputs)
|
|
2058
|
-
inputs[i] = np.asarray(self)
|
|
2059
|
-
func = getattr(ufunc, method)
|
|
2060
|
-
r = func(*inputs, **kw)
|
|
2061
|
-
if 'out' in kw:
|
|
2062
|
-
return r
|
|
2063
|
-
else:
|
|
2064
|
-
x = SomeClass2(r.shape, dtype=r.dtype)
|
|
2065
|
-
x[...] = r
|
|
2066
|
-
return x
|
|
2067
|
-
|
|
2068
|
-
arr = np.array([0])
|
|
2069
|
-
obj = SomeClass()
|
|
2070
|
-
obj2 = SomeClass2((1,), dtype=np.int_)
|
|
2071
|
-
obj2[0] = 9
|
|
2072
|
-
|
|
2073
|
-
assert_equal(obj * arr, 123)
|
|
2074
|
-
assert_equal(arr * obj, 321)
|
|
2075
|
-
assert_equal(arr > obj, "nope")
|
|
2076
|
-
assert_equal(arr < obj, "yep")
|
|
2077
|
-
assert_equal(np.multiply(arr, obj), "ufunc")
|
|
2078
|
-
arr *= obj
|
|
2079
|
-
assert_equal(arr, 321)
|
|
2080
|
-
|
|
2081
|
-
assert_equal(obj2 * arr, 123)
|
|
2082
|
-
assert_equal(arr * obj2, 321)
|
|
2083
|
-
assert_equal(arr > obj2, "nope")
|
|
2084
|
-
assert_equal(arr < obj2, "yep")
|
|
2085
|
-
assert_equal(np.multiply(arr, obj2), "ufunc")
|
|
2086
|
-
arr *= obj2
|
|
2087
|
-
assert_equal(arr, 321)
|
|
2088
|
-
|
|
2089
|
-
obj2 += 33
|
|
2090
|
-
assert_equal(obj2[0], 42)
|
|
2091
|
-
assert_equal(obj2.sum(), 42)
|
|
2092
|
-
assert_(isinstance(obj2, SomeClass2))
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
class TestSubscripting(TestCase):
|
|
2096
|
-
def test_test_zero_rank(self):
|
|
2097
|
-
x = array([1, 2, 3])
|
|
2098
|
-
self.assertTrue(isinstance(x[0], np.int_))
|
|
2099
|
-
if sys.version_info[0] < 3:
|
|
2100
|
-
self.assertTrue(isinstance(x[0], int))
|
|
2101
|
-
self.assertTrue(type(x[0, ...]) is ndarray)
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
class TestPickling(TestCase):
|
|
2105
|
-
def test_roundtrip(self):
|
|
2106
|
-
import pickle
|
|
2107
|
-
carray = array([[2, 9], [7, 0], [3, 8]])
|
|
2108
|
-
DATA = [
|
|
2109
|
-
carray,
|
|
2110
|
-
transpose(carray),
|
|
2111
|
-
array([('xxx', 1, 2.0)], dtype=[('a', (str, 3)), ('b', int),
|
|
2112
|
-
('c', float)])
|
|
2113
|
-
]
|
|
2114
|
-
|
|
2115
|
-
for a in DATA:
|
|
2116
|
-
assert_equal(a, pickle.loads(a.dumps()), err_msg="%r" % a)
|
|
2117
|
-
|
|
2118
|
-
def _loads(self, obj):
|
|
2119
|
-
if sys.version_info[0] >= 3:
|
|
2120
|
-
return loads(obj, encoding='latin1')
|
|
2121
|
-
else:
|
|
2122
|
-
return loads(obj)
|
|
2123
|
-
|
|
2124
|
-
# version 0 pickles, using protocol=2 to pickle
|
|
2125
|
-
# version 0 doesn't have a version field
|
|
2126
|
-
def test_version0_int8(self):
|
|
2127
|
-
s = '\x80\x02cnumpy.core._internal\n_reconstruct\nq\x01cnumpy\nndarray\nq\x02K\x00\x85U\x01b\x87Rq\x03(K\x04\x85cnumpy\ndtype\nq\x04U\x02i1K\x00K\x01\x87Rq\x05(U\x01|NNJ\xff\xff\xff\xffJ\xff\xff\xff\xfftb\x89U\x04\x01\x02\x03\x04tb.'
|
|
2128
|
-
a = array([1, 2, 3, 4], dtype=int8)
|
|
2129
|
-
p = self._loads(asbytes(s))
|
|
2130
|
-
assert_equal(a, p)
|
|
2131
|
-
|
|
2132
|
-
def test_version0_float32(self):
|
|
2133
|
-
s = '\x80\x02cnumpy.core._internal\n_reconstruct\nq\x01cnumpy\nndarray\nq\x02K\x00\x85U\x01b\x87Rq\x03(K\x04\x85cnumpy\ndtype\nq\x04U\x02f4K\x00K\x01\x87Rq\x05(U\x01<NNJ\xff\xff\xff\xffJ\xff\xff\xff\xfftb\x89U\x10\x00\x00\x80?\x00\x00\x00@\x00\x00@@\x00\x00\x80@tb.'
|
|
2134
|
-
a = array([1.0, 2.0, 3.0, 4.0], dtype=float32)
|
|
2135
|
-
p = self._loads(asbytes(s))
|
|
2136
|
-
assert_equal(a, p)
|
|
2137
|
-
|
|
2138
|
-
def test_version0_object(self):
|
|
2139
|
-
s = '\x80\x02cnumpy.core._internal\n_reconstruct\nq\x01cnumpy\nndarray\nq\x02K\x00\x85U\x01b\x87Rq\x03(K\x02\x85cnumpy\ndtype\nq\x04U\x02O8K\x00K\x01\x87Rq\x05(U\x01|NNJ\xff\xff\xff\xffJ\xff\xff\xff\xfftb\x89]q\x06(}q\x07U\x01aK\x01s}q\x08U\x01bK\x02setb.'
|
|
2140
|
-
a = np.array([{'a':1}, {'b':2}])
|
|
2141
|
-
p = self._loads(asbytes(s))
|
|
2142
|
-
assert_equal(a, p)
|
|
2143
|
-
|
|
2144
|
-
# version 1 pickles, using protocol=2 to pickle
|
|
2145
|
-
def test_version1_int8(self):
|
|
2146
|
-
s = '\x80\x02cnumpy.core._internal\n_reconstruct\nq\x01cnumpy\nndarray\nq\x02K\x00\x85U\x01b\x87Rq\x03(K\x01K\x04\x85cnumpy\ndtype\nq\x04U\x02i1K\x00K\x01\x87Rq\x05(K\x01U\x01|NNJ\xff\xff\xff\xffJ\xff\xff\xff\xfftb\x89U\x04\x01\x02\x03\x04tb.'
|
|
2147
|
-
a = array([1, 2, 3, 4], dtype=int8)
|
|
2148
|
-
p = self._loads(asbytes(s))
|
|
2149
|
-
assert_equal(a, p)
|
|
2150
|
-
|
|
2151
|
-
def test_version1_float32(self):
|
|
2152
|
-
s = '\x80\x02cnumpy.core._internal\n_reconstruct\nq\x01cnumpy\nndarray\nq\x02K\x00\x85U\x01b\x87Rq\x03(K\x01K\x04\x85cnumpy\ndtype\nq\x04U\x02f4K\x00K\x01\x87Rq\x05(K\x01U\x01<NNJ\xff\xff\xff\xffJ\xff\xff\xff\xfftb\x89U\x10\x00\x00\x80?\x00\x00\x00@\x00\x00@@\x00\x00\x80@tb.'
|
|
2153
|
-
a = array([1.0, 2.0, 3.0, 4.0], dtype=float32)
|
|
2154
|
-
p = self._loads(asbytes(s))
|
|
2155
|
-
assert_equal(a, p)
|
|
2156
|
-
|
|
2157
|
-
def test_version1_object(self):
|
|
2158
|
-
s = '\x80\x02cnumpy.core._internal\n_reconstruct\nq\x01cnumpy\nndarray\nq\x02K\x00\x85U\x01b\x87Rq\x03(K\x01K\x02\x85cnumpy\ndtype\nq\x04U\x02O8K\x00K\x01\x87Rq\x05(K\x01U\x01|NNJ\xff\xff\xff\xffJ\xff\xff\xff\xfftb\x89]q\x06(}q\x07U\x01aK\x01s}q\x08U\x01bK\x02setb.'
|
|
2159
|
-
a = array([{'a':1}, {'b':2}])
|
|
2160
|
-
p = self._loads(asbytes(s))
|
|
2161
|
-
assert_equal(a, p)
|
|
2162
|
-
|
|
2163
|
-
def test_subarray_int_shape(self):
|
|
2164
|
-
s = "cnumpy.core.multiarray\n_reconstruct\np0\n(cnumpy\nndarray\np1\n(I0\ntp2\nS'b'\np3\ntp4\nRp5\n(I1\n(I1\ntp6\ncnumpy\ndtype\np7\n(S'V6'\np8\nI0\nI1\ntp9\nRp10\n(I3\nS'|'\np11\nN(S'a'\np12\ng3\ntp13\n(dp14\ng12\n(g7\n(S'V4'\np15\nI0\nI1\ntp16\nRp17\n(I3\nS'|'\np18\n(g7\n(S'i1'\np19\nI0\nI1\ntp20\nRp21\n(I3\nS'|'\np22\nNNNI-1\nI-1\nI0\ntp23\nb(I2\nI2\ntp24\ntp25\nNNI4\nI1\nI0\ntp26\nbI0\ntp27\nsg3\n(g7\n(S'V2'\np28\nI0\nI1\ntp29\nRp30\n(I3\nS'|'\np31\n(g21\nI2\ntp32\nNNI2\nI1\nI0\ntp33\nbI4\ntp34\nsI6\nI1\nI0\ntp35\nbI00\nS'\\x01\\x01\\x01\\x01\\x01\\x02'\np36\ntp37\nb."
|
|
2165
|
-
a = np.array([(1, (1, 2))], dtype=[('a', 'i1', (2, 2)), ('b', 'i1', 2)])
|
|
2166
|
-
p = self._loads(asbytes(s))
|
|
2167
|
-
assert_equal(a, p)
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
class TestFancyIndexing(TestCase):
|
|
2171
|
-
def test_list(self):
|
|
2172
|
-
x = ones((1, 1))
|
|
2173
|
-
x[:, [0]] = 2.0
|
|
2174
|
-
assert_array_equal(x, array([[2.0]]))
|
|
2175
|
-
|
|
2176
|
-
x = ones((1, 1, 1))
|
|
2177
|
-
x[:,:, [0]] = 2.0
|
|
2178
|
-
assert_array_equal(x, array([[[2.0]]]))
|
|
2179
|
-
|
|
2180
|
-
def test_tuple(self):
|
|
2181
|
-
x = ones((1, 1))
|
|
2182
|
-
x[:, (0,)] = 2.0
|
|
2183
|
-
assert_array_equal(x, array([[2.0]]))
|
|
2184
|
-
x = ones((1, 1, 1))
|
|
2185
|
-
x[:,:, (0,)] = 2.0
|
|
2186
|
-
assert_array_equal(x, array([[[2.0]]]))
|
|
2187
|
-
|
|
2188
|
-
def test_mask(self):
|
|
2189
|
-
x = array([1, 2, 3, 4])
|
|
2190
|
-
m = array([0, 1], bool)
|
|
2191
|
-
assert_array_equal(x[m], array([2]))
|
|
2192
|
-
|
|
2193
|
-
def test_mask2(self):
|
|
2194
|
-
x = array([[1, 2, 3, 4], [5, 6, 7, 8]])
|
|
2195
|
-
m = array([0, 1], bool)
|
|
2196
|
-
m2 = array([[0, 1], [1, 0]], bool)
|
|
2197
|
-
m3 = array([[0, 1]], bool)
|
|
2198
|
-
assert_array_equal(x[m], array([[5, 6, 7, 8]]))
|
|
2199
|
-
assert_array_equal(x[m2], array([2, 5]))
|
|
2200
|
-
assert_array_equal(x[m3], array([2]))
|
|
2201
|
-
|
|
2202
|
-
def test_assign_mask(self):
|
|
2203
|
-
x = array([1, 2, 3, 4])
|
|
2204
|
-
m = array([0, 1], bool)
|
|
2205
|
-
x[m] = 5
|
|
2206
|
-
assert_array_equal(x, array([1, 5, 3, 4]))
|
|
2207
|
-
|
|
2208
|
-
def test_assign_mask2(self):
|
|
2209
|
-
xorig = array([[1, 2, 3, 4], [5, 6, 7, 8]])
|
|
2210
|
-
m = array([0, 1], bool)
|
|
2211
|
-
m2 = array([[0, 1], [1, 0]], bool)
|
|
2212
|
-
m3 = array([[0, 1]], bool)
|
|
2213
|
-
x = xorig.copy()
|
|
2214
|
-
x[m] = 10
|
|
2215
|
-
assert_array_equal(x, array([[1, 2, 3, 4], [10, 10, 10, 10]]))
|
|
2216
|
-
x = xorig.copy()
|
|
2217
|
-
x[m2] = 10
|
|
2218
|
-
assert_array_equal(x, array([[1, 10, 3, 4], [10, 6, 7, 8]]))
|
|
2219
|
-
x = xorig.copy()
|
|
2220
|
-
x[m3] = 10
|
|
2221
|
-
assert_array_equal(x, array([[1, 10, 3, 4], [5, 6, 7, 8]]))
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
class TestStringCompare(TestCase):
|
|
2225
|
-
def test_string(self):
|
|
2226
|
-
g1 = array(["This", "is", "example"])
|
|
2227
|
-
g2 = array(["This", "was", "example"])
|
|
2228
|
-
assert_array_equal(g1 == g2, [g1[i] == g2[i] for i in [0, 1, 2]])
|
|
2229
|
-
assert_array_equal(g1 != g2, [g1[i] != g2[i] for i in [0, 1, 2]])
|
|
2230
|
-
assert_array_equal(g1 <= g2, [g1[i] <= g2[i] for i in [0, 1, 2]])
|
|
2231
|
-
assert_array_equal(g1 >= g2, [g1[i] >= g2[i] for i in [0, 1, 2]])
|
|
2232
|
-
assert_array_equal(g1 < g2, [g1[i] < g2[i] for i in [0, 1, 2]])
|
|
2233
|
-
assert_array_equal(g1 > g2, [g1[i] > g2[i] for i in [0, 1, 2]])
|
|
2234
|
-
|
|
2235
|
-
def test_mixed(self):
|
|
2236
|
-
g1 = array(["spam", "spa", "spammer", "and eggs"])
|
|
2237
|
-
g2 = "spam"
|
|
2238
|
-
assert_array_equal(g1 == g2, [x == g2 for x in g1])
|
|
2239
|
-
assert_array_equal(g1 != g2, [x != g2 for x in g1])
|
|
2240
|
-
assert_array_equal(g1 < g2, [x < g2 for x in g1])
|
|
2241
|
-
assert_array_equal(g1 > g2, [x > g2 for x in g1])
|
|
2242
|
-
assert_array_equal(g1 <= g2, [x <= g2 for x in g1])
|
|
2243
|
-
assert_array_equal(g1 >= g2, [x >= g2 for x in g1])
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
def test_unicode(self):
|
|
2247
|
-
g1 = array([sixu("This"), sixu("is"), sixu("example")])
|
|
2248
|
-
g2 = array([sixu("This"), sixu("was"), sixu("example")])
|
|
2249
|
-
assert_array_equal(g1 == g2, [g1[i] == g2[i] for i in [0, 1, 2]])
|
|
2250
|
-
assert_array_equal(g1 != g2, [g1[i] != g2[i] for i in [0, 1, 2]])
|
|
2251
|
-
assert_array_equal(g1 <= g2, [g1[i] <= g2[i] for i in [0, 1, 2]])
|
|
2252
|
-
assert_array_equal(g1 >= g2, [g1[i] >= g2[i] for i in [0, 1, 2]])
|
|
2253
|
-
assert_array_equal(g1 < g2, [g1[i] < g2[i] for i in [0, 1, 2]])
|
|
2254
|
-
assert_array_equal(g1 > g2, [g1[i] > g2[i] for i in [0, 1, 2]])
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
class TestArgmax(TestCase):
|
|
2258
|
-
|
|
2259
|
-
nan_arr = [
|
|
2260
|
-
([0, 1, 2, 3, np.nan], 4),
|
|
2261
|
-
([0, 1, 2, np.nan, 3], 3),
|
|
2262
|
-
([np.nan, 0, 1, 2, 3], 0),
|
|
2263
|
-
([np.nan, 0, np.nan, 2, 3], 0),
|
|
2264
|
-
([0, 1, 2, 3, complex(0, np.nan)], 4),
|
|
2265
|
-
([0, 1, 2, 3, complex(np.nan, 0)], 4),
|
|
2266
|
-
([0, 1, 2, complex(np.nan, 0), 3], 3),
|
|
2267
|
-
([0, 1, 2, complex(0, np.nan), 3], 3),
|
|
2268
|
-
([complex(0, np.nan), 0, 1, 2, 3], 0),
|
|
2269
|
-
([complex(np.nan, np.nan), 0, 1, 2, 3], 0),
|
|
2270
|
-
([complex(np.nan, 0), complex(np.nan, 2), complex(np.nan, 1)], 0),
|
|
2271
|
-
([complex(np.nan, np.nan), complex(np.nan, 2), complex(np.nan, 1)], 0),
|
|
2272
|
-
([complex(np.nan, 0), complex(np.nan, 2), complex(np.nan, np.nan)], 0),
|
|
2273
|
-
|
|
2274
|
-
([complex(0, 0), complex(0, 2), complex(0, 1)], 1),
|
|
2275
|
-
([complex(1, 0), complex(0, 2), complex(0, 1)], 0),
|
|
2276
|
-
([complex(1, 0), complex(0, 2), complex(1, 1)], 2),
|
|
2277
|
-
|
|
2278
|
-
([np.datetime64('1923-04-14T12:43:12'),
|
|
2279
|
-
np.datetime64('1994-06-21T14:43:15'),
|
|
2280
|
-
np.datetime64('2001-10-15T04:10:32'),
|
|
2281
|
-
np.datetime64('1995-11-25T16:02:16'),
|
|
2282
|
-
np.datetime64('2005-01-04T03:14:12'),
|
|
2283
|
-
np.datetime64('2041-12-03T14:05:03')], 5),
|
|
2284
|
-
([np.datetime64('1935-09-14T04:40:11'),
|
|
2285
|
-
np.datetime64('1949-10-12T12:32:11'),
|
|
2286
|
-
np.datetime64('2010-01-03T05:14:12'),
|
|
2287
|
-
np.datetime64('2015-11-20T12:20:59'),
|
|
2288
|
-
np.datetime64('1932-09-23T10:10:13'),
|
|
2289
|
-
np.datetime64('2014-10-10T03:50:30')], 3),
|
|
2290
|
-
([np.datetime64('2059-03-14T12:43:12'),
|
|
2291
|
-
np.datetime64('1996-09-21T14:43:15'),
|
|
2292
|
-
np.datetime64('2001-10-15T04:10:32'),
|
|
2293
|
-
np.datetime64('2022-12-25T16:02:16'),
|
|
2294
|
-
np.datetime64('1963-10-04T03:14:12'),
|
|
2295
|
-
np.datetime64('2013-05-08T18:15:23')], 0),
|
|
2296
|
-
|
|
2297
|
-
([timedelta(days=5, seconds=14), timedelta(days=2, seconds=35),
|
|
2298
|
-
timedelta(days=-1, seconds=23)], 0),
|
|
2299
|
-
([timedelta(days=1, seconds=43), timedelta(days=10, seconds=5),
|
|
2300
|
-
timedelta(days=5, seconds=14)], 1),
|
|
2301
|
-
([timedelta(days=10, seconds=24), timedelta(days=10, seconds=5),
|
|
2302
|
-
timedelta(days=10, seconds=43)], 2),
|
|
2303
|
-
|
|
2304
|
-
([False, False, False, False, True], 4),
|
|
2305
|
-
([False, False, False, True, False], 3),
|
|
2306
|
-
([True, False, False, False, False], 0),
|
|
2307
|
-
([True, False, True, False, False], 0),
|
|
2308
|
-
|
|
2309
|
-
# Can't reduce a "flexible type"
|
|
2310
|
-
#(['a', 'z', 'aa', 'zz'], 3),
|
|
2311
|
-
#(['zz', 'a', 'aa', 'a'], 0),
|
|
2312
|
-
#(['aa', 'z', 'zz', 'a'], 2),
|
|
2313
|
-
]
|
|
2314
|
-
|
|
2315
|
-
def test_all(self):
|
|
2316
|
-
a = np.random.normal(0, 1, (4, 5, 6, 7, 8))
|
|
2317
|
-
for i in range(a.ndim):
|
|
2318
|
-
amax = a.max(i)
|
|
2319
|
-
aargmax = a.argmax(i)
|
|
2320
|
-
axes = list(range(a.ndim))
|
|
2321
|
-
axes.remove(i)
|
|
2322
|
-
assert_(all(amax == aargmax.choose(*a.transpose(i,*axes))))
|
|
2323
|
-
|
|
2324
|
-
def test_combinations(self):
|
|
2325
|
-
for arr, pos in self.nan_arr:
|
|
2326
|
-
assert_equal(np.argmax(arr), pos, err_msg="%r"%arr)
|
|
2327
|
-
assert_equal(arr[np.argmax(arr)], np.max(arr), err_msg="%r"%arr)
|
|
2328
|
-
|
|
2329
|
-
def test_output_shape(self):
|
|
2330
|
-
# see also gh-616
|
|
2331
|
-
a = np.ones((10, 5))
|
|
2332
|
-
# Check some simple shape mismatches
|
|
2333
|
-
out = np.ones(11, dtype=np.int_)
|
|
2334
|
-
assert_raises(ValueError, a.argmax, -1, out)
|
|
2335
|
-
|
|
2336
|
-
out = np.ones((2, 5), dtype=np.int_)
|
|
2337
|
-
assert_raises(ValueError, a.argmax, -1, out)
|
|
2338
|
-
|
|
2339
|
-
# these could be relaxed possibly (used to allow even the previous)
|
|
2340
|
-
out = np.ones((1, 10), dtype=np.int_)
|
|
2341
|
-
assert_raises(ValueError, a.argmax, -1, np.ones((1, 10)))
|
|
2342
|
-
|
|
2343
|
-
out = np.ones(10, dtype=np.int_)
|
|
2344
|
-
a.argmax(-1, out=out)
|
|
2345
|
-
assert_equal(out, a.argmax(-1))
|
|
2346
|
-
|
|
2347
|
-
def test_argmax_unicode(self):
|
|
2348
|
-
d = np.zeros(6031, dtype='<U9')
|
|
2349
|
-
d[5942] = "as"
|
|
2350
|
-
assert_equal(d.argmax(), 5942)
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
class TestArgmin(TestCase):
|
|
2354
|
-
|
|
2355
|
-
nan_arr = [
|
|
2356
|
-
([0, 1, 2, 3, np.nan], 4),
|
|
2357
|
-
([0, 1, 2, np.nan, 3], 3),
|
|
2358
|
-
([np.nan, 0, 1, 2, 3], 0),
|
|
2359
|
-
([np.nan, 0, np.nan, 2, 3], 0),
|
|
2360
|
-
([0, 1, 2, 3, complex(0, np.nan)], 4),
|
|
2361
|
-
([0, 1, 2, 3, complex(np.nan, 0)], 4),
|
|
2362
|
-
([0, 1, 2, complex(np.nan, 0), 3], 3),
|
|
2363
|
-
([0, 1, 2, complex(0, np.nan), 3], 3),
|
|
2364
|
-
([complex(0, np.nan), 0, 1, 2, 3], 0),
|
|
2365
|
-
([complex(np.nan, np.nan), 0, 1, 2, 3], 0),
|
|
2366
|
-
([complex(np.nan, 0), complex(np.nan, 2), complex(np.nan, 1)], 0),
|
|
2367
|
-
([complex(np.nan, np.nan), complex(np.nan, 2), complex(np.nan, 1)], 0),
|
|
2368
|
-
([complex(np.nan, 0), complex(np.nan, 2), complex(np.nan, np.nan)], 0),
|
|
2369
|
-
|
|
2370
|
-
([complex(0, 0), complex(0, 2), complex(0, 1)], 0),
|
|
2371
|
-
([complex(1, 0), complex(0, 2), complex(0, 1)], 2),
|
|
2372
|
-
([complex(1, 0), complex(0, 2), complex(1, 1)], 1),
|
|
2373
|
-
|
|
2374
|
-
([np.datetime64('1923-04-14T12:43:12'),
|
|
2375
|
-
np.datetime64('1994-06-21T14:43:15'),
|
|
2376
|
-
np.datetime64('2001-10-15T04:10:32'),
|
|
2377
|
-
np.datetime64('1995-11-25T16:02:16'),
|
|
2378
|
-
np.datetime64('2005-01-04T03:14:12'),
|
|
2379
|
-
np.datetime64('2041-12-03T14:05:03')], 0),
|
|
2380
|
-
([np.datetime64('1935-09-14T04:40:11'),
|
|
2381
|
-
np.datetime64('1949-10-12T12:32:11'),
|
|
2382
|
-
np.datetime64('2010-01-03T05:14:12'),
|
|
2383
|
-
np.datetime64('2014-11-20T12:20:59'),
|
|
2384
|
-
np.datetime64('2015-09-23T10:10:13'),
|
|
2385
|
-
np.datetime64('1932-10-10T03:50:30')], 5),
|
|
2386
|
-
([np.datetime64('2059-03-14T12:43:12'),
|
|
2387
|
-
np.datetime64('1996-09-21T14:43:15'),
|
|
2388
|
-
np.datetime64('2001-10-15T04:10:32'),
|
|
2389
|
-
np.datetime64('2022-12-25T16:02:16'),
|
|
2390
|
-
np.datetime64('1963-10-04T03:14:12'),
|
|
2391
|
-
np.datetime64('2013-05-08T18:15:23')], 4),
|
|
2392
|
-
|
|
2393
|
-
([timedelta(days=5, seconds=14), timedelta(days=2, seconds=35),
|
|
2394
|
-
timedelta(days=-1, seconds=23)], 2),
|
|
2395
|
-
([timedelta(days=1, seconds=43), timedelta(days=10, seconds=5),
|
|
2396
|
-
timedelta(days=5, seconds=14)], 0),
|
|
2397
|
-
([timedelta(days=10, seconds=24), timedelta(days=10, seconds=5),
|
|
2398
|
-
timedelta(days=10, seconds=43)], 1),
|
|
2399
|
-
|
|
2400
|
-
([True, True, True, True, False], 4),
|
|
2401
|
-
([True, True, True, False, True], 3),
|
|
2402
|
-
([False, True, True, True, True], 0),
|
|
2403
|
-
([False, True, False, True, True], 0),
|
|
2404
|
-
|
|
2405
|
-
# Can't reduce a "flexible type"
|
|
2406
|
-
#(['a', 'z', 'aa', 'zz'], 0),
|
|
2407
|
-
#(['zz', 'a', 'aa', 'a'], 1),
|
|
2408
|
-
#(['aa', 'z', 'zz', 'a'], 3),
|
|
2409
|
-
]
|
|
2410
|
-
|
|
2411
|
-
def test_all(self):
|
|
2412
|
-
a = np.random.normal(0, 1, (4, 5, 6, 7, 8))
|
|
2413
|
-
for i in range(a.ndim):
|
|
2414
|
-
amin = a.min(i)
|
|
2415
|
-
aargmin = a.argmin(i)
|
|
2416
|
-
axes = list(range(a.ndim))
|
|
2417
|
-
axes.remove(i)
|
|
2418
|
-
assert_(all(amin == aargmin.choose(*a.transpose(i,*axes))))
|
|
2419
|
-
|
|
2420
|
-
def test_combinations(self):
|
|
2421
|
-
for arr, pos in self.nan_arr:
|
|
2422
|
-
assert_equal(np.argmin(arr), pos, err_msg="%r"%arr)
|
|
2423
|
-
assert_equal(arr[np.argmin(arr)], np.min(arr), err_msg="%r"%arr)
|
|
2424
|
-
|
|
2425
|
-
def test_minimum_signed_integers(self):
|
|
2426
|
-
|
|
2427
|
-
a = np.array([1, -2**7, -2**7 + 1], dtype=np.int8)
|
|
2428
|
-
assert_equal(np.argmin(a), 1)
|
|
2429
|
-
|
|
2430
|
-
a = np.array([1, -2**15, -2**15 + 1], dtype=np.int16)
|
|
2431
|
-
assert_equal(np.argmin(a), 1)
|
|
2432
|
-
|
|
2433
|
-
a = np.array([1, -2**31, -2**31 + 1], dtype=np.int32)
|
|
2434
|
-
assert_equal(np.argmin(a), 1)
|
|
2435
|
-
|
|
2436
|
-
a = np.array([1, -2**63, -2**63 + 1], dtype=np.int64)
|
|
2437
|
-
assert_equal(np.argmin(a), 1)
|
|
2438
|
-
|
|
2439
|
-
def test_output_shape(self):
|
|
2440
|
-
# see also gh-616
|
|
2441
|
-
a = np.ones((10, 5))
|
|
2442
|
-
# Check some simple shape mismatches
|
|
2443
|
-
out = np.ones(11, dtype=np.int_)
|
|
2444
|
-
assert_raises(ValueError, a.argmin, -1, out)
|
|
2445
|
-
|
|
2446
|
-
out = np.ones((2, 5), dtype=np.int_)
|
|
2447
|
-
assert_raises(ValueError, a.argmin, -1, out)
|
|
2448
|
-
|
|
2449
|
-
# these could be relaxed possibly (used to allow even the previous)
|
|
2450
|
-
out = np.ones((1, 10), dtype=np.int_)
|
|
2451
|
-
assert_raises(ValueError, a.argmin, -1, np.ones((1, 10)))
|
|
2452
|
-
|
|
2453
|
-
out = np.ones(10, dtype=np.int_)
|
|
2454
|
-
a.argmin(-1, out=out)
|
|
2455
|
-
assert_equal(out, a.argmin(-1))
|
|
2456
|
-
|
|
2457
|
-
def test_argmin_unicode(self):
|
|
2458
|
-
d = np.ones(6031, dtype='<U9')
|
|
2459
|
-
d[6001] = "0"
|
|
2460
|
-
assert_equal(d.argmin(), 6001)
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
class TestMinMax(TestCase):
|
|
2464
|
-
def test_scalar(self):
|
|
2465
|
-
assert_raises(ValueError, np.amax, 1, 1)
|
|
2466
|
-
assert_raises(ValueError, np.amin, 1, 1)
|
|
2467
|
-
|
|
2468
|
-
assert_equal(np.amax(1, axis=0), 1)
|
|
2469
|
-
assert_equal(np.amin(1, axis=0), 1)
|
|
2470
|
-
assert_equal(np.amax(1, axis=None), 1)
|
|
2471
|
-
assert_equal(np.amin(1, axis=None), 1)
|
|
2472
|
-
|
|
2473
|
-
def test_axis(self):
|
|
2474
|
-
assert_raises(ValueError, np.amax, [1, 2, 3], 1000)
|
|
2475
|
-
assert_equal(np.amax([[1, 2, 3]], axis=1), 3)
|
|
2476
|
-
|
|
2477
|
-
class TestNewaxis(TestCase):
|
|
2478
|
-
def test_basic(self):
|
|
2479
|
-
sk = array([0, -0.1, 0.1])
|
|
2480
|
-
res = 250*sk[:, newaxis]
|
|
2481
|
-
assert_almost_equal(res.ravel(), 250*sk)
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
class TestClip(TestCase):
|
|
2485
|
-
def _check_range(self, x, cmin, cmax):
|
|
2486
|
-
assert_(np.all(x >= cmin))
|
|
2487
|
-
assert_(np.all(x <= cmax))
|
|
2488
|
-
|
|
2489
|
-
def _clip_type(self,type_group,array_max,
|
|
2490
|
-
clip_min,clip_max,inplace=False,
|
|
2491
|
-
expected_min=None,expected_max=None):
|
|
2492
|
-
if expected_min is None:
|
|
2493
|
-
expected_min = clip_min
|
|
2494
|
-
if expected_max is None:
|
|
2495
|
-
expected_max = clip_max
|
|
2496
|
-
|
|
2497
|
-
for T in np.sctypes[type_group]:
|
|
2498
|
-
if sys.byteorder == 'little':
|
|
2499
|
-
byte_orders = ['=', '>']
|
|
2500
|
-
else:
|
|
2501
|
-
byte_orders = ['<', '=']
|
|
2502
|
-
|
|
2503
|
-
for byteorder in byte_orders:
|
|
2504
|
-
dtype = np.dtype(T).newbyteorder(byteorder)
|
|
2505
|
-
|
|
2506
|
-
x = (np.random.random(1000) * array_max).astype(dtype)
|
|
2507
|
-
if inplace:
|
|
2508
|
-
x.clip(clip_min, clip_max, x)
|
|
2509
|
-
else:
|
|
2510
|
-
x = x.clip(clip_min, clip_max)
|
|
2511
|
-
byteorder = '='
|
|
2512
|
-
|
|
2513
|
-
if x.dtype.byteorder == '|': byteorder = '|'
|
|
2514
|
-
assert_equal(x.dtype.byteorder, byteorder)
|
|
2515
|
-
self._check_range(x, expected_min, expected_max)
|
|
2516
|
-
return x
|
|
2517
|
-
|
|
2518
|
-
def test_basic(self):
|
|
2519
|
-
for inplace in [False, True]:
|
|
2520
|
-
self._clip_type('float', 1024, -12.8, 100.2, inplace=inplace)
|
|
2521
|
-
self._clip_type('float', 1024, 0, 0, inplace=inplace)
|
|
2522
|
-
|
|
2523
|
-
self._clip_type('int', 1024, -120, 100.5, inplace=inplace)
|
|
2524
|
-
self._clip_type('int', 1024, 0, 0, inplace=inplace)
|
|
2525
|
-
|
|
2526
|
-
x = self._clip_type('uint', 1024, -120, 100, expected_min=0,
|
|
2527
|
-
inplace=inplace)
|
|
2528
|
-
x = self._clip_type('uint', 1024, 0, 0, inplace=inplace)
|
|
2529
|
-
|
|
2530
|
-
def test_record_array(self):
|
|
2531
|
-
rec = np.array([(-5, 2.0, 3.0), (5.0, 4.0, 3.0)],
|
|
2532
|
-
dtype=[('x', '<f8'), ('y', '<f8'), ('z', '<f8')])
|
|
2533
|
-
y = rec['x'].clip(-0.3, 0.5)
|
|
2534
|
-
self._check_range(y, -0.3, 0.5)
|
|
2535
|
-
|
|
2536
|
-
def test_max_or_min(self):
|
|
2537
|
-
val = np.array([0, 1, 2, 3, 4, 5, 6, 7])
|
|
2538
|
-
x = val.clip(3)
|
|
2539
|
-
assert_(np.all(x >= 3))
|
|
2540
|
-
x = val.clip(min=3)
|
|
2541
|
-
assert_(np.all(x >= 3))
|
|
2542
|
-
x = val.clip(max=4)
|
|
2543
|
-
assert_(np.all(x <= 4))
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
class TestPutmask(object):
|
|
2547
|
-
def tst_basic(self, x, T, mask, val):
|
|
2548
|
-
np.putmask(x, mask, val)
|
|
2549
|
-
assert_(np.all(x[mask] == T(val)))
|
|
2550
|
-
assert_(x.dtype == T)
|
|
2551
|
-
|
|
2552
|
-
def test_ip_types(self):
|
|
2553
|
-
unchecked_types = [str, unicode, np.void, object]
|
|
2554
|
-
|
|
2555
|
-
x = np.random.random(1000)*100
|
|
2556
|
-
mask = x < 40
|
|
2557
|
-
|
|
2558
|
-
for val in [-100, 0, 15]:
|
|
2559
|
-
for types in np.sctypes.values():
|
|
2560
|
-
for T in types:
|
|
2561
|
-
if T not in unchecked_types:
|
|
2562
|
-
yield self.tst_basic, x.copy().astype(T), T, mask, val
|
|
2563
|
-
|
|
2564
|
-
def test_mask_size(self):
|
|
2565
|
-
assert_raises(ValueError, np.putmask, np.array([1, 2, 3]), [True], 5)
|
|
2566
|
-
|
|
2567
|
-
def tst_byteorder(self, dtype):
|
|
2568
|
-
x = np.array([1, 2, 3], dtype)
|
|
2569
|
-
np.putmask(x, [True, False, True], -1)
|
|
2570
|
-
assert_array_equal(x, [-1, 2, -1])
|
|
2571
|
-
|
|
2572
|
-
def test_ip_byteorder(self):
|
|
2573
|
-
for dtype in ('>i4', '<i4'):
|
|
2574
|
-
yield self.tst_byteorder, dtype
|
|
2575
|
-
|
|
2576
|
-
def test_record_array(self):
|
|
2577
|
-
# Note mixed byteorder.
|
|
2578
|
-
rec = np.array([(-5, 2.0, 3.0), (5.0, 4.0, 3.0)],
|
|
2579
|
-
dtype=[('x', '<f8'), ('y', '>f8'), ('z', '<f8')])
|
|
2580
|
-
np.putmask(rec['x'], [True, False], 10)
|
|
2581
|
-
assert_array_equal(rec['x'], [10, 5])
|
|
2582
|
-
assert_array_equal(rec['y'], [2, 4])
|
|
2583
|
-
assert_array_equal(rec['z'], [3, 3])
|
|
2584
|
-
np.putmask(rec['y'], [True, False], 11)
|
|
2585
|
-
assert_array_equal(rec['x'], [10, 5])
|
|
2586
|
-
assert_array_equal(rec['y'], [11, 4])
|
|
2587
|
-
assert_array_equal(rec['z'], [3, 3])
|
|
2588
|
-
|
|
2589
|
-
def test_masked_array(self):
|
|
2590
|
-
## x = np.array([1,2,3])
|
|
2591
|
-
## z = np.ma.array(x,mask=[True,False,False])
|
|
2592
|
-
## np.putmask(z,[True,True,True],3)
|
|
2593
|
-
pass
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
class TestTake(object):
|
|
2597
|
-
def tst_basic(self, x):
|
|
2598
|
-
ind = list(range(x.shape[0]))
|
|
2599
|
-
assert_array_equal(x.take(ind, axis=0), x)
|
|
2600
|
-
|
|
2601
|
-
def test_ip_types(self):
|
|
2602
|
-
unchecked_types = [str, unicode, np.void, object]
|
|
2603
|
-
|
|
2604
|
-
x = np.random.random(24)*100
|
|
2605
|
-
x.shape = 2, 3, 4
|
|
2606
|
-
for types in np.sctypes.values():
|
|
2607
|
-
for T in types:
|
|
2608
|
-
if T not in unchecked_types:
|
|
2609
|
-
yield self.tst_basic, x.copy().astype(T)
|
|
2610
|
-
|
|
2611
|
-
def test_raise(self):
|
|
2612
|
-
x = np.random.random(24)*100
|
|
2613
|
-
x.shape = 2, 3, 4
|
|
2614
|
-
assert_raises(IndexError, x.take, [0, 1, 2], axis=0)
|
|
2615
|
-
assert_raises(IndexError, x.take, [-3], axis=0)
|
|
2616
|
-
assert_array_equal(x.take([-1], axis=0)[0], x[1])
|
|
2617
|
-
|
|
2618
|
-
def test_clip(self):
|
|
2619
|
-
x = np.random.random(24)*100
|
|
2620
|
-
x.shape = 2, 3, 4
|
|
2621
|
-
assert_array_equal(x.take([-1], axis=0, mode='clip')[0], x[0])
|
|
2622
|
-
assert_array_equal(x.take([2], axis=0, mode='clip')[0], x[1])
|
|
2623
|
-
|
|
2624
|
-
def test_wrap(self):
|
|
2625
|
-
x = np.random.random(24)*100
|
|
2626
|
-
x.shape = 2, 3, 4
|
|
2627
|
-
assert_array_equal(x.take([-1], axis=0, mode='wrap')[0], x[1])
|
|
2628
|
-
assert_array_equal(x.take([2], axis=0, mode='wrap')[0], x[0])
|
|
2629
|
-
assert_array_equal(x.take([3], axis=0, mode='wrap')[0], x[1])
|
|
2630
|
-
|
|
2631
|
-
def tst_byteorder(self, dtype):
|
|
2632
|
-
x = np.array([1, 2, 3], dtype)
|
|
2633
|
-
assert_array_equal(x.take([0, 2, 1]), [1, 3, 2])
|
|
2634
|
-
|
|
2635
|
-
def test_ip_byteorder(self):
|
|
2636
|
-
for dtype in ('>i4', '<i4'):
|
|
2637
|
-
yield self.tst_byteorder, dtype
|
|
2638
|
-
|
|
2639
|
-
def test_record_array(self):
|
|
2640
|
-
# Note mixed byteorder.
|
|
2641
|
-
rec = np.array([(-5, 2.0, 3.0), (5.0, 4.0, 3.0)],
|
|
2642
|
-
dtype=[('x', '<f8'), ('y', '>f8'), ('z', '<f8')])
|
|
2643
|
-
rec1 = rec.take([1])
|
|
2644
|
-
assert_(rec1['x'] == 5.0 and rec1['y'] == 4.0)
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
class TestLexsort(TestCase):
|
|
2648
|
-
def test_basic(self):
|
|
2649
|
-
a = [1, 2, 1, 3, 1, 5]
|
|
2650
|
-
b = [0, 4, 5, 6, 2, 3]
|
|
2651
|
-
idx = np.lexsort((b, a))
|
|
2652
|
-
expected_idx = np.array([0, 4, 2, 1, 3, 5])
|
|
2653
|
-
assert_array_equal(idx, expected_idx)
|
|
2654
|
-
|
|
2655
|
-
x = np.vstack((b, a))
|
|
2656
|
-
idx = np.lexsort(x)
|
|
2657
|
-
assert_array_equal(idx, expected_idx)
|
|
2658
|
-
|
|
2659
|
-
assert_array_equal(x[1][idx], np.sort(x[1]))
|
|
2660
|
-
|
|
2661
|
-
def test_datetime(self):
|
|
2662
|
-
a = np.array([0,0,0], dtype='datetime64[D]')
|
|
2663
|
-
b = np.array([2,1,0], dtype='datetime64[D]')
|
|
2664
|
-
idx = np.lexsort((b, a))
|
|
2665
|
-
expected_idx = np.array([2, 1, 0])
|
|
2666
|
-
assert_array_equal(idx, expected_idx)
|
|
2667
|
-
|
|
2668
|
-
a = np.array([0,0,0], dtype='timedelta64[D]')
|
|
2669
|
-
b = np.array([2,1,0], dtype='timedelta64[D]')
|
|
2670
|
-
idx = np.lexsort((b, a))
|
|
2671
|
-
expected_idx = np.array([2, 1, 0])
|
|
2672
|
-
assert_array_equal(idx, expected_idx)
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
class TestIO(object):
|
|
2676
|
-
"""Test tofile, fromfile, tobytes, and fromstring"""
|
|
2677
|
-
|
|
2678
|
-
def setUp(self):
|
|
2679
|
-
shape = (2, 4, 3)
|
|
2680
|
-
rand = np.random.random
|
|
2681
|
-
self.x = rand(shape) + rand(shape).astype(np.complex)*1j
|
|
2682
|
-
self.x[0,:, 1] = [nan, inf, -inf, nan]
|
|
2683
|
-
self.dtype = self.x.dtype
|
|
2684
|
-
self.tempdir = tempfile.mkdtemp()
|
|
2685
|
-
self.filename = tempfile.mktemp(dir=self.tempdir)
|
|
2686
|
-
|
|
2687
|
-
def tearDown(self):
|
|
2688
|
-
shutil.rmtree(self.tempdir)
|
|
2689
|
-
|
|
2690
|
-
def test_bool_fromstring(self):
|
|
2691
|
-
v = np.array([True, False, True, False], dtype=np.bool_)
|
|
2692
|
-
y = np.fromstring('1 0 -2.3 0.0', sep=' ', dtype=np.bool_)
|
|
2693
|
-
assert_array_equal(v, y)
|
|
2694
|
-
|
|
2695
|
-
def test_uint64_fromstring(self):
|
|
2696
|
-
d = np.fromstring("9923372036854775807 104783749223640",
|
|
2697
|
-
dtype=np.uint64, sep=' ');
|
|
2698
|
-
e = np.array([9923372036854775807, 104783749223640], dtype=np.uint64)
|
|
2699
|
-
assert_array_equal(d, e)
|
|
2700
|
-
|
|
2701
|
-
def test_int64_fromstring(self):
|
|
2702
|
-
d = np.fromstring("-25041670086757 104783749223640",
|
|
2703
|
-
dtype=np.int64, sep=' ');
|
|
2704
|
-
e = np.array([-25041670086757, 104783749223640], dtype=np.int64)
|
|
2705
|
-
assert_array_equal(d, e)
|
|
2706
|
-
|
|
2707
|
-
def test_empty_files_binary(self):
|
|
2708
|
-
f = open(self.filename, 'w')
|
|
2709
|
-
f.close()
|
|
2710
|
-
y = fromfile(self.filename)
|
|
2711
|
-
assert_(y.size == 0, "Array not empty")
|
|
2712
|
-
|
|
2713
|
-
def test_empty_files_text(self):
|
|
2714
|
-
f = open(self.filename, 'w')
|
|
2715
|
-
f.close()
|
|
2716
|
-
y = fromfile(self.filename, sep=" ")
|
|
2717
|
-
assert_(y.size == 0, "Array not empty")
|
|
2718
|
-
|
|
2719
|
-
def test_roundtrip_file(self):
|
|
2720
|
-
f = open(self.filename, 'wb')
|
|
2721
|
-
self.x.tofile(f)
|
|
2722
|
-
f.close()
|
|
2723
|
-
# NB. doesn't work with flush+seek, due to use of C stdio
|
|
2724
|
-
f = open(self.filename, 'rb')
|
|
2725
|
-
y = np.fromfile(f, dtype=self.dtype)
|
|
2726
|
-
f.close()
|
|
2727
|
-
assert_array_equal(y, self.x.flat)
|
|
2728
|
-
|
|
2729
|
-
def test_roundtrip_filename(self):
|
|
2730
|
-
self.x.tofile(self.filename)
|
|
2731
|
-
y = np.fromfile(self.filename, dtype=self.dtype)
|
|
2732
|
-
assert_array_equal(y, self.x.flat)
|
|
2733
|
-
|
|
2734
|
-
def test_roundtrip_binary_str(self):
|
|
2735
|
-
s = self.x.tobytes()
|
|
2736
|
-
y = np.fromstring(s, dtype=self.dtype)
|
|
2737
|
-
assert_array_equal(y, self.x.flat)
|
|
2738
|
-
|
|
2739
|
-
s = self.x.tobytes('F')
|
|
2740
|
-
y = np.fromstring(s, dtype=self.dtype)
|
|
2741
|
-
assert_array_equal(y, self.x.flatten('F'))
|
|
2742
|
-
|
|
2743
|
-
def test_roundtrip_str(self):
|
|
2744
|
-
x = self.x.real.ravel()
|
|
2745
|
-
s = "@".join(map(str, x))
|
|
2746
|
-
y = np.fromstring(s, sep="@")
|
|
2747
|
-
# NB. str imbues less precision
|
|
2748
|
-
nan_mask = ~np.isfinite(x)
|
|
2749
|
-
assert_array_equal(x[nan_mask], y[nan_mask])
|
|
2750
|
-
assert_array_almost_equal(x[~nan_mask], y[~nan_mask], decimal=5)
|
|
2751
|
-
|
|
2752
|
-
def test_roundtrip_repr(self):
|
|
2753
|
-
x = self.x.real.ravel()
|
|
2754
|
-
s = "@".join(map(repr, x))
|
|
2755
|
-
y = np.fromstring(s, sep="@")
|
|
2756
|
-
assert_array_equal(x, y)
|
|
2757
|
-
|
|
2758
|
-
def test_file_position_after_fromfile(self):
|
|
2759
|
-
# gh-4118
|
|
2760
|
-
sizes = [io.DEFAULT_BUFFER_SIZE//8,
|
|
2761
|
-
io.DEFAULT_BUFFER_SIZE,
|
|
2762
|
-
io.DEFAULT_BUFFER_SIZE*8]
|
|
2763
|
-
|
|
2764
|
-
for size in sizes:
|
|
2765
|
-
f = open(self.filename, 'wb')
|
|
2766
|
-
f.seek(size-1)
|
|
2767
|
-
f.write(b'\0')
|
|
2768
|
-
f.close()
|
|
2769
|
-
|
|
2770
|
-
for mode in ['rb', 'r+b']:
|
|
2771
|
-
err_msg = "%d %s" % (size, mode)
|
|
2772
|
-
|
|
2773
|
-
f = open(self.filename, mode)
|
|
2774
|
-
f.read(2)
|
|
2775
|
-
np.fromfile(f, dtype=np.float64, count=1)
|
|
2776
|
-
pos = f.tell()
|
|
2777
|
-
f.close()
|
|
2778
|
-
assert_equal(pos, 10, err_msg=err_msg)
|
|
2779
|
-
|
|
2780
|
-
def test_file_position_after_tofile(self):
|
|
2781
|
-
# gh-4118
|
|
2782
|
-
sizes = [io.DEFAULT_BUFFER_SIZE//8,
|
|
2783
|
-
io.DEFAULT_BUFFER_SIZE,
|
|
2784
|
-
io.DEFAULT_BUFFER_SIZE*8]
|
|
2785
|
-
|
|
2786
|
-
for size in sizes:
|
|
2787
|
-
err_msg = "%d" % (size,)
|
|
2788
|
-
|
|
2789
|
-
f = open(self.filename, 'wb')
|
|
2790
|
-
f.seek(size-1)
|
|
2791
|
-
f.write(b'\0')
|
|
2792
|
-
f.seek(10)
|
|
2793
|
-
f.write(b'12')
|
|
2794
|
-
np.array([0], dtype=np.float64).tofile(f)
|
|
2795
|
-
pos = f.tell()
|
|
2796
|
-
f.close()
|
|
2797
|
-
assert_equal(pos, 10 + 2 + 8, err_msg=err_msg)
|
|
2798
|
-
|
|
2799
|
-
f = open(self.filename, 'r+b')
|
|
2800
|
-
f.read(2)
|
|
2801
|
-
f.seek(0, 1) # seek between read&write required by ANSI C
|
|
2802
|
-
np.array([0], dtype=np.float64).tofile(f)
|
|
2803
|
-
pos = f.tell()
|
|
2804
|
-
f.close()
|
|
2805
|
-
assert_equal(pos, 10, err_msg=err_msg)
|
|
2806
|
-
|
|
2807
|
-
def _check_from(self, s, value, **kw):
|
|
2808
|
-
y = np.fromstring(asbytes(s), **kw)
|
|
2809
|
-
assert_array_equal(y, value)
|
|
2810
|
-
|
|
2811
|
-
f = open(self.filename, 'wb')
|
|
2812
|
-
f.write(asbytes(s))
|
|
2813
|
-
f.close()
|
|
2814
|
-
y = np.fromfile(self.filename, **kw)
|
|
2815
|
-
assert_array_equal(y, value)
|
|
2816
|
-
|
|
2817
|
-
def test_nan(self):
|
|
2818
|
-
self._check_from("nan +nan -nan NaN nan(foo) +NaN(BAR) -NAN(q_u_u_x_)",
|
|
2819
|
-
[nan, nan, nan, nan, nan, nan, nan],
|
|
2820
|
-
sep=' ')
|
|
2821
|
-
|
|
2822
|
-
def test_inf(self):
|
|
2823
|
-
self._check_from("inf +inf -inf infinity -Infinity iNfInItY -inF",
|
|
2824
|
-
[inf, inf, -inf, inf, -inf, inf, -inf], sep=' ')
|
|
2825
|
-
|
|
2826
|
-
def test_numbers(self):
|
|
2827
|
-
self._check_from("1.234 -1.234 .3 .3e55 -123133.1231e+133",
|
|
2828
|
-
[1.234, -1.234, .3, .3e55, -123133.1231e+133], sep=' ')
|
|
2829
|
-
|
|
2830
|
-
def test_binary(self):
|
|
2831
|
-
self._check_from('\x00\x00\x80?\x00\x00\x00@\x00\x00@@\x00\x00\x80@',
|
|
2832
|
-
array([1, 2, 3, 4]),
|
|
2833
|
-
dtype='<f4')
|
|
2834
|
-
|
|
2835
|
-
@dec.slow # takes > 1 minute on mechanical hard drive
|
|
2836
|
-
def test_big_binary(self):
|
|
2837
|
-
"""Test workarounds for 32-bit limited fwrite, fseek, and ftell
|
|
2838
|
-
calls in windows. These normally would hang doing something like this.
|
|
2839
|
-
See http://projects.scipy.org/numpy/ticket/1660"""
|
|
2840
|
-
if sys.platform != 'win32':
|
|
2841
|
-
return
|
|
2842
|
-
try:
|
|
2843
|
-
# before workarounds, only up to 2**32-1 worked
|
|
2844
|
-
fourgbplus = 2**32 + 2**16
|
|
2845
|
-
testbytes = np.arange(8, dtype=np.int8)
|
|
2846
|
-
n = len(testbytes)
|
|
2847
|
-
flike = tempfile.NamedTemporaryFile()
|
|
2848
|
-
f = flike.file
|
|
2849
|
-
np.tile(testbytes, fourgbplus // testbytes.nbytes).tofile(f)
|
|
2850
|
-
flike.seek(0)
|
|
2851
|
-
a = np.fromfile(f, dtype=np.int8)
|
|
2852
|
-
flike.close()
|
|
2853
|
-
assert_(len(a) == fourgbplus)
|
|
2854
|
-
# check only start and end for speed:
|
|
2855
|
-
assert_((a[:n] == testbytes).all())
|
|
2856
|
-
assert_((a[-n:] == testbytes).all())
|
|
2857
|
-
except (MemoryError, ValueError):
|
|
2858
|
-
pass
|
|
2859
|
-
|
|
2860
|
-
def test_string(self):
|
|
2861
|
-
self._check_from('1,2,3,4', [1., 2., 3., 4.], sep=',')
|
|
2862
|
-
|
|
2863
|
-
def test_counted_string(self):
|
|
2864
|
-
self._check_from('1,2,3,4', [1., 2., 3., 4.], count=4, sep=',')
|
|
2865
|
-
self._check_from('1,2,3,4', [1., 2., 3.], count=3, sep=',')
|
|
2866
|
-
self._check_from('1,2,3,4', [1., 2., 3., 4.], count=-1, sep=',')
|
|
2867
|
-
|
|
2868
|
-
def test_string_with_ws(self):
|
|
2869
|
-
self._check_from('1 2 3 4 ', [1, 2, 3, 4], dtype=int, sep=' ')
|
|
2870
|
-
|
|
2871
|
-
def test_counted_string_with_ws(self):
|
|
2872
|
-
self._check_from('1 2 3 4 ', [1, 2, 3], count=3, dtype=int,
|
|
2873
|
-
sep=' ')
|
|
2874
|
-
|
|
2875
|
-
def test_ascii(self):
|
|
2876
|
-
self._check_from('1 , 2 , 3 , 4', [1., 2., 3., 4.], sep=',')
|
|
2877
|
-
self._check_from('1,2,3,4', [1., 2., 3., 4.], dtype=float, sep=',')
|
|
2878
|
-
|
|
2879
|
-
def test_malformed(self):
|
|
2880
|
-
self._check_from('1.234 1,234', [1.234, 1.], sep=' ')
|
|
2881
|
-
|
|
2882
|
-
def test_long_sep(self):
|
|
2883
|
-
self._check_from('1_x_3_x_4_x_5', [1, 3, 4, 5], sep='_x_')
|
|
2884
|
-
|
|
2885
|
-
def test_dtype(self):
|
|
2886
|
-
v = np.array([1, 2, 3, 4], dtype=np.int_)
|
|
2887
|
-
self._check_from('1,2,3,4', v, sep=',', dtype=np.int_)
|
|
2888
|
-
|
|
2889
|
-
def test_dtype_bool(self):
|
|
2890
|
-
# can't use _check_from because fromstring can't handle True/False
|
|
2891
|
-
v = np.array([True, False, True, False], dtype=np.bool_)
|
|
2892
|
-
s = '1,0,-2.3,0'
|
|
2893
|
-
f = open(self.filename, 'wb')
|
|
2894
|
-
f.write(asbytes(s))
|
|
2895
|
-
f.close()
|
|
2896
|
-
y = np.fromfile(self.filename, sep=',', dtype=np.bool_)
|
|
2897
|
-
assert_(y.dtype == '?')
|
|
2898
|
-
assert_array_equal(y, v)
|
|
2899
|
-
|
|
2900
|
-
def test_tofile_sep(self):
|
|
2901
|
-
x = np.array([1.51, 2, 3.51, 4], dtype=float)
|
|
2902
|
-
f = open(self.filename, 'w')
|
|
2903
|
-
x.tofile(f, sep=',')
|
|
2904
|
-
f.close()
|
|
2905
|
-
f = open(self.filename, 'r')
|
|
2906
|
-
s = f.read()
|
|
2907
|
-
f.close()
|
|
2908
|
-
assert_equal(s, '1.51,2.0,3.51,4.0')
|
|
2909
|
-
|
|
2910
|
-
def test_tofile_format(self):
|
|
2911
|
-
x = np.array([1.51, 2, 3.51, 4], dtype=float)
|
|
2912
|
-
f = open(self.filename, 'w')
|
|
2913
|
-
x.tofile(f, sep=',', format='%.2f')
|
|
2914
|
-
f.close()
|
|
2915
|
-
f = open(self.filename, 'r')
|
|
2916
|
-
s = f.read()
|
|
2917
|
-
f.close()
|
|
2918
|
-
assert_equal(s, '1.51,2.00,3.51,4.00')
|
|
2919
|
-
|
|
2920
|
-
def test_locale(self):
|
|
2921
|
-
in_foreign_locale(self.test_numbers)()
|
|
2922
|
-
in_foreign_locale(self.test_nan)()
|
|
2923
|
-
in_foreign_locale(self.test_inf)()
|
|
2924
|
-
in_foreign_locale(self.test_counted_string)()
|
|
2925
|
-
in_foreign_locale(self.test_ascii)()
|
|
2926
|
-
in_foreign_locale(self.test_malformed)()
|
|
2927
|
-
in_foreign_locale(self.test_tofile_sep)()
|
|
2928
|
-
in_foreign_locale(self.test_tofile_format)()
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
class TestFromBuffer(object):
|
|
2932
|
-
def tst_basic(self, buffer, expected, kwargs):
|
|
2933
|
-
assert_array_equal(np.frombuffer(buffer,**kwargs), expected)
|
|
2934
|
-
|
|
2935
|
-
def test_ip_basic(self):
|
|
2936
|
-
for byteorder in ['<', '>']:
|
|
2937
|
-
for dtype in [float, int, np.complex]:
|
|
2938
|
-
dt = np.dtype(dtype).newbyteorder(byteorder)
|
|
2939
|
-
x = (np.random.random((4, 7))*5).astype(dt)
|
|
2940
|
-
buf = x.tobytes()
|
|
2941
|
-
yield self.tst_basic, buf, x.flat, {'dtype':dt}
|
|
2942
|
-
|
|
2943
|
-
def test_empty(self):
|
|
2944
|
-
yield self.tst_basic, asbytes(''), np.array([]), {}
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
class TestFlat(TestCase):
|
|
2948
|
-
def setUp(self):
|
|
2949
|
-
a0 = arange(20.0)
|
|
2950
|
-
a = a0.reshape(4, 5)
|
|
2951
|
-
a0.shape = (4, 5)
|
|
2952
|
-
a.flags.writeable = False
|
|
2953
|
-
self.a = a
|
|
2954
|
-
self.b = a[::2, ::2]
|
|
2955
|
-
self.a0 = a0
|
|
2956
|
-
self.b0 = a0[::2, ::2]
|
|
2957
|
-
|
|
2958
|
-
def test_contiguous(self):
|
|
2959
|
-
testpassed = False
|
|
2960
|
-
try:
|
|
2961
|
-
self.a.flat[12] = 100.0
|
|
2962
|
-
except ValueError:
|
|
2963
|
-
testpassed = True
|
|
2964
|
-
assert testpassed
|
|
2965
|
-
assert self.a.flat[12] == 12.0
|
|
2966
|
-
|
|
2967
|
-
def test_discontiguous(self):
|
|
2968
|
-
testpassed = False
|
|
2969
|
-
try:
|
|
2970
|
-
self.b.flat[4] = 100.0
|
|
2971
|
-
except ValueError:
|
|
2972
|
-
testpassed = True
|
|
2973
|
-
assert testpassed
|
|
2974
|
-
assert self.b.flat[4] == 12.0
|
|
2975
|
-
|
|
2976
|
-
def test___array__(self):
|
|
2977
|
-
c = self.a.flat.__array__()
|
|
2978
|
-
d = self.b.flat.__array__()
|
|
2979
|
-
e = self.a0.flat.__array__()
|
|
2980
|
-
f = self.b0.flat.__array__()
|
|
2981
|
-
|
|
2982
|
-
assert c.flags.writeable is False
|
|
2983
|
-
assert d.flags.writeable is False
|
|
2984
|
-
assert e.flags.writeable is True
|
|
2985
|
-
assert f.flags.writeable is True
|
|
2986
|
-
|
|
2987
|
-
assert c.flags.updateifcopy is False
|
|
2988
|
-
assert d.flags.updateifcopy is False
|
|
2989
|
-
assert e.flags.updateifcopy is False
|
|
2990
|
-
assert f.flags.updateifcopy is True
|
|
2991
|
-
assert f.base is self.b0
|
|
2992
|
-
|
|
2993
|
-
class TestResize(TestCase):
|
|
2994
|
-
def test_basic(self):
|
|
2995
|
-
x = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
|
|
2996
|
-
x.resize((5, 5))
|
|
2997
|
-
assert_array_equal(x.flat[:9],
|
|
2998
|
-
np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]).flat)
|
|
2999
|
-
assert_array_equal(x[9:].flat, 0)
|
|
3000
|
-
|
|
3001
|
-
def test_check_reference(self):
|
|
3002
|
-
x = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
|
|
3003
|
-
y = x
|
|
3004
|
-
self.assertRaises(ValueError, x.resize, (5, 1))
|
|
3005
|
-
|
|
3006
|
-
def test_int_shape(self):
|
|
3007
|
-
x = np.eye(3)
|
|
3008
|
-
x.resize(3)
|
|
3009
|
-
assert_array_equal(x, np.eye(3)[0,:])
|
|
3010
|
-
|
|
3011
|
-
def test_none_shape(self):
|
|
3012
|
-
x = np.eye(3)
|
|
3013
|
-
x.resize(None)
|
|
3014
|
-
assert_array_equal(x, np.eye(3))
|
|
3015
|
-
x.resize()
|
|
3016
|
-
assert_array_equal(x, np.eye(3))
|
|
3017
|
-
|
|
3018
|
-
def test_invalid_arguements(self):
|
|
3019
|
-
self.assertRaises(TypeError, np.eye(3).resize, 'hi')
|
|
3020
|
-
self.assertRaises(ValueError, np.eye(3).resize, -1)
|
|
3021
|
-
self.assertRaises(TypeError, np.eye(3).resize, order=1)
|
|
3022
|
-
self.assertRaises(TypeError, np.eye(3).resize, refcheck='hi')
|
|
3023
|
-
|
|
3024
|
-
def test_freeform_shape(self):
|
|
3025
|
-
x = np.eye(3)
|
|
3026
|
-
x.resize(3, 2, 1)
|
|
3027
|
-
assert_(x.shape == (3, 2, 1))
|
|
3028
|
-
|
|
3029
|
-
def test_zeros_appended(self):
|
|
3030
|
-
x = np.eye(3)
|
|
3031
|
-
x.resize(2, 3, 3)
|
|
3032
|
-
assert_array_equal(x[0], np.eye(3))
|
|
3033
|
-
assert_array_equal(x[1], np.zeros((3, 3)))
|
|
3034
|
-
|
|
3035
|
-
def test_obj_obj(self):
|
|
3036
|
-
# check memory is initialized on resize, gh-4857
|
|
3037
|
-
a = ones(10, dtype=[('k', object, 2)])
|
|
3038
|
-
a.resize(15,)
|
|
3039
|
-
assert_equal(a.shape, (15,))
|
|
3040
|
-
assert_array_equal(a['k'][-5:], 0)
|
|
3041
|
-
assert_array_equal(a['k'][:-5], 1)
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
class TestRecord(TestCase):
|
|
3045
|
-
def test_field_rename(self):
|
|
3046
|
-
dt = np.dtype([('f', float), ('i', int)])
|
|
3047
|
-
dt.names = ['p', 'q']
|
|
3048
|
-
assert_equal(dt.names, ['p', 'q'])
|
|
3049
|
-
|
|
3050
|
-
if sys.version_info[0] >= 3:
|
|
3051
|
-
def test_bytes_fields(self):
|
|
3052
|
-
# Bytes are not allowed in field names and not recognized in titles
|
|
3053
|
-
# on Py3
|
|
3054
|
-
assert_raises(TypeError, np.dtype, [(asbytes('a'), int)])
|
|
3055
|
-
assert_raises(TypeError, np.dtype, [(('b', asbytes('a')), int)])
|
|
3056
|
-
|
|
3057
|
-
dt = np.dtype([((asbytes('a'), 'b'), int)])
|
|
3058
|
-
assert_raises(ValueError, dt.__getitem__, asbytes('a'))
|
|
3059
|
-
|
|
3060
|
-
x = np.array([(1,), (2,), (3,)], dtype=dt)
|
|
3061
|
-
assert_raises(ValueError, x.__getitem__, asbytes('a'))
|
|
3062
|
-
|
|
3063
|
-
y = x[0]
|
|
3064
|
-
assert_raises(IndexError, y.__getitem__, asbytes('a'))
|
|
3065
|
-
else:
|
|
3066
|
-
def test_unicode_field_titles(self):
|
|
3067
|
-
# Unicode field titles are added to field dict on Py2
|
|
3068
|
-
title = unicode('b')
|
|
3069
|
-
dt = np.dtype([((title, 'a'), int)])
|
|
3070
|
-
dt[title]
|
|
3071
|
-
dt['a']
|
|
3072
|
-
x = np.array([(1,), (2,), (3,)], dtype=dt)
|
|
3073
|
-
x[title]
|
|
3074
|
-
x['a']
|
|
3075
|
-
y = x[0]
|
|
3076
|
-
y[title]
|
|
3077
|
-
y['a']
|
|
3078
|
-
|
|
3079
|
-
def test_unicode_field_names(self):
|
|
3080
|
-
# Unicode field names are not allowed on Py2
|
|
3081
|
-
title = unicode('b')
|
|
3082
|
-
assert_raises(TypeError, np.dtype, [(title, int)])
|
|
3083
|
-
assert_raises(TypeError, np.dtype, [(('a', title), int)])
|
|
3084
|
-
|
|
3085
|
-
def test_field_names(self):
|
|
3086
|
-
# Test unicode and 8-bit / byte strings can be used
|
|
3087
|
-
a = np.zeros((1,), dtype=[('f1', 'i4'),
|
|
3088
|
-
('f2', 'i4'),
|
|
3089
|
-
('f3', [('sf1', 'i4')])])
|
|
3090
|
-
is_py3 = sys.version_info[0] >= 3
|
|
3091
|
-
if is_py3:
|
|
3092
|
-
funcs = (str,)
|
|
3093
|
-
# byte string indexing fails gracefully
|
|
3094
|
-
assert_raises(ValueError, a.__setitem__, asbytes('f1'), 1)
|
|
3095
|
-
assert_raises(ValueError, a.__getitem__, asbytes('f1'))
|
|
3096
|
-
assert_raises(IndexError, a['f1'].__setitem__, asbytes('sf1'), 1)
|
|
3097
|
-
assert_raises(IndexError, a['f1'].__getitem__, asbytes('sf1'))
|
|
3098
|
-
else:
|
|
3099
|
-
funcs = (str, unicode)
|
|
3100
|
-
for func in funcs:
|
|
3101
|
-
b = a.copy()
|
|
3102
|
-
fn1 = func('f1')
|
|
3103
|
-
b[fn1] = 1
|
|
3104
|
-
assert_equal(b[fn1], 1)
|
|
3105
|
-
fnn = func('not at all')
|
|
3106
|
-
assert_raises(ValueError, b.__setitem__, fnn, 1)
|
|
3107
|
-
assert_raises(ValueError, b.__getitem__, fnn)
|
|
3108
|
-
b[0][fn1] = 2
|
|
3109
|
-
assert_equal(b[fn1], 2)
|
|
3110
|
-
# Subfield
|
|
3111
|
-
assert_raises(IndexError, b[0].__setitem__, fnn, 1)
|
|
3112
|
-
assert_raises(IndexError, b[0].__getitem__, fnn)
|
|
3113
|
-
# Subfield
|
|
3114
|
-
fn3 = func('f3')
|
|
3115
|
-
sfn1 = func('sf1')
|
|
3116
|
-
b[fn3][sfn1] = 1
|
|
3117
|
-
assert_equal(b[fn3][sfn1], 1)
|
|
3118
|
-
assert_raises(ValueError, b[fn3].__setitem__, fnn, 1)
|
|
3119
|
-
assert_raises(ValueError, b[fn3].__getitem__, fnn)
|
|
3120
|
-
# multiple Subfields
|
|
3121
|
-
fn2 = func('f2')
|
|
3122
|
-
b[fn2] = 3
|
|
3123
|
-
assert_equal(b[['f1', 'f2']][0].tolist(), (2, 3))
|
|
3124
|
-
assert_equal(b[['f2', 'f1']][0].tolist(), (3, 2))
|
|
3125
|
-
assert_equal(b[['f1', 'f3']][0].tolist(), (2, (1,)))
|
|
3126
|
-
# view of subfield view/copy
|
|
3127
|
-
assert_equal(b[['f1', 'f2']][0].view(('i4', 2)).tolist(), (2, 3))
|
|
3128
|
-
assert_equal(b[['f2', 'f1']][0].view(('i4', 2)).tolist(), (3, 2))
|
|
3129
|
-
view_dtype=[('f1', 'i4'), ('f3', [('', 'i4')])]
|
|
3130
|
-
assert_equal(b[['f1', 'f3']][0].view(view_dtype).tolist(), (2, (1,)))
|
|
3131
|
-
# non-ascii unicode field indexing is well behaved
|
|
3132
|
-
if not is_py3:
|
|
3133
|
-
raise SkipTest('non ascii unicode field indexing skipped; '
|
|
3134
|
-
'raises segfault on python 2.x')
|
|
3135
|
-
else:
|
|
3136
|
-
assert_raises(ValueError, a.__setitem__, sixu('\u03e0'), 1)
|
|
3137
|
-
assert_raises(ValueError, a.__getitem__, sixu('\u03e0'))
|
|
3138
|
-
|
|
3139
|
-
def test_field_names_deprecation(self):
|
|
3140
|
-
|
|
3141
|
-
def collect_warning_types(f, *args, **kwargs):
|
|
3142
|
-
with warnings.catch_warnings(record=True) as log:
|
|
3143
|
-
warnings.simplefilter("always")
|
|
3144
|
-
f(*args, **kwargs)
|
|
3145
|
-
return [w.category for w in log]
|
|
3146
|
-
|
|
3147
|
-
a = np.zeros((1,), dtype=[('f1', 'i4'),
|
|
3148
|
-
('f2', 'i4'),
|
|
3149
|
-
('f3', [('sf1', 'i4')])])
|
|
3150
|
-
a['f1'][0] = 1
|
|
3151
|
-
a['f2'][0] = 2
|
|
3152
|
-
a['f3'][0] = (3,)
|
|
3153
|
-
b = np.zeros((1,), dtype=[('f1', 'i4'),
|
|
3154
|
-
('f2', 'i4'),
|
|
3155
|
-
('f3', [('sf1', 'i4')])])
|
|
3156
|
-
b['f1'][0] = 1
|
|
3157
|
-
b['f2'][0] = 2
|
|
3158
|
-
b['f3'][0] = (3,)
|
|
3159
|
-
|
|
3160
|
-
# All the different functions raise a warning, but not an error, and
|
|
3161
|
-
# 'a' is not modified:
|
|
3162
|
-
assert_equal(collect_warning_types(a[['f1', 'f2']].__setitem__, 0, (10, 20)),
|
|
3163
|
-
[FutureWarning])
|
|
3164
|
-
assert_equal(a, b)
|
|
3165
|
-
# Views also warn
|
|
3166
|
-
subset = a[['f1', 'f2']]
|
|
3167
|
-
subset_view = subset.view()
|
|
3168
|
-
assert_equal(collect_warning_types(subset_view['f1'].__setitem__, 0, 10),
|
|
3169
|
-
[FutureWarning])
|
|
3170
|
-
# But the write goes through:
|
|
3171
|
-
assert_equal(subset['f1'][0], 10)
|
|
3172
|
-
# Only one warning per multiple field indexing, though (even if there are
|
|
3173
|
-
# multiple views involved):
|
|
3174
|
-
assert_equal(collect_warning_types(subset['f1'].__setitem__, 0, 10),
|
|
3175
|
-
[])
|
|
3176
|
-
|
|
3177
|
-
def test_record_hash(self):
|
|
3178
|
-
a = np.array([(1, 2), (1, 2)], dtype='i1,i2')
|
|
3179
|
-
a.flags.writeable = False
|
|
3180
|
-
b = np.array([(1, 2), (3, 4)], dtype=[('num1', 'i1'), ('num2', 'i2')])
|
|
3181
|
-
b.flags.writeable = False
|
|
3182
|
-
c = np.array([(1, 2), (3, 4)], dtype='i1,i2')
|
|
3183
|
-
c.flags.writeable = False
|
|
3184
|
-
self.assertTrue(hash(a[0]) == hash(a[1]))
|
|
3185
|
-
self.assertTrue(hash(a[0]) == hash(b[0]))
|
|
3186
|
-
self.assertTrue(hash(a[0]) != hash(b[1]))
|
|
3187
|
-
self.assertTrue(hash(c[0]) == hash(a[0]) and c[0] == a[0])
|
|
3188
|
-
|
|
3189
|
-
def test_record_no_hash(self):
|
|
3190
|
-
a = np.array([(1, 2), (1, 2)], dtype='i1,i2')
|
|
3191
|
-
self.assertRaises(TypeError, hash, a[0])
|
|
3192
|
-
|
|
3193
|
-
class TestView(TestCase):
|
|
3194
|
-
def test_basic(self):
|
|
3195
|
-
x = np.array([(1, 2, 3, 4), (5, 6, 7, 8)], dtype=[('r', np.int8), ('g', np.int8),
|
|
3196
|
-
('b', np.int8), ('a', np.int8)])
|
|
3197
|
-
# We must be specific about the endianness here:
|
|
3198
|
-
y = x.view(dtype='<i4')
|
|
3199
|
-
# ... and again without the keyword.
|
|
3200
|
-
z = x.view('<i4')
|
|
3201
|
-
assert_array_equal(y, z)
|
|
3202
|
-
assert_array_equal(y, [67305985, 134678021])
|
|
3203
|
-
|
|
3204
|
-
def _mean(a, **args):
|
|
3205
|
-
return a.mean(**args)
|
|
3206
|
-
|
|
3207
|
-
def _var(a, **args):
|
|
3208
|
-
return a.var(**args)
|
|
3209
|
-
|
|
3210
|
-
def _std(a, **args):
|
|
3211
|
-
return a.std(**args)
|
|
3212
|
-
|
|
3213
|
-
class TestStats(TestCase):
|
|
3214
|
-
|
|
3215
|
-
funcs = [_mean, _var, _std]
|
|
3216
|
-
|
|
3217
|
-
def setUp(self):
|
|
3218
|
-
np.random.seed(range(3))
|
|
3219
|
-
self.rmat = np.random.random((4, 5))
|
|
3220
|
-
self.cmat = self.rmat + 1j * self.rmat
|
|
3221
|
-
self.omat = np.array([Decimal(repr(r)) for r in self.rmat.flat])
|
|
3222
|
-
self.omat = self.omat.reshape(4, 5)
|
|
3223
|
-
|
|
3224
|
-
def test_keepdims(self):
|
|
3225
|
-
mat = np.eye(3)
|
|
3226
|
-
for f in self.funcs:
|
|
3227
|
-
for axis in [0, 1]:
|
|
3228
|
-
res = f(mat, axis=axis, keepdims=True)
|
|
3229
|
-
assert_(res.ndim == mat.ndim)
|
|
3230
|
-
assert_(res.shape[axis] == 1)
|
|
3231
|
-
for axis in [None]:
|
|
3232
|
-
res = f(mat, axis=axis, keepdims=True)
|
|
3233
|
-
assert_(res.shape == (1, 1))
|
|
3234
|
-
|
|
3235
|
-
def test_out(self):
|
|
3236
|
-
mat = np.eye(3)
|
|
3237
|
-
for f in self.funcs:
|
|
3238
|
-
out = np.zeros(3)
|
|
3239
|
-
tgt = f(mat, axis=1)
|
|
3240
|
-
res = f(mat, axis=1, out=out)
|
|
3241
|
-
assert_almost_equal(res, out)
|
|
3242
|
-
assert_almost_equal(res, tgt)
|
|
3243
|
-
out = np.empty(2)
|
|
3244
|
-
assert_raises(ValueError, f, mat, axis=1, out=out)
|
|
3245
|
-
out = np.empty((2, 2))
|
|
3246
|
-
assert_raises(ValueError, f, mat, axis=1, out=out)
|
|
3247
|
-
|
|
3248
|
-
def test_dtype_from_input(self):
|
|
3249
|
-
|
|
3250
|
-
icodes = np.typecodes['AllInteger']
|
|
3251
|
-
fcodes = np.typecodes['AllFloat']
|
|
3252
|
-
|
|
3253
|
-
# object type
|
|
3254
|
-
for f in self.funcs:
|
|
3255
|
-
mat = np.array([[Decimal(1)]*3]*3)
|
|
3256
|
-
tgt = mat.dtype.type
|
|
3257
|
-
res = f(mat, axis=1).dtype.type
|
|
3258
|
-
assert_(res is tgt)
|
|
3259
|
-
# scalar case
|
|
3260
|
-
res = type(f(mat, axis=None))
|
|
3261
|
-
assert_(res is Decimal)
|
|
3262
|
-
|
|
3263
|
-
# integer types
|
|
3264
|
-
for f in self.funcs:
|
|
3265
|
-
for c in icodes:
|
|
3266
|
-
mat = np.eye(3, dtype=c)
|
|
3267
|
-
tgt = np.float64
|
|
3268
|
-
res = f(mat, axis=1).dtype.type
|
|
3269
|
-
assert_(res is tgt)
|
|
3270
|
-
# scalar case
|
|
3271
|
-
res = f(mat, axis=None).dtype.type
|
|
3272
|
-
assert_(res is tgt)
|
|
3273
|
-
|
|
3274
|
-
# mean for float types
|
|
3275
|
-
for f in [_mean]:
|
|
3276
|
-
for c in fcodes:
|
|
3277
|
-
mat = np.eye(3, dtype=c)
|
|
3278
|
-
tgt = mat.dtype.type
|
|
3279
|
-
res = f(mat, axis=1).dtype.type
|
|
3280
|
-
assert_(res is tgt)
|
|
3281
|
-
# scalar case
|
|
3282
|
-
res = f(mat, axis=None).dtype.type
|
|
3283
|
-
assert_(res is tgt)
|
|
3284
|
-
|
|
3285
|
-
# var, std for float types
|
|
3286
|
-
for f in [_var, _std]:
|
|
3287
|
-
for c in fcodes:
|
|
3288
|
-
mat = np.eye(3, dtype=c)
|
|
3289
|
-
# deal with complex types
|
|
3290
|
-
tgt = mat.real.dtype.type
|
|
3291
|
-
res = f(mat, axis=1).dtype.type
|
|
3292
|
-
assert_(res is tgt)
|
|
3293
|
-
# scalar case
|
|
3294
|
-
res = f(mat, axis=None).dtype.type
|
|
3295
|
-
assert_(res is tgt)
|
|
3296
|
-
|
|
3297
|
-
def test_dtype_from_dtype(self):
|
|
3298
|
-
icodes = np.typecodes['AllInteger']
|
|
3299
|
-
fcodes = np.typecodes['AllFloat']
|
|
3300
|
-
mat = np.eye(3)
|
|
3301
|
-
|
|
3302
|
-
# stats for integer types
|
|
3303
|
-
# fixme:
|
|
3304
|
-
# this needs definition as there are lots places along the line
|
|
3305
|
-
# where type casting may take place.
|
|
3306
|
-
#for f in self.funcs:
|
|
3307
|
-
#for c in icodes:
|
|
3308
|
-
#tgt = np.dtype(c).type
|
|
3309
|
-
#res = f(mat, axis=1, dtype=c).dtype.type
|
|
3310
|
-
#assert_(res is tgt)
|
|
3311
|
-
## scalar case
|
|
3312
|
-
#res = f(mat, axis=None, dtype=c).dtype.type
|
|
3313
|
-
#assert_(res is tgt)
|
|
3314
|
-
|
|
3315
|
-
# stats for float types
|
|
3316
|
-
for f in self.funcs:
|
|
3317
|
-
for c in fcodes:
|
|
3318
|
-
tgt = np.dtype(c).type
|
|
3319
|
-
res = f(mat, axis=1, dtype=c).dtype.type
|
|
3320
|
-
assert_(res is tgt)
|
|
3321
|
-
# scalar case
|
|
3322
|
-
res = f(mat, axis=None, dtype=c).dtype.type
|
|
3323
|
-
assert_(res is tgt)
|
|
3324
|
-
|
|
3325
|
-
def test_ddof(self):
|
|
3326
|
-
for f in [_var]:
|
|
3327
|
-
for ddof in range(3):
|
|
3328
|
-
dim = self.rmat.shape[1]
|
|
3329
|
-
tgt = f(self.rmat, axis=1) * dim
|
|
3330
|
-
res = f(self.rmat, axis=1, ddof=ddof) * (dim - ddof)
|
|
3331
|
-
for f in [_std]:
|
|
3332
|
-
for ddof in range(3):
|
|
3333
|
-
dim = self.rmat.shape[1]
|
|
3334
|
-
tgt = f(self.rmat, axis=1) * np.sqrt(dim)
|
|
3335
|
-
res = f(self.rmat, axis=1, ddof=ddof) * np.sqrt(dim - ddof)
|
|
3336
|
-
assert_almost_equal(res, tgt)
|
|
3337
|
-
assert_almost_equal(res, tgt)
|
|
3338
|
-
|
|
3339
|
-
def test_ddof_too_big(self):
|
|
3340
|
-
dim = self.rmat.shape[1]
|
|
3341
|
-
for f in [_var, _std]:
|
|
3342
|
-
for ddof in range(dim, dim + 2):
|
|
3343
|
-
with warnings.catch_warnings(record=True) as w:
|
|
3344
|
-
warnings.simplefilter('always')
|
|
3345
|
-
res = f(self.rmat, axis=1, ddof=ddof)
|
|
3346
|
-
assert_(not (res < 0).any())
|
|
3347
|
-
assert_(len(w) > 0)
|
|
3348
|
-
assert_(issubclass(w[0].category, RuntimeWarning))
|
|
3349
|
-
|
|
3350
|
-
def test_empty(self):
|
|
3351
|
-
A = np.zeros((0, 3))
|
|
3352
|
-
for f in self.funcs:
|
|
3353
|
-
for axis in [0, None]:
|
|
3354
|
-
with warnings.catch_warnings(record=True) as w:
|
|
3355
|
-
warnings.simplefilter('always')
|
|
3356
|
-
assert_(np.isnan(f(A, axis=axis)).all())
|
|
3357
|
-
assert_(len(w) > 0)
|
|
3358
|
-
assert_(issubclass(w[0].category, RuntimeWarning))
|
|
3359
|
-
for axis in [1]:
|
|
3360
|
-
with warnings.catch_warnings(record=True) as w:
|
|
3361
|
-
warnings.simplefilter('always')
|
|
3362
|
-
assert_equal(f(A, axis=axis), np.zeros([]))
|
|
3363
|
-
|
|
3364
|
-
def test_mean_values(self):
|
|
3365
|
-
for mat in [self.rmat, self.cmat, self.omat]:
|
|
3366
|
-
for axis in [0, 1]:
|
|
3367
|
-
tgt = mat.sum(axis=axis)
|
|
3368
|
-
res = _mean(mat, axis=axis) * mat.shape[axis]
|
|
3369
|
-
assert_almost_equal(res, tgt)
|
|
3370
|
-
for axis in [None]:
|
|
3371
|
-
tgt = mat.sum(axis=axis)
|
|
3372
|
-
res = _mean(mat, axis=axis) * np.prod(mat.shape)
|
|
3373
|
-
assert_almost_equal(res, tgt)
|
|
3374
|
-
|
|
3375
|
-
def test_var_values(self):
|
|
3376
|
-
for mat in [self.rmat, self.cmat, self.omat]:
|
|
3377
|
-
for axis in [0, 1, None]:
|
|
3378
|
-
msqr = _mean(mat * mat.conj(), axis=axis)
|
|
3379
|
-
mean = _mean(mat, axis=axis)
|
|
3380
|
-
tgt = msqr - mean * mean.conjugate()
|
|
3381
|
-
res = _var(mat, axis=axis)
|
|
3382
|
-
assert_almost_equal(res, tgt)
|
|
3383
|
-
|
|
3384
|
-
def test_std_values(self):
|
|
3385
|
-
for mat in [self.rmat, self.cmat, self.omat]:
|
|
3386
|
-
for axis in [0, 1, None]:
|
|
3387
|
-
tgt = np.sqrt(_var(mat, axis=axis))
|
|
3388
|
-
res = _std(mat, axis=axis)
|
|
3389
|
-
assert_almost_equal(res, tgt)
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
def test_subclass(self):
|
|
3393
|
-
class TestArray(np.ndarray):
|
|
3394
|
-
def __new__(cls, data, info):
|
|
3395
|
-
result = np.array(data)
|
|
3396
|
-
result = result.view(cls)
|
|
3397
|
-
result.info = info
|
|
3398
|
-
return result
|
|
3399
|
-
def __array_finalize__(self, obj):
|
|
3400
|
-
self.info = getattr(obj, "info", '')
|
|
3401
|
-
|
|
3402
|
-
dat = TestArray([[1, 2, 3, 4], [5, 6, 7, 8]], 'jubba')
|
|
3403
|
-
res = dat.mean(1)
|
|
3404
|
-
assert_(res.info == dat.info)
|
|
3405
|
-
res = dat.std(1)
|
|
3406
|
-
assert_(res.info == dat.info)
|
|
3407
|
-
res = dat.var(1)
|
|
3408
|
-
assert_(res.info == dat.info)
|
|
3409
|
-
|
|
3410
|
-
class TestDot(TestCase):
|
|
3411
|
-
def test_dot_2args(self):
|
|
3412
|
-
from numpy.core.multiarray import dot
|
|
3413
|
-
|
|
3414
|
-
a = np.array([[1, 2], [3, 4]], dtype=float)
|
|
3415
|
-
b = np.array([[1, 0], [1, 1]], dtype=float)
|
|
3416
|
-
c = np.array([[3, 2], [7, 4]], dtype=float)
|
|
3417
|
-
|
|
3418
|
-
d = dot(a, b)
|
|
3419
|
-
assert_allclose(c, d)
|
|
3420
|
-
|
|
3421
|
-
def test_dot_3args(self):
|
|
3422
|
-
from numpy.core.multiarray import dot
|
|
3423
|
-
|
|
3424
|
-
np.random.seed(22)
|
|
3425
|
-
f = np.random.random_sample((1024, 16))
|
|
3426
|
-
v = np.random.random_sample((16, 32))
|
|
3427
|
-
|
|
3428
|
-
r = np.empty((1024, 32))
|
|
3429
|
-
for i in range(12):
|
|
3430
|
-
dot(f, v, r)
|
|
3431
|
-
assert_equal(sys.getrefcount(r), 2)
|
|
3432
|
-
r2 = dot(f, v, out=None)
|
|
3433
|
-
assert_array_equal(r2, r)
|
|
3434
|
-
assert_(r is dot(f, v, out=r))
|
|
3435
|
-
|
|
3436
|
-
v = v[:, 0].copy() # v.shape == (16,)
|
|
3437
|
-
r = r[:, 0].copy() # r.shape == (1024,)
|
|
3438
|
-
r2 = dot(f, v)
|
|
3439
|
-
assert_(r is dot(f, v, r))
|
|
3440
|
-
assert_array_equal(r2, r)
|
|
3441
|
-
|
|
3442
|
-
def test_dot_3args_errors(self):
|
|
3443
|
-
from numpy.core.multiarray import dot
|
|
3444
|
-
|
|
3445
|
-
np.random.seed(22)
|
|
3446
|
-
f = np.random.random_sample((1024, 16))
|
|
3447
|
-
v = np.random.random_sample((16, 32))
|
|
3448
|
-
|
|
3449
|
-
r = np.empty((1024, 31))
|
|
3450
|
-
assert_raises(ValueError, dot, f, v, r)
|
|
3451
|
-
|
|
3452
|
-
r = np.empty((1024,))
|
|
3453
|
-
assert_raises(ValueError, dot, f, v, r)
|
|
3454
|
-
|
|
3455
|
-
r = np.empty((32,))
|
|
3456
|
-
assert_raises(ValueError, dot, f, v, r)
|
|
3457
|
-
|
|
3458
|
-
r = np.empty((32, 1024))
|
|
3459
|
-
assert_raises(ValueError, dot, f, v, r)
|
|
3460
|
-
assert_raises(ValueError, dot, f, v, r.T)
|
|
3461
|
-
|
|
3462
|
-
r = np.empty((1024, 64))
|
|
3463
|
-
assert_raises(ValueError, dot, f, v, r[:, ::2])
|
|
3464
|
-
assert_raises(ValueError, dot, f, v, r[:, :32])
|
|
3465
|
-
|
|
3466
|
-
r = np.empty((1024, 32), dtype=np.float32)
|
|
3467
|
-
assert_raises(ValueError, dot, f, v, r)
|
|
3468
|
-
|
|
3469
|
-
r = np.empty((1024, 32), dtype=int)
|
|
3470
|
-
assert_raises(ValueError, dot, f, v, r)
|
|
3471
|
-
|
|
3472
|
-
def test_dot_scalar_and_matrix_of_objects(self):
|
|
3473
|
-
# Ticket #2469
|
|
3474
|
-
arr = np.matrix([1, 2], dtype=object)
|
|
3475
|
-
desired = np.matrix([[3, 6]], dtype=object)
|
|
3476
|
-
assert_equal(np.dot(arr, 3), desired)
|
|
3477
|
-
assert_equal(np.dot(3, arr), desired)
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
class TestInner(TestCase):
|
|
3481
|
-
|
|
3482
|
-
def test_inner_scalar_and_matrix_of_objects(self):
|
|
3483
|
-
# Ticket #4482
|
|
3484
|
-
arr = np.matrix([1, 2], dtype=object)
|
|
3485
|
-
desired = np.matrix([[3, 6]], dtype=object)
|
|
3486
|
-
assert_equal(np.inner(arr, 3), desired)
|
|
3487
|
-
assert_equal(np.inner(3, arr), desired)
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
class TestSummarization(TestCase):
|
|
3491
|
-
def test_1d(self):
|
|
3492
|
-
A = np.arange(1001)
|
|
3493
|
-
strA = '[ 0 1 2 ..., 998 999 1000]'
|
|
3494
|
-
assert_(str(A) == strA)
|
|
3495
|
-
|
|
3496
|
-
reprA = 'array([ 0, 1, 2, ..., 998, 999, 1000])'
|
|
3497
|
-
assert_(repr(A) == reprA)
|
|
3498
|
-
|
|
3499
|
-
def test_2d(self):
|
|
3500
|
-
A = np.arange(1002).reshape(2, 501)
|
|
3501
|
-
strA = '[[ 0 1 2 ..., 498 499 500]\n' \
|
|
3502
|
-
' [ 501 502 503 ..., 999 1000 1001]]'
|
|
3503
|
-
assert_(str(A) == strA)
|
|
3504
|
-
|
|
3505
|
-
reprA = 'array([[ 0, 1, 2, ..., 498, 499, 500],\n' \
|
|
3506
|
-
' [ 501, 502, 503, ..., 999, 1000, 1001]])'
|
|
3507
|
-
assert_(repr(A) == reprA)
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
class TestChoose(TestCase):
|
|
3511
|
-
def setUp(self):
|
|
3512
|
-
self.x = 2*ones((3,), dtype=int)
|
|
3513
|
-
self.y = 3*ones((3,), dtype=int)
|
|
3514
|
-
self.x2 = 2*ones((2, 3), dtype=int)
|
|
3515
|
-
self.y2 = 3*ones((2, 3), dtype=int)
|
|
3516
|
-
self.ind = [0, 0, 1]
|
|
3517
|
-
|
|
3518
|
-
def test_basic(self):
|
|
3519
|
-
A = np.choose(self.ind, (self.x, self.y))
|
|
3520
|
-
assert_equal(A, [2, 2, 3])
|
|
3521
|
-
|
|
3522
|
-
def test_broadcast1(self):
|
|
3523
|
-
A = np.choose(self.ind, (self.x2, self.y2))
|
|
3524
|
-
assert_equal(A, [[2, 2, 3], [2, 2, 3]])
|
|
3525
|
-
|
|
3526
|
-
def test_broadcast2(self):
|
|
3527
|
-
A = np.choose(self.ind, (self.x, self.y2))
|
|
3528
|
-
assert_equal(A, [[2, 2, 3], [2, 2, 3]])
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
# TODO: test for multidimensional
|
|
3532
|
-
NEIGH_MODE = {'zero': 0, 'one': 1, 'constant': 2, 'circular': 3, 'mirror': 4}
|
|
3533
|
-
class TestNeighborhoodIter(TestCase):
|
|
3534
|
-
# Simple, 2d tests
|
|
3535
|
-
def _test_simple2d(self, dt):
|
|
3536
|
-
# Test zero and one padding for simple data type
|
|
3537
|
-
x = np.array([[0, 1], [2, 3]], dtype=dt)
|
|
3538
|
-
r = [np.array([[0, 0, 0], [0, 0, 1]], dtype=dt),
|
|
3539
|
-
np.array([[0, 0, 0], [0, 1, 0]], dtype=dt),
|
|
3540
|
-
np.array([[0, 0, 1], [0, 2, 3]], dtype=dt),
|
|
3541
|
-
np.array([[0, 1, 0], [2, 3, 0]], dtype=dt)]
|
|
3542
|
-
l = test_neighborhood_iterator(x, [-1, 0, -1, 1], x[0],
|
|
3543
|
-
NEIGH_MODE['zero'])
|
|
3544
|
-
assert_array_equal(l, r)
|
|
3545
|
-
|
|
3546
|
-
r = [np.array([[1, 1, 1], [1, 0, 1]], dtype=dt),
|
|
3547
|
-
np.array([[1, 1, 1], [0, 1, 1]], dtype=dt),
|
|
3548
|
-
np.array([[1, 0, 1], [1, 2, 3]], dtype=dt),
|
|
3549
|
-
np.array([[0, 1, 1], [2, 3, 1]], dtype=dt)]
|
|
3550
|
-
l = test_neighborhood_iterator(x, [-1, 0, -1, 1], x[0],
|
|
3551
|
-
NEIGH_MODE['one'])
|
|
3552
|
-
assert_array_equal(l, r)
|
|
3553
|
-
|
|
3554
|
-
r = [np.array([[4, 4, 4], [4, 0, 1]], dtype=dt),
|
|
3555
|
-
np.array([[4, 4, 4], [0, 1, 4]], dtype=dt),
|
|
3556
|
-
np.array([[4, 0, 1], [4, 2, 3]], dtype=dt),
|
|
3557
|
-
np.array([[0, 1, 4], [2, 3, 4]], dtype=dt)]
|
|
3558
|
-
l = test_neighborhood_iterator(x, [-1, 0, -1, 1], 4,
|
|
3559
|
-
NEIGH_MODE['constant'])
|
|
3560
|
-
assert_array_equal(l, r)
|
|
3561
|
-
|
|
3562
|
-
def test_simple2d(self):
|
|
3563
|
-
self._test_simple2d(np.float)
|
|
3564
|
-
|
|
3565
|
-
def test_simple2d_object(self):
|
|
3566
|
-
self._test_simple2d(Decimal)
|
|
3567
|
-
|
|
3568
|
-
def _test_mirror2d(self, dt):
|
|
3569
|
-
x = np.array([[0, 1], [2, 3]], dtype=dt)
|
|
3570
|
-
r = [np.array([[0, 0, 1], [0, 0, 1]], dtype=dt),
|
|
3571
|
-
np.array([[0, 1, 1], [0, 1, 1]], dtype=dt),
|
|
3572
|
-
np.array([[0, 0, 1], [2, 2, 3]], dtype=dt),
|
|
3573
|
-
np.array([[0, 1, 1], [2, 3, 3]], dtype=dt)]
|
|
3574
|
-
l = test_neighborhood_iterator(x, [-1, 0, -1, 1], x[0],
|
|
3575
|
-
NEIGH_MODE['mirror'])
|
|
3576
|
-
assert_array_equal(l, r)
|
|
3577
|
-
|
|
3578
|
-
def test_mirror2d(self):
|
|
3579
|
-
self._test_mirror2d(np.float)
|
|
3580
|
-
|
|
3581
|
-
def test_mirror2d_object(self):
|
|
3582
|
-
self._test_mirror2d(Decimal)
|
|
3583
|
-
|
|
3584
|
-
# Simple, 1d tests
|
|
3585
|
-
def _test_simple(self, dt):
|
|
3586
|
-
# Test padding with constant values
|
|
3587
|
-
x = np.linspace(1, 5, 5).astype(dt)
|
|
3588
|
-
r = [[0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 0]]
|
|
3589
|
-
l = test_neighborhood_iterator(x, [-1, 1], x[0], NEIGH_MODE['zero'])
|
|
3590
|
-
assert_array_equal(l, r)
|
|
3591
|
-
|
|
3592
|
-
r = [[1, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 1]]
|
|
3593
|
-
l = test_neighborhood_iterator(x, [-1, 1], x[0], NEIGH_MODE['one'])
|
|
3594
|
-
assert_array_equal(l, r)
|
|
3595
|
-
|
|
3596
|
-
r = [[x[4], 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, x[4]]]
|
|
3597
|
-
l = test_neighborhood_iterator(x, [-1, 1], x[4], NEIGH_MODE['constant'])
|
|
3598
|
-
assert_array_equal(l, r)
|
|
3599
|
-
|
|
3600
|
-
def test_simple_float(self):
|
|
3601
|
-
self._test_simple(np.float)
|
|
3602
|
-
|
|
3603
|
-
def test_simple_object(self):
|
|
3604
|
-
self._test_simple(Decimal)
|
|
3605
|
-
|
|
3606
|
-
# Test mirror modes
|
|
3607
|
-
def _test_mirror(self, dt):
|
|
3608
|
-
x = np.linspace(1, 5, 5).astype(dt)
|
|
3609
|
-
r = np.array([[2, 1, 1, 2, 3], [1, 1, 2, 3, 4], [1, 2, 3, 4, 5],
|
|
3610
|
-
[2, 3, 4, 5, 5], [3, 4, 5, 5, 4]], dtype=dt)
|
|
3611
|
-
l = test_neighborhood_iterator(x, [-2, 2], x[1], NEIGH_MODE['mirror'])
|
|
3612
|
-
self.assertTrue([i.dtype == dt for i in l])
|
|
3613
|
-
assert_array_equal(l, r)
|
|
3614
|
-
|
|
3615
|
-
def test_mirror(self):
|
|
3616
|
-
self._test_mirror(np.float)
|
|
3617
|
-
|
|
3618
|
-
def test_mirror_object(self):
|
|
3619
|
-
self._test_mirror(Decimal)
|
|
3620
|
-
|
|
3621
|
-
# Circular mode
|
|
3622
|
-
def _test_circular(self, dt):
|
|
3623
|
-
x = np.linspace(1, 5, 5).astype(dt)
|
|
3624
|
-
r = np.array([[4, 5, 1, 2, 3], [5, 1, 2, 3, 4], [1, 2, 3, 4, 5],
|
|
3625
|
-
[2, 3, 4, 5, 1], [3, 4, 5, 1, 2]], dtype=dt)
|
|
3626
|
-
l = test_neighborhood_iterator(x, [-2, 2], x[0], NEIGH_MODE['circular'])
|
|
3627
|
-
assert_array_equal(l, r)
|
|
3628
|
-
|
|
3629
|
-
def test_circular(self):
|
|
3630
|
-
self._test_circular(np.float)
|
|
3631
|
-
|
|
3632
|
-
def test_circular_object(self):
|
|
3633
|
-
self._test_circular(Decimal)
|
|
3634
|
-
|
|
3635
|
-
# Test stacking neighborhood iterators
|
|
3636
|
-
class TestStackedNeighborhoodIter(TestCase):
|
|
3637
|
-
# Simple, 1d test: stacking 2 constant-padded neigh iterators
|
|
3638
|
-
def test_simple_const(self):
|
|
3639
|
-
dt = np.float64
|
|
3640
|
-
# Test zero and one padding for simple data type
|
|
3641
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3642
|
-
r = [np.array([0], dtype=dt),
|
|
3643
|
-
np.array([0], dtype=dt),
|
|
3644
|
-
np.array([1], dtype=dt),
|
|
3645
|
-
np.array([2], dtype=dt),
|
|
3646
|
-
np.array([3], dtype=dt),
|
|
3647
|
-
np.array([0], dtype=dt),
|
|
3648
|
-
np.array([0], dtype=dt)]
|
|
3649
|
-
l = test_neighborhood_iterator_oob(x, [-2, 4], NEIGH_MODE['zero'],
|
|
3650
|
-
[0, 0], NEIGH_MODE['zero'])
|
|
3651
|
-
assert_array_equal(l, r)
|
|
3652
|
-
|
|
3653
|
-
r = [np.array([1, 0, 1], dtype=dt),
|
|
3654
|
-
np.array([0, 1, 2], dtype=dt),
|
|
3655
|
-
np.array([1, 2, 3], dtype=dt),
|
|
3656
|
-
np.array([2, 3, 0], dtype=dt),
|
|
3657
|
-
np.array([3, 0, 1], dtype=dt)]
|
|
3658
|
-
l = test_neighborhood_iterator_oob(x, [-1, 3], NEIGH_MODE['zero'],
|
|
3659
|
-
[-1, 1], NEIGH_MODE['one'])
|
|
3660
|
-
assert_array_equal(l, r)
|
|
3661
|
-
|
|
3662
|
-
# 2nd simple, 1d test: stacking 2 neigh iterators, mixing const padding and
|
|
3663
|
-
# mirror padding
|
|
3664
|
-
def test_simple_mirror(self):
|
|
3665
|
-
dt = np.float64
|
|
3666
|
-
# Stacking zero on top of mirror
|
|
3667
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3668
|
-
r = [np.array([0, 1, 1], dtype=dt),
|
|
3669
|
-
np.array([1, 1, 2], dtype=dt),
|
|
3670
|
-
np.array([1, 2, 3], dtype=dt),
|
|
3671
|
-
np.array([2, 3, 3], dtype=dt),
|
|
3672
|
-
np.array([3, 3, 0], dtype=dt)]
|
|
3673
|
-
l = test_neighborhood_iterator_oob(x, [-1, 3], NEIGH_MODE['mirror'],
|
|
3674
|
-
[-1, 1], NEIGH_MODE['zero'])
|
|
3675
|
-
assert_array_equal(l, r)
|
|
3676
|
-
|
|
3677
|
-
# Stacking mirror on top of zero
|
|
3678
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3679
|
-
r = [np.array([1, 0, 0], dtype=dt),
|
|
3680
|
-
np.array([0, 0, 1], dtype=dt),
|
|
3681
|
-
np.array([0, 1, 2], dtype=dt),
|
|
3682
|
-
np.array([1, 2, 3], dtype=dt),
|
|
3683
|
-
np.array([2, 3, 0], dtype=dt)]
|
|
3684
|
-
l = test_neighborhood_iterator_oob(x, [-1, 3], NEIGH_MODE['zero'],
|
|
3685
|
-
[-2, 0], NEIGH_MODE['mirror'])
|
|
3686
|
-
assert_array_equal(l, r)
|
|
3687
|
-
|
|
3688
|
-
# Stacking mirror on top of zero: 2nd
|
|
3689
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3690
|
-
r = [np.array([0, 1, 2], dtype=dt),
|
|
3691
|
-
np.array([1, 2, 3], dtype=dt),
|
|
3692
|
-
np.array([2, 3, 0], dtype=dt),
|
|
3693
|
-
np.array([3, 0, 0], dtype=dt),
|
|
3694
|
-
np.array([0, 0, 3], dtype=dt)]
|
|
3695
|
-
l = test_neighborhood_iterator_oob(x, [-1, 3], NEIGH_MODE['zero'],
|
|
3696
|
-
[0, 2], NEIGH_MODE['mirror'])
|
|
3697
|
-
assert_array_equal(l, r)
|
|
3698
|
-
|
|
3699
|
-
# Stacking mirror on top of zero: 3rd
|
|
3700
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3701
|
-
r = [np.array([1, 0, 0, 1, 2], dtype=dt),
|
|
3702
|
-
np.array([0, 0, 1, 2, 3], dtype=dt),
|
|
3703
|
-
np.array([0, 1, 2, 3, 0], dtype=dt),
|
|
3704
|
-
np.array([1, 2, 3, 0, 0], dtype=dt),
|
|
3705
|
-
np.array([2, 3, 0, 0, 3], dtype=dt)]
|
|
3706
|
-
l = test_neighborhood_iterator_oob(x, [-1, 3], NEIGH_MODE['zero'],
|
|
3707
|
-
[-2, 2], NEIGH_MODE['mirror'])
|
|
3708
|
-
assert_array_equal(l, r)
|
|
3709
|
-
|
|
3710
|
-
# 3rd simple, 1d test: stacking 2 neigh iterators, mixing const padding and
|
|
3711
|
-
# circular padding
|
|
3712
|
-
def test_simple_circular(self):
|
|
3713
|
-
dt = np.float64
|
|
3714
|
-
# Stacking zero on top of mirror
|
|
3715
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3716
|
-
r = [np.array([0, 3, 1], dtype=dt),
|
|
3717
|
-
np.array([3, 1, 2], dtype=dt),
|
|
3718
|
-
np.array([1, 2, 3], dtype=dt),
|
|
3719
|
-
np.array([2, 3, 1], dtype=dt),
|
|
3720
|
-
np.array([3, 1, 0], dtype=dt)]
|
|
3721
|
-
l = test_neighborhood_iterator_oob(x, [-1, 3], NEIGH_MODE['circular'],
|
|
3722
|
-
[-1, 1], NEIGH_MODE['zero'])
|
|
3723
|
-
assert_array_equal(l, r)
|
|
3724
|
-
|
|
3725
|
-
# Stacking mirror on top of zero
|
|
3726
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3727
|
-
r = [np.array([3, 0, 0], dtype=dt),
|
|
3728
|
-
np.array([0, 0, 1], dtype=dt),
|
|
3729
|
-
np.array([0, 1, 2], dtype=dt),
|
|
3730
|
-
np.array([1, 2, 3], dtype=dt),
|
|
3731
|
-
np.array([2, 3, 0], dtype=dt)]
|
|
3732
|
-
l = test_neighborhood_iterator_oob(x, [-1, 3], NEIGH_MODE['zero'],
|
|
3733
|
-
[-2, 0], NEIGH_MODE['circular'])
|
|
3734
|
-
assert_array_equal(l, r)
|
|
3735
|
-
|
|
3736
|
-
# Stacking mirror on top of zero: 2nd
|
|
3737
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3738
|
-
r = [np.array([0, 1, 2], dtype=dt),
|
|
3739
|
-
np.array([1, 2, 3], dtype=dt),
|
|
3740
|
-
np.array([2, 3, 0], dtype=dt),
|
|
3741
|
-
np.array([3, 0, 0], dtype=dt),
|
|
3742
|
-
np.array([0, 0, 1], dtype=dt)]
|
|
3743
|
-
l = test_neighborhood_iterator_oob(x, [-1, 3], NEIGH_MODE['zero'],
|
|
3744
|
-
[0, 2], NEIGH_MODE['circular'])
|
|
3745
|
-
assert_array_equal(l, r)
|
|
3746
|
-
|
|
3747
|
-
# Stacking mirror on top of zero: 3rd
|
|
3748
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3749
|
-
r = [np.array([3, 0, 0, 1, 2], dtype=dt),
|
|
3750
|
-
np.array([0, 0, 1, 2, 3], dtype=dt),
|
|
3751
|
-
np.array([0, 1, 2, 3, 0], dtype=dt),
|
|
3752
|
-
np.array([1, 2, 3, 0, 0], dtype=dt),
|
|
3753
|
-
np.array([2, 3, 0, 0, 1], dtype=dt)]
|
|
3754
|
-
l = test_neighborhood_iterator_oob(x, [-1, 3], NEIGH_MODE['zero'],
|
|
3755
|
-
[-2, 2], NEIGH_MODE['circular'])
|
|
3756
|
-
assert_array_equal(l, r)
|
|
3757
|
-
|
|
3758
|
-
# 4th simple, 1d test: stacking 2 neigh iterators, but with lower iterator
|
|
3759
|
-
# being strictly within the array
|
|
3760
|
-
def test_simple_strict_within(self):
|
|
3761
|
-
dt = np.float64
|
|
3762
|
-
# Stacking zero on top of zero, first neighborhood strictly inside the
|
|
3763
|
-
# array
|
|
3764
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3765
|
-
r = [np.array([1, 2, 3, 0], dtype=dt)]
|
|
3766
|
-
l = test_neighborhood_iterator_oob(x, [1, 1], NEIGH_MODE['zero'],
|
|
3767
|
-
[-1, 2], NEIGH_MODE['zero'])
|
|
3768
|
-
assert_array_equal(l, r)
|
|
3769
|
-
|
|
3770
|
-
# Stacking mirror on top of zero, first neighborhood strictly inside the
|
|
3771
|
-
# array
|
|
3772
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3773
|
-
r = [np.array([1, 2, 3, 3], dtype=dt)]
|
|
3774
|
-
l = test_neighborhood_iterator_oob(x, [1, 1], NEIGH_MODE['zero'],
|
|
3775
|
-
[-1, 2], NEIGH_MODE['mirror'])
|
|
3776
|
-
assert_array_equal(l, r)
|
|
3777
|
-
|
|
3778
|
-
# Stacking mirror on top of zero, first neighborhood strictly inside the
|
|
3779
|
-
# array
|
|
3780
|
-
x = np.array([1, 2, 3], dtype=dt)
|
|
3781
|
-
r = [np.array([1, 2, 3, 1], dtype=dt)]
|
|
3782
|
-
l = test_neighborhood_iterator_oob(x, [1, 1], NEIGH_MODE['zero'],
|
|
3783
|
-
[-1, 2], NEIGH_MODE['circular'])
|
|
3784
|
-
assert_array_equal(l, r)
|
|
3785
|
-
|
|
3786
|
-
class TestWarnings(object):
|
|
3787
|
-
|
|
3788
|
-
def test_complex_warning(self):
|
|
3789
|
-
x = np.array([1, 2])
|
|
3790
|
-
y = np.array([1-2j, 1+2j])
|
|
3791
|
-
|
|
3792
|
-
with warnings.catch_warnings():
|
|
3793
|
-
warnings.simplefilter("error", np.ComplexWarning)
|
|
3794
|
-
assert_raises(np.ComplexWarning, x.__setitem__, slice(None), y)
|
|
3795
|
-
assert_equal(x, [1, 2])
|
|
3796
|
-
|
|
3797
|
-
class TestMinScalarType(object):
|
|
3798
|
-
|
|
3799
|
-
def test_usigned_shortshort(self):
|
|
3800
|
-
dt = np.min_scalar_type(2**8-1)
|
|
3801
|
-
wanted = np.dtype('uint8')
|
|
3802
|
-
assert_equal(wanted, dt)
|
|
3803
|
-
|
|
3804
|
-
def test_usigned_short(self):
|
|
3805
|
-
dt = np.min_scalar_type(2**16-1)
|
|
3806
|
-
wanted = np.dtype('uint16')
|
|
3807
|
-
assert_equal(wanted, dt)
|
|
3808
|
-
|
|
3809
|
-
def test_usigned_int(self):
|
|
3810
|
-
dt = np.min_scalar_type(2**32-1)
|
|
3811
|
-
wanted = np.dtype('uint32')
|
|
3812
|
-
assert_equal(wanted, dt)
|
|
3813
|
-
|
|
3814
|
-
def test_usigned_longlong(self):
|
|
3815
|
-
dt = np.min_scalar_type(2**63-1)
|
|
3816
|
-
wanted = np.dtype('uint64')
|
|
3817
|
-
assert_equal(wanted, dt)
|
|
3818
|
-
|
|
3819
|
-
def test_object(self):
|
|
3820
|
-
dt = np.min_scalar_type(2**64)
|
|
3821
|
-
wanted = np.dtype('O')
|
|
3822
|
-
assert_equal(wanted, dt)
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
if sys.version_info[:2] == (2, 6):
|
|
3826
|
-
from numpy.core.multiarray import memorysimpleview as memoryview
|
|
3827
|
-
|
|
3828
|
-
from numpy.core._internal import _dtype_from_pep3118
|
|
3829
|
-
|
|
3830
|
-
class TestPEP3118Dtype(object):
|
|
3831
|
-
def _check(self, spec, wanted):
|
|
3832
|
-
dt = np.dtype(wanted)
|
|
3833
|
-
if isinstance(wanted, list) and isinstance(wanted[-1], tuple):
|
|
3834
|
-
if wanted[-1][0] == '':
|
|
3835
|
-
names = list(dt.names)
|
|
3836
|
-
names[-1] = ''
|
|
3837
|
-
dt.names = tuple(names)
|
|
3838
|
-
assert_equal(_dtype_from_pep3118(spec), dt,
|
|
3839
|
-
err_msg="spec %r != dtype %r" % (spec, wanted))
|
|
3840
|
-
|
|
3841
|
-
def test_native_padding(self):
|
|
3842
|
-
align = np.dtype('i').alignment
|
|
3843
|
-
for j in range(8):
|
|
3844
|
-
if j == 0:
|
|
3845
|
-
s = 'bi'
|
|
3846
|
-
else:
|
|
3847
|
-
s = 'b%dxi' % j
|
|
3848
|
-
self._check('@'+s, {'f0': ('i1', 0),
|
|
3849
|
-
'f1': ('i', align*(1 + j//align))})
|
|
3850
|
-
self._check('='+s, {'f0': ('i1', 0),
|
|
3851
|
-
'f1': ('i', 1+j)})
|
|
3852
|
-
|
|
3853
|
-
def test_native_padding_2(self):
|
|
3854
|
-
# Native padding should work also for structs and sub-arrays
|
|
3855
|
-
self._check('x3T{xi}', {'f0': (({'f0': ('i', 4)}, (3,)), 4)})
|
|
3856
|
-
self._check('^x3T{xi}', {'f0': (({'f0': ('i', 1)}, (3,)), 1)})
|
|
3857
|
-
|
|
3858
|
-
def test_trailing_padding(self):
|
|
3859
|
-
# Trailing padding should be included, *and*, the item size
|
|
3860
|
-
# should match the alignment if in aligned mode
|
|
3861
|
-
align = np.dtype('i').alignment
|
|
3862
|
-
def VV(n):
|
|
3863
|
-
return 'V%d' % (align*(1 + (n-1)//align))
|
|
3864
|
-
|
|
3865
|
-
self._check('ix', [('f0', 'i'), ('', VV(1))])
|
|
3866
|
-
self._check('ixx', [('f0', 'i'), ('', VV(2))])
|
|
3867
|
-
self._check('ixxx', [('f0', 'i'), ('', VV(3))])
|
|
3868
|
-
self._check('ixxxx', [('f0', 'i'), ('', VV(4))])
|
|
3869
|
-
self._check('i7x', [('f0', 'i'), ('', VV(7))])
|
|
3870
|
-
|
|
3871
|
-
self._check('^ix', [('f0', 'i'), ('', 'V1')])
|
|
3872
|
-
self._check('^ixx', [('f0', 'i'), ('', 'V2')])
|
|
3873
|
-
self._check('^ixxx', [('f0', 'i'), ('', 'V3')])
|
|
3874
|
-
self._check('^ixxxx', [('f0', 'i'), ('', 'V4')])
|
|
3875
|
-
self._check('^i7x', [('f0', 'i'), ('', 'V7')])
|
|
3876
|
-
|
|
3877
|
-
def test_native_padding_3(self):
|
|
3878
|
-
dt = np.dtype(
|
|
3879
|
-
[('a', 'b'), ('b', 'i'),
|
|
3880
|
-
('sub', np.dtype('b,i')), ('c', 'i')],
|
|
3881
|
-
align=True)
|
|
3882
|
-
self._check("T{b:a:xxxi:b:T{b:f0:=i:f1:}:sub:xxxi:c:}", dt)
|
|
3883
|
-
|
|
3884
|
-
dt = np.dtype(
|
|
3885
|
-
[('a', 'b'), ('b', 'i'), ('c', 'b'), ('d', 'b'),
|
|
3886
|
-
('e', 'b'), ('sub', np.dtype('b,i', align=True))])
|
|
3887
|
-
self._check("T{b:a:=i:b:b:c:b:d:b:e:T{b:f0:xxxi:f1:}:sub:}", dt)
|
|
3888
|
-
|
|
3889
|
-
def test_padding_with_array_inside_struct(self):
|
|
3890
|
-
dt = np.dtype(
|
|
3891
|
-
[('a', 'b'), ('b', 'i'), ('c', 'b', (3,)),
|
|
3892
|
-
('d', 'i')],
|
|
3893
|
-
align=True)
|
|
3894
|
-
self._check("T{b:a:xxxi:b:3b:c:xi:d:}", dt)
|
|
3895
|
-
|
|
3896
|
-
def test_byteorder_inside_struct(self):
|
|
3897
|
-
# The byte order after @T{=i} should be '=', not '@'.
|
|
3898
|
-
# Check this by noting the absence of native alignment.
|
|
3899
|
-
self._check('@T{^i}xi', {'f0': ({'f0': ('i', 0)}, 0),
|
|
3900
|
-
'f1': ('i', 5)})
|
|
3901
|
-
|
|
3902
|
-
def test_intra_padding(self):
|
|
3903
|
-
# Natively aligned sub-arrays may require some internal padding
|
|
3904
|
-
align = np.dtype('i').alignment
|
|
3905
|
-
def VV(n):
|
|
3906
|
-
return 'V%d' % (align*(1 + (n-1)//align))
|
|
3907
|
-
|
|
3908
|
-
self._check('(3)T{ix}', ({'f0': ('i', 0), '': (VV(1), 4)}, (3,)))
|
|
3909
|
-
|
|
3910
|
-
class TestNewBufferProtocol(object):
|
|
3911
|
-
def _check_roundtrip(self, obj):
|
|
3912
|
-
obj = np.asarray(obj)
|
|
3913
|
-
x = memoryview(obj)
|
|
3914
|
-
y = np.asarray(x)
|
|
3915
|
-
y2 = np.array(x)
|
|
3916
|
-
assert_(not y.flags.owndata)
|
|
3917
|
-
assert_(y2.flags.owndata)
|
|
3918
|
-
|
|
3919
|
-
assert_equal(y.dtype, obj.dtype)
|
|
3920
|
-
assert_equal(y.shape, obj.shape)
|
|
3921
|
-
assert_array_equal(obj, y)
|
|
3922
|
-
|
|
3923
|
-
assert_equal(y2.dtype, obj.dtype)
|
|
3924
|
-
assert_equal(y2.shape, obj.shape)
|
|
3925
|
-
assert_array_equal(obj, y2)
|
|
3926
|
-
|
|
3927
|
-
def test_roundtrip(self):
|
|
3928
|
-
x = np.array([1, 2, 3, 4, 5], dtype='i4')
|
|
3929
|
-
self._check_roundtrip(x)
|
|
3930
|
-
|
|
3931
|
-
x = np.array([[1, 2], [3, 4]], dtype=np.float64)
|
|
3932
|
-
self._check_roundtrip(x)
|
|
3933
|
-
|
|
3934
|
-
x = np.zeros((3, 3, 3), dtype=np.float32)[:, 0,:]
|
|
3935
|
-
self._check_roundtrip(x)
|
|
3936
|
-
|
|
3937
|
-
dt = [('a', 'b'),
|
|
3938
|
-
('b', 'h'),
|
|
3939
|
-
('c', 'i'),
|
|
3940
|
-
('d', 'l'),
|
|
3941
|
-
('dx', 'q'),
|
|
3942
|
-
('e', 'B'),
|
|
3943
|
-
('f', 'H'),
|
|
3944
|
-
('g', 'I'),
|
|
3945
|
-
('h', 'L'),
|
|
3946
|
-
('hx', 'Q'),
|
|
3947
|
-
('i', np.single),
|
|
3948
|
-
('j', np.double),
|
|
3949
|
-
('k', np.longdouble),
|
|
3950
|
-
('ix', np.csingle),
|
|
3951
|
-
('jx', np.cdouble),
|
|
3952
|
-
('kx', np.clongdouble),
|
|
3953
|
-
('l', 'S4'),
|
|
3954
|
-
('m', 'U4'),
|
|
3955
|
-
('n', 'V3'),
|
|
3956
|
-
('o', '?'),
|
|
3957
|
-
('p', np.half),
|
|
3958
|
-
]
|
|
3959
|
-
x = np.array(
|
|
3960
|
-
[(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
3961
|
-
asbytes('aaaa'), 'bbbb', asbytes('xxx'), True, 1.0)],
|
|
3962
|
-
dtype=dt)
|
|
3963
|
-
self._check_roundtrip(x)
|
|
3964
|
-
|
|
3965
|
-
x = np.array(([[1, 2], [3, 4]],), dtype=[('a', (int, (2, 2)))])
|
|
3966
|
-
self._check_roundtrip(x)
|
|
3967
|
-
|
|
3968
|
-
x = np.array([1, 2, 3], dtype='>i2')
|
|
3969
|
-
self._check_roundtrip(x)
|
|
3970
|
-
|
|
3971
|
-
x = np.array([1, 2, 3], dtype='<i2')
|
|
3972
|
-
self._check_roundtrip(x)
|
|
3973
|
-
|
|
3974
|
-
x = np.array([1, 2, 3], dtype='>i4')
|
|
3975
|
-
self._check_roundtrip(x)
|
|
3976
|
-
|
|
3977
|
-
x = np.array([1, 2, 3], dtype='<i4')
|
|
3978
|
-
self._check_roundtrip(x)
|
|
3979
|
-
|
|
3980
|
-
# check long long can be represented as non-native
|
|
3981
|
-
x = np.array([1, 2, 3], dtype='>q')
|
|
3982
|
-
self._check_roundtrip(x)
|
|
3983
|
-
|
|
3984
|
-
# Native-only data types can be passed through the buffer interface
|
|
3985
|
-
# only in native byte order
|
|
3986
|
-
if sys.byteorder == 'little':
|
|
3987
|
-
x = np.array([1, 2, 3], dtype='>g')
|
|
3988
|
-
assert_raises(ValueError, self._check_roundtrip, x)
|
|
3989
|
-
x = np.array([1, 2, 3], dtype='<g')
|
|
3990
|
-
self._check_roundtrip(x)
|
|
3991
|
-
else:
|
|
3992
|
-
x = np.array([1, 2, 3], dtype='>g')
|
|
3993
|
-
self._check_roundtrip(x)
|
|
3994
|
-
x = np.array([1, 2, 3], dtype='<g')
|
|
3995
|
-
assert_raises(ValueError, self._check_roundtrip, x)
|
|
3996
|
-
|
|
3997
|
-
def test_roundtrip_half(self):
|
|
3998
|
-
half_list = [
|
|
3999
|
-
1.0,
|
|
4000
|
-
-2.0,
|
|
4001
|
-
6.5504 * 10**4, # (max half precision)
|
|
4002
|
-
2**-14, # ~= 6.10352 * 10**-5 (minimum positive normal)
|
|
4003
|
-
2**-24, # ~= 5.96046 * 10**-8 (minimum strictly positive subnormal)
|
|
4004
|
-
0.0,
|
|
4005
|
-
-0.0,
|
|
4006
|
-
float('+inf'),
|
|
4007
|
-
float('-inf'),
|
|
4008
|
-
0.333251953125, # ~= 1/3
|
|
4009
|
-
]
|
|
4010
|
-
|
|
4011
|
-
x = np.array(half_list, dtype='>e')
|
|
4012
|
-
self._check_roundtrip(x)
|
|
4013
|
-
x = np.array(half_list, dtype='<e')
|
|
4014
|
-
self._check_roundtrip(x)
|
|
4015
|
-
|
|
4016
|
-
def test_roundtrip_single_types(self):
|
|
4017
|
-
for typ in np.typeDict.values():
|
|
4018
|
-
dtype = np.dtype(typ)
|
|
4019
|
-
|
|
4020
|
-
if dtype.char in 'Mm':
|
|
4021
|
-
# datetimes cannot be used in buffers
|
|
4022
|
-
continue
|
|
4023
|
-
if dtype.char == 'V':
|
|
4024
|
-
# skip void
|
|
4025
|
-
continue
|
|
4026
|
-
|
|
4027
|
-
x = np.zeros(4, dtype=dtype)
|
|
4028
|
-
self._check_roundtrip(x)
|
|
4029
|
-
|
|
4030
|
-
if dtype.char not in 'qQgG':
|
|
4031
|
-
dt = dtype.newbyteorder('<')
|
|
4032
|
-
x = np.zeros(4, dtype=dt)
|
|
4033
|
-
self._check_roundtrip(x)
|
|
4034
|
-
|
|
4035
|
-
dt = dtype.newbyteorder('>')
|
|
4036
|
-
x = np.zeros(4, dtype=dt)
|
|
4037
|
-
self._check_roundtrip(x)
|
|
4038
|
-
|
|
4039
|
-
def test_roundtrip_scalar(self):
|
|
4040
|
-
# Issue #4015.
|
|
4041
|
-
self._check_roundtrip(0)
|
|
4042
|
-
|
|
4043
|
-
def test_export_simple_1d(self):
|
|
4044
|
-
x = np.array([1, 2, 3, 4, 5], dtype='i')
|
|
4045
|
-
y = memoryview(x)
|
|
4046
|
-
assert_equal(y.format, 'i')
|
|
4047
|
-
assert_equal(y.shape, (5,))
|
|
4048
|
-
assert_equal(y.ndim, 1)
|
|
4049
|
-
assert_equal(y.strides, (4,))
|
|
4050
|
-
assert_equal(y.suboffsets, EMPTY)
|
|
4051
|
-
assert_equal(y.itemsize, 4)
|
|
4052
|
-
|
|
4053
|
-
def test_export_simple_nd(self):
|
|
4054
|
-
x = np.array([[1, 2], [3, 4]], dtype=np.float64)
|
|
4055
|
-
y = memoryview(x)
|
|
4056
|
-
assert_equal(y.format, 'd')
|
|
4057
|
-
assert_equal(y.shape, (2, 2))
|
|
4058
|
-
assert_equal(y.ndim, 2)
|
|
4059
|
-
assert_equal(y.strides, (16, 8))
|
|
4060
|
-
assert_equal(y.suboffsets, EMPTY)
|
|
4061
|
-
assert_equal(y.itemsize, 8)
|
|
4062
|
-
|
|
4063
|
-
def test_export_discontiguous(self):
|
|
4064
|
-
x = np.zeros((3, 3, 3), dtype=np.float32)[:, 0,:]
|
|
4065
|
-
y = memoryview(x)
|
|
4066
|
-
assert_equal(y.format, 'f')
|
|
4067
|
-
assert_equal(y.shape, (3, 3))
|
|
4068
|
-
assert_equal(y.ndim, 2)
|
|
4069
|
-
assert_equal(y.strides, (36, 4))
|
|
4070
|
-
assert_equal(y.suboffsets, EMPTY)
|
|
4071
|
-
assert_equal(y.itemsize, 4)
|
|
4072
|
-
|
|
4073
|
-
def test_export_record(self):
|
|
4074
|
-
dt = [('a', 'b'),
|
|
4075
|
-
('b', 'h'),
|
|
4076
|
-
('c', 'i'),
|
|
4077
|
-
('d', 'l'),
|
|
4078
|
-
('dx', 'q'),
|
|
4079
|
-
('e', 'B'),
|
|
4080
|
-
('f', 'H'),
|
|
4081
|
-
('g', 'I'),
|
|
4082
|
-
('h', 'L'),
|
|
4083
|
-
('hx', 'Q'),
|
|
4084
|
-
('i', np.single),
|
|
4085
|
-
('j', np.double),
|
|
4086
|
-
('k', np.longdouble),
|
|
4087
|
-
('ix', np.csingle),
|
|
4088
|
-
('jx', np.cdouble),
|
|
4089
|
-
('kx', np.clongdouble),
|
|
4090
|
-
('l', 'S4'),
|
|
4091
|
-
('m', 'U4'),
|
|
4092
|
-
('n', 'V3'),
|
|
4093
|
-
('o', '?'),
|
|
4094
|
-
('p', np.half),
|
|
4095
|
-
]
|
|
4096
|
-
x = np.array(
|
|
4097
|
-
[(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
4098
|
-
asbytes('aaaa'), 'bbbb', asbytes(' '), True, 1.0)],
|
|
4099
|
-
dtype=dt)
|
|
4100
|
-
y = memoryview(x)
|
|
4101
|
-
assert_equal(y.shape, (1,))
|
|
4102
|
-
assert_equal(y.ndim, 1)
|
|
4103
|
-
assert_equal(y.suboffsets, EMPTY)
|
|
4104
|
-
|
|
4105
|
-
sz = sum([dtype(b).itemsize for a, b in dt])
|
|
4106
|
-
if dtype('l').itemsize == 4:
|
|
4107
|
-
assert_equal(y.format, 'T{b:a:=h:b:i:c:l:d:q:dx:B:e:@H:f:=I:g:L:h:Q:hx:f:i:d:j:^g:k:=Zf:ix:Zd:jx:^Zg:kx:4s:l:=4w:m:3x:n:?:o:@e:p:}')
|
|
4108
|
-
else:
|
|
4109
|
-
assert_equal(y.format, 'T{b:a:=h:b:i:c:q:d:q:dx:B:e:@H:f:=I:g:Q:h:Q:hx:f:i:d:j:^g:k:=Zf:ix:Zd:jx:^Zg:kx:4s:l:=4w:m:3x:n:?:o:@e:p:}')
|
|
4110
|
-
# Cannot test if NPY_RELAXED_STRIDES_CHECKING changes the strides
|
|
4111
|
-
if not (np.ones(1).strides[0] == np.iinfo(np.intp).max):
|
|
4112
|
-
assert_equal(y.strides, (sz,))
|
|
4113
|
-
assert_equal(y.itemsize, sz)
|
|
4114
|
-
|
|
4115
|
-
def test_export_subarray(self):
|
|
4116
|
-
x = np.array(([[1, 2], [3, 4]],), dtype=[('a', ('i', (2, 2)))])
|
|
4117
|
-
y = memoryview(x)
|
|
4118
|
-
assert_equal(y.format, 'T{(2,2)i:a:}')
|
|
4119
|
-
assert_equal(y.shape, EMPTY)
|
|
4120
|
-
assert_equal(y.ndim, 0)
|
|
4121
|
-
assert_equal(y.strides, EMPTY)
|
|
4122
|
-
assert_equal(y.suboffsets, EMPTY)
|
|
4123
|
-
assert_equal(y.itemsize, 16)
|
|
4124
|
-
|
|
4125
|
-
def test_export_endian(self):
|
|
4126
|
-
x = np.array([1, 2, 3], dtype='>i')
|
|
4127
|
-
y = memoryview(x)
|
|
4128
|
-
if sys.byteorder == 'little':
|
|
4129
|
-
assert_equal(y.format, '>i')
|
|
4130
|
-
else:
|
|
4131
|
-
assert_equal(y.format, 'i')
|
|
4132
|
-
|
|
4133
|
-
x = np.array([1, 2, 3], dtype='<i')
|
|
4134
|
-
y = memoryview(x)
|
|
4135
|
-
if sys.byteorder == 'little':
|
|
4136
|
-
assert_equal(y.format, 'i')
|
|
4137
|
-
else:
|
|
4138
|
-
assert_equal(y.format, '<i')
|
|
4139
|
-
|
|
4140
|
-
def test_export_flags(self):
|
|
4141
|
-
# Check SIMPLE flag, see also gh-3613 (exception should be BufferError)
|
|
4142
|
-
assert_raises(ValueError, get_buffer_info, np.arange(5)[::2], ('SIMPLE',))
|
|
4143
|
-
|
|
4144
|
-
def test_padding(self):
|
|
4145
|
-
for j in range(8):
|
|
4146
|
-
x = np.array([(1,), (2,)], dtype={'f0': (int, j)})
|
|
4147
|
-
self._check_roundtrip(x)
|
|
4148
|
-
|
|
4149
|
-
def test_reference_leak(self):
|
|
4150
|
-
count_1 = sys.getrefcount(np.core._internal)
|
|
4151
|
-
a = np.zeros(4)
|
|
4152
|
-
b = memoryview(a)
|
|
4153
|
-
c = np.asarray(b)
|
|
4154
|
-
count_2 = sys.getrefcount(np.core._internal)
|
|
4155
|
-
assert_equal(count_1, count_2)
|
|
4156
|
-
|
|
4157
|
-
def test_padded_struct_array(self):
|
|
4158
|
-
dt1 = np.dtype(
|
|
4159
|
-
[('a', 'b'), ('b', 'i'), ('sub', np.dtype('b,i')), ('c', 'i')],
|
|
4160
|
-
align=True)
|
|
4161
|
-
x1 = np.arange(dt1.itemsize, dtype=np.int8).view(dt1)
|
|
4162
|
-
self._check_roundtrip(x1)
|
|
4163
|
-
|
|
4164
|
-
dt2 = np.dtype(
|
|
4165
|
-
[('a', 'b'), ('b', 'i'), ('c', 'b', (3,)), ('d', 'i')],
|
|
4166
|
-
align=True)
|
|
4167
|
-
x2 = np.arange(dt2.itemsize, dtype=np.int8).view(dt2)
|
|
4168
|
-
self._check_roundtrip(x2)
|
|
4169
|
-
|
|
4170
|
-
dt3 = np.dtype(
|
|
4171
|
-
[('a', 'b'), ('b', 'i'), ('c', 'b'), ('d', 'b'),
|
|
4172
|
-
('e', 'b'), ('sub', np.dtype('b,i', align=True))])
|
|
4173
|
-
x3 = np.arange(dt3.itemsize, dtype=np.int8).view(dt3)
|
|
4174
|
-
self._check_roundtrip(x3)
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
class TestArrayAttributeDeletion(object):
|
|
4178
|
-
|
|
4179
|
-
def test_multiarray_writable_attributes_deletion(self):
|
|
4180
|
-
"""ticket #2046, should not seqfault, raise AttributeError"""
|
|
4181
|
-
a = np.ones(2)
|
|
4182
|
-
attr = ['shape', 'strides', 'data', 'dtype', 'real', 'imag', 'flat']
|
|
4183
|
-
for s in attr:
|
|
4184
|
-
assert_raises(AttributeError, delattr, a, s)
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
def test_multiarray_not_writable_attributes_deletion(self):
|
|
4188
|
-
a = np.ones(2)
|
|
4189
|
-
attr = ["ndim", "flags", "itemsize", "size", "nbytes", "base",
|
|
4190
|
-
"ctypes", "T", "__array_interface__", "__array_struct__",
|
|
4191
|
-
"__array_priority__", "__array_finalize__"]
|
|
4192
|
-
for s in attr:
|
|
4193
|
-
assert_raises(AttributeError, delattr, a, s)
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
def test_multiarray_flags_writable_attribute_deletion(self):
|
|
4197
|
-
a = np.ones(2).flags
|
|
4198
|
-
attr = ['updateifcopy', 'aligned', 'writeable']
|
|
4199
|
-
for s in attr:
|
|
4200
|
-
assert_raises(AttributeError, delattr, a, s)
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
def test_multiarray_flags_not_writable_attribute_deletion(self):
|
|
4204
|
-
a = np.ones(2).flags
|
|
4205
|
-
attr = ["contiguous", "c_contiguous", "f_contiguous", "fortran",
|
|
4206
|
-
"owndata", "fnc", "forc", "behaved", "carray", "farray",
|
|
4207
|
-
"num"]
|
|
4208
|
-
for s in attr:
|
|
4209
|
-
assert_raises(AttributeError, delattr, a, s)
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
def test_array_interface():
|
|
4213
|
-
# Test scalar coercion within the array interface
|
|
4214
|
-
class Foo(object):
|
|
4215
|
-
def __init__(self, value):
|
|
4216
|
-
self.value = value
|
|
4217
|
-
self.iface = {'typestr' : '=f8'}
|
|
4218
|
-
def __float__(self):
|
|
4219
|
-
return float(self.value)
|
|
4220
|
-
@property
|
|
4221
|
-
def __array_interface__(self):
|
|
4222
|
-
return self.iface
|
|
4223
|
-
f = Foo(0.5)
|
|
4224
|
-
assert_equal(np.array(f), 0.5)
|
|
4225
|
-
assert_equal(np.array([f]), [0.5])
|
|
4226
|
-
assert_equal(np.array([f, f]), [0.5, 0.5])
|
|
4227
|
-
assert_equal(np.array(f).dtype, np.dtype('=f8'))
|
|
4228
|
-
# Test various shape definitions
|
|
4229
|
-
f.iface['shape'] = ()
|
|
4230
|
-
assert_equal(np.array(f), 0.5)
|
|
4231
|
-
f.iface['shape'] = None
|
|
4232
|
-
assert_raises(TypeError, np.array, f)
|
|
4233
|
-
f.iface['shape'] = (1, 1)
|
|
4234
|
-
assert_equal(np.array(f), [[0.5]])
|
|
4235
|
-
f.iface['shape'] = (2,)
|
|
4236
|
-
assert_raises(ValueError, np.array, f)
|
|
4237
|
-
|
|
4238
|
-
# test scalar with no shape
|
|
4239
|
-
class ArrayLike(object):
|
|
4240
|
-
array = np.array(1)
|
|
4241
|
-
__array_interface__ = array.__array_interface__
|
|
4242
|
-
assert_equal(np.array(ArrayLike()), 1)
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
def test_flat_element_deletion():
|
|
4246
|
-
it = np.ones(3).flat
|
|
4247
|
-
try:
|
|
4248
|
-
del it[1]
|
|
4249
|
-
del it[1:2]
|
|
4250
|
-
except TypeError:
|
|
4251
|
-
pass
|
|
4252
|
-
except:
|
|
4253
|
-
raise AssertionError
|
|
4254
|
-
|
|
4255
|
-
def test_scalar_element_deletion():
|
|
4256
|
-
a = np.zeros(2, dtype=[('x', 'int'), ('y', 'int')])
|
|
4257
|
-
assert_raises(ValueError, a[0].__delitem__, 'x')
|
|
4258
|
-
|
|
4259
|
-
class TestMemEventHook(TestCase):
|
|
4260
|
-
def test_mem_seteventhook(self):
|
|
4261
|
-
# The actual tests are within the C code in
|
|
4262
|
-
# multiarray/multiarray_tests.c.src
|
|
4263
|
-
test_pydatamem_seteventhook_start()
|
|
4264
|
-
# force an allocation and free of a numpy array
|
|
4265
|
-
# needs to be larger then limit of small memory cacher in ctors.c
|
|
4266
|
-
a = np.zeros(1000)
|
|
4267
|
-
del a
|
|
4268
|
-
test_pydatamem_seteventhook_end()
|
|
4269
|
-
|
|
4270
|
-
class TestMapIter(TestCase):
|
|
4271
|
-
def test_mapiter(self):
|
|
4272
|
-
# The actual tests are within the C code in
|
|
4273
|
-
# multiarray/multiarray_tests.c.src
|
|
4274
|
-
|
|
4275
|
-
a = arange(12).reshape((3, 4)).astype(float)
|
|
4276
|
-
index = ([1, 1, 2, 0],
|
|
4277
|
-
[0, 0, 2, 3])
|
|
4278
|
-
vals = [50, 50, 30, 16]
|
|
4279
|
-
|
|
4280
|
-
test_inplace_increment(a, index, vals)
|
|
4281
|
-
assert_equal(a, [[ 0., 1., 2., 19.,],
|
|
4282
|
-
[ 104., 5., 6., 7.,],
|
|
4283
|
-
[ 8., 9., 40., 11.,]])
|
|
4284
|
-
|
|
4285
|
-
b = arange(6).astype(float)
|
|
4286
|
-
index = (array([1, 2, 0]),)
|
|
4287
|
-
vals = [50, 4, 100.1]
|
|
4288
|
-
test_inplace_increment(b, index, vals)
|
|
4289
|
-
assert_equal(b, [ 100.1, 51., 6., 3., 4., 5. ])
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
class TestAsCArray(TestCase):
|
|
4293
|
-
def test_1darray(self):
|
|
4294
|
-
array = np.arange(24, dtype=np.double)
|
|
4295
|
-
from_c = test_as_c_array(array, 3)
|
|
4296
|
-
assert_equal(array[3], from_c)
|
|
4297
|
-
|
|
4298
|
-
def test_2darray(self):
|
|
4299
|
-
array = np.arange(24, dtype=np.double).reshape(3, 8)
|
|
4300
|
-
from_c = test_as_c_array(array, 2, 4)
|
|
4301
|
-
assert_equal(array[2, 4], from_c)
|
|
4302
|
-
|
|
4303
|
-
def test_3darray(self):
|
|
4304
|
-
array = np.arange(24, dtype=np.double).reshape(2, 3, 4)
|
|
4305
|
-
from_c = test_as_c_array(array, 1, 2, 3)
|
|
4306
|
-
assert_equal(array[1, 2, 3], from_c)
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
class PriorityNdarray():
|
|
4310
|
-
__array_priority__ = 1000
|
|
4311
|
-
|
|
4312
|
-
def __init__(self, array):
|
|
4313
|
-
self.array = array
|
|
4314
|
-
|
|
4315
|
-
def __lt__(self, array):
|
|
4316
|
-
if isinstance(array, PriorityNdarray):
|
|
4317
|
-
array = array.array
|
|
4318
|
-
return PriorityNdarray(self.array < array)
|
|
4319
|
-
|
|
4320
|
-
def __gt__(self, array):
|
|
4321
|
-
if isinstance(array, PriorityNdarray):
|
|
4322
|
-
array = array.array
|
|
4323
|
-
return PriorityNdarray(self.array > array)
|
|
4324
|
-
|
|
4325
|
-
def __le__(self, array):
|
|
4326
|
-
if isinstance(array, PriorityNdarray):
|
|
4327
|
-
array = array.array
|
|
4328
|
-
return PriorityNdarray(self.array <= array)
|
|
4329
|
-
|
|
4330
|
-
def __ge__(self, array):
|
|
4331
|
-
if isinstance(array, PriorityNdarray):
|
|
4332
|
-
array = array.array
|
|
4333
|
-
return PriorityNdarray(self.array >= array)
|
|
4334
|
-
|
|
4335
|
-
def __eq__(self, array):
|
|
4336
|
-
if isinstance(array, PriorityNdarray):
|
|
4337
|
-
array = array.array
|
|
4338
|
-
return PriorityNdarray(self.array == array)
|
|
4339
|
-
|
|
4340
|
-
def __ne__(self, array):
|
|
4341
|
-
if isinstance(array, PriorityNdarray):
|
|
4342
|
-
array = array.array
|
|
4343
|
-
return PriorityNdarray(self.array != array)
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
class TestArrayPriority(TestCase):
|
|
4347
|
-
def test_lt(self):
|
|
4348
|
-
l = np.asarray([0., -1., 1.], dtype=dtype)
|
|
4349
|
-
r = np.asarray([0., 1., -1.], dtype=dtype)
|
|
4350
|
-
lp = PriorityNdarray(l)
|
|
4351
|
-
rp = PriorityNdarray(r)
|
|
4352
|
-
res1 = l < r
|
|
4353
|
-
res2 = l < rp
|
|
4354
|
-
res3 = lp < r
|
|
4355
|
-
res4 = lp < rp
|
|
4356
|
-
|
|
4357
|
-
assert_array_equal(res1, res2.array)
|
|
4358
|
-
assert_array_equal(res1, res3.array)
|
|
4359
|
-
assert_array_equal(res1, res4.array)
|
|
4360
|
-
assert_(isinstance(res1, np.ndarray))
|
|
4361
|
-
assert_(isinstance(res2, PriorityNdarray))
|
|
4362
|
-
assert_(isinstance(res3, PriorityNdarray))
|
|
4363
|
-
assert_(isinstance(res4, PriorityNdarray))
|
|
4364
|
-
|
|
4365
|
-
def test_gt(self):
|
|
4366
|
-
l = np.asarray([0., -1., 1.], dtype=dtype)
|
|
4367
|
-
r = np.asarray([0., 1., -1.], dtype=dtype)
|
|
4368
|
-
lp = PriorityNdarray(l)
|
|
4369
|
-
rp = PriorityNdarray(r)
|
|
4370
|
-
res1 = l > r
|
|
4371
|
-
res2 = l > rp
|
|
4372
|
-
res3 = lp > r
|
|
4373
|
-
res4 = lp > rp
|
|
4374
|
-
|
|
4375
|
-
assert_array_equal(res1, res2.array)
|
|
4376
|
-
assert_array_equal(res1, res3.array)
|
|
4377
|
-
assert_array_equal(res1, res4.array)
|
|
4378
|
-
assert_(isinstance(res1, np.ndarray))
|
|
4379
|
-
assert_(isinstance(res2, PriorityNdarray))
|
|
4380
|
-
assert_(isinstance(res3, PriorityNdarray))
|
|
4381
|
-
assert_(isinstance(res4, PriorityNdarray))
|
|
4382
|
-
|
|
4383
|
-
def test_le(self):
|
|
4384
|
-
l = np.asarray([0., -1., 1.], dtype=dtype)
|
|
4385
|
-
r = np.asarray([0., 1., -1.], dtype=dtype)
|
|
4386
|
-
lp = PriorityNdarray(l)
|
|
4387
|
-
rp = PriorityNdarray(r)
|
|
4388
|
-
res1 = l <= r
|
|
4389
|
-
res2 = l <= rp
|
|
4390
|
-
res3 = lp <= r
|
|
4391
|
-
res4 = lp <= rp
|
|
4392
|
-
|
|
4393
|
-
assert_array_equal(res1, res2.array)
|
|
4394
|
-
assert_array_equal(res1, res3.array)
|
|
4395
|
-
assert_array_equal(res1, res4.array)
|
|
4396
|
-
assert_(isinstance(res1, np.ndarray))
|
|
4397
|
-
assert_(isinstance(res2, PriorityNdarray))
|
|
4398
|
-
assert_(isinstance(res3, PriorityNdarray))
|
|
4399
|
-
assert_(isinstance(res4, PriorityNdarray))
|
|
4400
|
-
|
|
4401
|
-
def test_ge(self):
|
|
4402
|
-
l = np.asarray([0., -1., 1.], dtype=dtype)
|
|
4403
|
-
r = np.asarray([0., 1., -1.], dtype=dtype)
|
|
4404
|
-
lp = PriorityNdarray(l)
|
|
4405
|
-
rp = PriorityNdarray(r)
|
|
4406
|
-
res1 = l >= r
|
|
4407
|
-
res2 = l >= rp
|
|
4408
|
-
res3 = lp >= r
|
|
4409
|
-
res4 = lp >= rp
|
|
4410
|
-
|
|
4411
|
-
assert_array_equal(res1, res2.array)
|
|
4412
|
-
assert_array_equal(res1, res3.array)
|
|
4413
|
-
assert_array_equal(res1, res4.array)
|
|
4414
|
-
assert_(isinstance(res1, np.ndarray))
|
|
4415
|
-
assert_(isinstance(res2, PriorityNdarray))
|
|
4416
|
-
assert_(isinstance(res3, PriorityNdarray))
|
|
4417
|
-
assert_(isinstance(res4, PriorityNdarray))
|
|
4418
|
-
|
|
4419
|
-
def test_eq(self):
|
|
4420
|
-
l = np.asarray([0., -1., 1.], dtype=dtype)
|
|
4421
|
-
r = np.asarray([0., 1., -1.], dtype=dtype)
|
|
4422
|
-
lp = PriorityNdarray(l)
|
|
4423
|
-
rp = PriorityNdarray(r)
|
|
4424
|
-
res1 = l == r
|
|
4425
|
-
res2 = l == rp
|
|
4426
|
-
res3 = lp == r
|
|
4427
|
-
res4 = lp == rp
|
|
4428
|
-
|
|
4429
|
-
assert_array_equal(res1, res2.array)
|
|
4430
|
-
assert_array_equal(res1, res3.array)
|
|
4431
|
-
assert_array_equal(res1, res4.array)
|
|
4432
|
-
assert_(isinstance(res1, np.ndarray))
|
|
4433
|
-
assert_(isinstance(res2, PriorityNdarray))
|
|
4434
|
-
assert_(isinstance(res3, PriorityNdarray))
|
|
4435
|
-
assert_(isinstance(res4, PriorityNdarray))
|
|
4436
|
-
|
|
4437
|
-
def test_ne(self):
|
|
4438
|
-
l = np.asarray([0., -1., 1.], dtype=dtype)
|
|
4439
|
-
r = np.asarray([0., 1., -1.], dtype=dtype)
|
|
4440
|
-
lp = PriorityNdarray(l)
|
|
4441
|
-
rp = PriorityNdarray(r)
|
|
4442
|
-
res1 = l != r
|
|
4443
|
-
res2 = l != rp
|
|
4444
|
-
res3 = lp != r
|
|
4445
|
-
res4 = lp != rp
|
|
4446
|
-
|
|
4447
|
-
assert_array_equal(res1, res2.array)
|
|
4448
|
-
assert_array_equal(res1, res3.array)
|
|
4449
|
-
assert_array_equal(res1, res4.array)
|
|
4450
|
-
assert_(isinstance(res1, np.ndarray))
|
|
4451
|
-
assert_(isinstance(res2, PriorityNdarray))
|
|
4452
|
-
assert_(isinstance(res3, PriorityNdarray))
|
|
4453
|
-
assert_(isinstance(res4, PriorityNdarray))
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
class TestConversion(TestCase):
|
|
4457
|
-
def test_array_scalar_relational_operation(self):
|
|
4458
|
-
#All integer
|
|
4459
|
-
for dt1 in np.typecodes['AllInteger']:
|
|
4460
|
-
assert_(1 > np.array(0, dtype=dt1), "type %s failed" % (dt1,))
|
|
4461
|
-
assert_(not 1 < np.array(0, dtype=dt1), "type %s failed" % (dt1,))
|
|
4462
|
-
|
|
4463
|
-
for dt2 in np.typecodes['AllInteger']:
|
|
4464
|
-
assert_(np.array(1, dtype=dt1) > np.array(0, dtype=dt2),
|
|
4465
|
-
"type %s and %s failed" % (dt1, dt2))
|
|
4466
|
-
assert_(not np.array(1, dtype=dt1) < np.array(0, dtype=dt2),
|
|
4467
|
-
"type %s and %s failed" % (dt1, dt2))
|
|
4468
|
-
|
|
4469
|
-
#Unsigned integers
|
|
4470
|
-
for dt1 in 'BHILQP':
|
|
4471
|
-
assert_(-1 < np.array(1, dtype=dt1), "type %s failed" % (dt1,))
|
|
4472
|
-
assert_(not -1 > np.array(1, dtype=dt1), "type %s failed" % (dt1,))
|
|
4473
|
-
assert_(-1 != np.array(1, dtype=dt1), "type %s failed" % (dt1,))
|
|
4474
|
-
|
|
4475
|
-
#unsigned vs signed
|
|
4476
|
-
for dt2 in 'bhilqp':
|
|
4477
|
-
assert_(np.array(1, dtype=dt1) > np.array(-1, dtype=dt2),
|
|
4478
|
-
"type %s and %s failed" % (dt1, dt2))
|
|
4479
|
-
assert_(not np.array(1, dtype=dt1) < np.array(-1, dtype=dt2),
|
|
4480
|
-
"type %s and %s failed" % (dt1, dt2))
|
|
4481
|
-
assert_(np.array(1, dtype=dt1) != np.array(-1, dtype=dt2),
|
|
4482
|
-
"type %s and %s failed" % (dt1, dt2))
|
|
4483
|
-
|
|
4484
|
-
#Signed integers and floats
|
|
4485
|
-
for dt1 in 'bhlqp' + np.typecodes['Float']:
|
|
4486
|
-
assert_(1 > np.array(-1, dtype=dt1), "type %s failed" % (dt1,))
|
|
4487
|
-
assert_(not 1 < np.array(-1, dtype=dt1), "type %s failed" % (dt1,))
|
|
4488
|
-
assert_(-1 == np.array(-1, dtype=dt1), "type %s failed" % (dt1,))
|
|
4489
|
-
|
|
4490
|
-
for dt2 in 'bhlqp' + np.typecodes['Float']:
|
|
4491
|
-
assert_(np.array(1, dtype=dt1) > np.array(-1, dtype=dt2),
|
|
4492
|
-
"type %s and %s failed" % (dt1, dt2))
|
|
4493
|
-
assert_(not np.array(1, dtype=dt1) < np.array(-1, dtype=dt2),
|
|
4494
|
-
"type %s and %s failed" % (dt1, dt2))
|
|
4495
|
-
assert_(np.array(-1, dtype=dt1) == np.array(-1, dtype=dt2),
|
|
4496
|
-
"type %s and %s failed" % (dt1, dt2))
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
class TestWhere(TestCase):
|
|
4500
|
-
def test_basic(self):
|
|
4501
|
-
dts = [np.bool, np.int16, np.int32, np.int64, np.double, np.complex128,
|
|
4502
|
-
np.longdouble, np.clongdouble]
|
|
4503
|
-
for dt in dts:
|
|
4504
|
-
c = np.ones(53, dtype=np.bool)
|
|
4505
|
-
assert_equal(np.where( c, dt(0), dt(1)), dt(0))
|
|
4506
|
-
assert_equal(np.where(~c, dt(0), dt(1)), dt(1))
|
|
4507
|
-
assert_equal(np.where(True, dt(0), dt(1)), dt(0))
|
|
4508
|
-
assert_equal(np.where(False, dt(0), dt(1)), dt(1))
|
|
4509
|
-
d = np.ones_like(c).astype(dt)
|
|
4510
|
-
e = np.zeros_like(d)
|
|
4511
|
-
r = d.astype(dt)
|
|
4512
|
-
c[7] = False
|
|
4513
|
-
r[7] = e[7]
|
|
4514
|
-
assert_equal(np.where(c, e, e), e)
|
|
4515
|
-
assert_equal(np.where(c, d, e), r)
|
|
4516
|
-
assert_equal(np.where(c, d, e[0]), r)
|
|
4517
|
-
assert_equal(np.where(c, d[0], e), r)
|
|
4518
|
-
assert_equal(np.where(c[::2], d[::2], e[::2]), r[::2])
|
|
4519
|
-
assert_equal(np.where(c[1::2], d[1::2], e[1::2]), r[1::2])
|
|
4520
|
-
assert_equal(np.where(c[::3], d[::3], e[::3]), r[::3])
|
|
4521
|
-
assert_equal(np.where(c[1::3], d[1::3], e[1::3]), r[1::3])
|
|
4522
|
-
assert_equal(np.where(c[::-2], d[::-2], e[::-2]), r[::-2])
|
|
4523
|
-
assert_equal(np.where(c[::-3], d[::-3], e[::-3]), r[::-3])
|
|
4524
|
-
assert_equal(np.where(c[1::-3], d[1::-3], e[1::-3]), r[1::-3])
|
|
4525
|
-
|
|
4526
|
-
def test_exotic(self):
|
|
4527
|
-
# object
|
|
4528
|
-
assert_array_equal(np.where(True, None, None), np.array(None))
|
|
4529
|
-
# zero sized
|
|
4530
|
-
m = np.array([], dtype=bool).reshape(0, 3)
|
|
4531
|
-
b = np.array([], dtype=np.float64).reshape(0, 3)
|
|
4532
|
-
assert_array_equal(np.where(m, 0, b), np.array([]).reshape(0, 3))
|
|
4533
|
-
|
|
4534
|
-
# object cast
|
|
4535
|
-
d = np.array([-1.34, -0.16, -0.54, -0.31, -0.08, -0.95, 0.000, 0.313,
|
|
4536
|
-
0.547, -0.18, 0.876, 0.236, 1.969, 0.310, 0.699, 1.013,
|
|
4537
|
-
1.267, 0.229, -1.39, 0.487])
|
|
4538
|
-
nan = float('NaN')
|
|
4539
|
-
e = np.array(['5z', '0l', nan, 'Wz', nan, nan, 'Xq', 'cs', nan, nan,
|
|
4540
|
-
'QN', nan, nan, 'Fd', nan, nan, 'kp', nan, '36', 'i1'],
|
|
4541
|
-
dtype=object);
|
|
4542
|
-
m = np.array([0,0,1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,1,0,0], dtype=bool)
|
|
4543
|
-
|
|
4544
|
-
r = e[:]
|
|
4545
|
-
r[np.where(m)] = d[np.where(m)]
|
|
4546
|
-
assert_array_equal(np.where(m, d, e), r)
|
|
4547
|
-
|
|
4548
|
-
r = e[:]
|
|
4549
|
-
r[np.where(~m)] = d[np.where(~m)]
|
|
4550
|
-
assert_array_equal(np.where(m, e, d), r)
|
|
4551
|
-
|
|
4552
|
-
assert_array_equal(np.where(m, e, e), e)
|
|
4553
|
-
|
|
4554
|
-
# minimal dtype result with NaN scalar (e.g required by pandas)
|
|
4555
|
-
d = np.array([1., 2.], dtype=np.float32)
|
|
4556
|
-
e = float('NaN')
|
|
4557
|
-
assert_equal(np.where(True, d, e).dtype, np.float32)
|
|
4558
|
-
e = float('Infinity')
|
|
4559
|
-
assert_equal(np.where(True, d, e).dtype, np.float32)
|
|
4560
|
-
e = float('-Infinity')
|
|
4561
|
-
assert_equal(np.where(True, d, e).dtype, np.float32)
|
|
4562
|
-
# also check upcast
|
|
4563
|
-
e = float(1e150)
|
|
4564
|
-
assert_equal(np.where(True, d, e).dtype, np.float64)
|
|
4565
|
-
|
|
4566
|
-
def test_ndim(self):
|
|
4567
|
-
c = [True, False]
|
|
4568
|
-
a = np.zeros((2, 25))
|
|
4569
|
-
b = np.ones((2, 25))
|
|
4570
|
-
r = np.where(np.array(c)[:,np.newaxis], a, b)
|
|
4571
|
-
assert_array_equal(r[0], a[0])
|
|
4572
|
-
assert_array_equal(r[1], b[0])
|
|
4573
|
-
|
|
4574
|
-
a = a.T
|
|
4575
|
-
b = b.T
|
|
4576
|
-
r = np.where(c, a, b)
|
|
4577
|
-
assert_array_equal(r[:,0], a[:,0])
|
|
4578
|
-
assert_array_equal(r[:,1], b[:,0])
|
|
4579
|
-
|
|
4580
|
-
def test_dtype_mix(self):
|
|
4581
|
-
c = np.array([False, True, False, False, False, False, True, False,
|
|
4582
|
-
False, False, True, False])
|
|
4583
|
-
a = np.uint32(1)
|
|
4584
|
-
b = np.array([5., 0., 3., 2., -1., -4., 0., -10., 10., 1., 0., 3.],
|
|
4585
|
-
dtype=np.float64)
|
|
4586
|
-
r = np.array([5., 1., 3., 2., -1., -4., 1., -10., 10., 1., 1., 3.],
|
|
4587
|
-
dtype=np.float64)
|
|
4588
|
-
assert_equal(np.where(c, a, b), r)
|
|
4589
|
-
|
|
4590
|
-
a = a.astype(np.float32)
|
|
4591
|
-
b = b.astype(np.int64)
|
|
4592
|
-
assert_equal(np.where(c, a, b), r)
|
|
4593
|
-
|
|
4594
|
-
# non bool mask
|
|
4595
|
-
c = c.astype(np.int)
|
|
4596
|
-
c[c != 0] = 34242324
|
|
4597
|
-
assert_equal(np.where(c, a, b), r)
|
|
4598
|
-
# invert
|
|
4599
|
-
tmpmask = c != 0
|
|
4600
|
-
c[c == 0] = 41247212
|
|
4601
|
-
c[tmpmask] = 0
|
|
4602
|
-
assert_equal(np.where(c, b, a), r)
|
|
4603
|
-
|
|
4604
|
-
def test_foreign(self):
|
|
4605
|
-
c = np.array([False, True, False, False, False, False, True, False,
|
|
4606
|
-
False, False, True, False])
|
|
4607
|
-
r = np.array([5., 1., 3., 2., -1., -4., 1., -10., 10., 1., 1., 3.],
|
|
4608
|
-
dtype=np.float64)
|
|
4609
|
-
a = np.ones(1, dtype='>i4')
|
|
4610
|
-
b = np.array([5., 0., 3., 2., -1., -4., 0., -10., 10., 1., 0., 3.],
|
|
4611
|
-
dtype=np.float64)
|
|
4612
|
-
assert_equal(np.where(c, a, b), r)
|
|
4613
|
-
|
|
4614
|
-
b = b.astype('>f8')
|
|
4615
|
-
assert_equal(np.where(c, a, b), r)
|
|
4616
|
-
|
|
4617
|
-
a = a.astype('<i4')
|
|
4618
|
-
assert_equal(np.where(c, a, b), r)
|
|
4619
|
-
|
|
4620
|
-
c = c.astype('>i4')
|
|
4621
|
-
assert_equal(np.where(c, a, b), r)
|
|
4622
|
-
|
|
4623
|
-
def test_error(self):
|
|
4624
|
-
c = [True, True]
|
|
4625
|
-
a = np.ones((4, 5))
|
|
4626
|
-
b = np.ones((5, 5))
|
|
4627
|
-
assert_raises(ValueError, np.where, c, a, a)
|
|
4628
|
-
assert_raises(ValueError, np.where, c[0], a, b)
|
|
4629
|
-
|
|
4630
|
-
def test_string(self):
|
|
4631
|
-
# gh-4778 check strings are properly filled with nulls
|
|
4632
|
-
a = np.array("abc")
|
|
4633
|
-
b = np.array("x" * 753)
|
|
4634
|
-
assert_equal(np.where(True, a, b), "abc")
|
|
4635
|
-
assert_equal(np.where(False, b, a), "abc")
|
|
4636
|
-
|
|
4637
|
-
# check native datatype sized strings
|
|
4638
|
-
a = np.array("abcd")
|
|
4639
|
-
b = np.array("x" * 8)
|
|
4640
|
-
assert_equal(np.where(True, a, b), "abcd")
|
|
4641
|
-
assert_equal(np.where(False, b, a), "abcd")
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
if __name__ == "__main__":
|
|
4645
|
-
run_module_suite()
|