Hackfut Security File Manager
Current Path:
/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/tests
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
numpy
/
lib
/
tests
/
📁
..
📁
data
📄
test__datasource.py
(10.2 KB)
📄
test__datasource.pyc
(16.97 KB)
📄
test__datasource.pyo
(16.97 KB)
📄
test__iotools.py
(13.69 KB)
📄
test__iotools.pyc
(15.05 KB)
📄
test__iotools.pyo
(15.05 KB)
📄
test__version.py
(2.08 KB)
📄
test__version.pyc
(3.5 KB)
📄
test__version.pyo
(3.5 KB)
📄
test_arraypad.py
(41.65 KB)
📄
test_arraypad.pyc
(58.01 KB)
📄
test_arraypad.pyo
(58.01 KB)
📄
test_arraysetops.py
(9.85 KB)
📄
test_arraysetops.pyc
(10.03 KB)
📄
test_arraysetops.pyo
(10.03 KB)
📄
test_arrayterator.py
(1.42 KB)
📄
test_arrayterator.pyc
(2.07 KB)
📄
test_arrayterator.pyo
(2.07 KB)
📄
test_financial.py
(6.45 KB)
📄
test_financial.pyc
(7.34 KB)
📄
test_financial.pyo
(7.34 KB)
📄
test_format.py
(33.43 KB)
📄
test_format.pyc
(16.93 KB)
📄
test_format.pyo
(16.93 KB)
📄
test_function_base.py
(106.45 KB)
📄
test_function_base.pyc
(133.6 KB)
📄
test_function_base.pyo
(133.6 KB)
📄
test_index_tricks.py
(11.19 KB)
📄
test_index_tricks.pyc
(15.3 KB)
📄
test_index_tricks.pyo
(15.3 KB)
📄
test_io.py
(70.42 KB)
📄
test_io.pyc
(83.74 KB)
📄
test_io.pyo
(83.74 KB)
📄
test_nanfunctions.py
(27.57 KB)
📄
test_nanfunctions.pyc
(32.92 KB)
📄
test_nanfunctions.pyo
(32.92 KB)
📄
test_packbits.py
(951 B)
📄
test_packbits.pyc
(1.49 KB)
📄
test_packbits.pyo
(1.49 KB)
📄
test_polynomial.py
(4.97 KB)
📄
test_polynomial.pyc
(5.45 KB)
📄
test_polynomial.pyo
(5.45 KB)
📄
test_recfunctions.py
(29.91 KB)
📄
test_recfunctions.pyc
(36.29 KB)
📄
test_recfunctions.pyo
(36.29 KB)
📄
test_regression.py
(8.62 KB)
📄
test_regression.pyc
(13.85 KB)
📄
test_regression.pyo
(13.85 KB)
📄
test_shape_base.py
(12.42 KB)
📄
test_shape_base.pyc
(18.8 KB)
📄
test_shape_base.pyo
(18.8 KB)
📄
test_stride_tricks.py
(13.87 KB)
📄
test_stride_tricks.pyc
(16.21 KB)
📄
test_stride_tricks.pyo
(16.21 KB)
📄
test_twodim_base.py
(17.57 KB)
📄
test_twodim_base.pyc
(21.95 KB)
📄
test_twodim_base.pyo
(21.95 KB)
📄
test_type_check.py
(10.01 KB)
📄
test_type_check.pyc
(20.16 KB)
📄
test_type_check.pyo
(20.16 KB)
📄
test_ufunclike.py
(1.98 KB)
📄
test_ufunclike.pyc
(3.55 KB)
📄
test_ufunclike.pyo
(3.55 KB)
📄
test_utils.py
(1.43 KB)
📄
test_utils.pyc
(3.2 KB)
📄
test_utils.pyo
(3.2 KB)
Editing: test_arrayterator.py
from __future__ import division, absolute_import, print_function from operator import mul from functools import reduce import numpy as np from numpy.random import randint from numpy.lib import Arrayterator from numpy.testing import assert_ def test(): np.random.seed(np.arange(10)) # Create a random array ndims = randint(5)+1 shape = tuple(randint(10)+1 for dim in range(ndims)) els = reduce(mul, shape) a = np.arange(els) a.shape = shape buf_size = randint(2*els) b = Arrayterator(a, buf_size) # Check that each block has at most ``buf_size`` elements for block in b: assert_(len(block.flat) <= (buf_size or els)) # Check that all elements are iterated correctly assert_(list(b.flat) == list(a.flat)) # Slice arrayterator start = [randint(dim) for dim in shape] stop = [randint(dim)+1 for dim in shape] step = [randint(dim)+1 for dim in shape] slice_ = tuple(slice(*t) for t in zip(start, stop, step)) c = b[slice_] d = a[slice_] # Check that each block has at most ``buf_size`` elements for block in c: assert_(len(block.flat) <= (buf_size or els)) # Check that the arrayterator is sliced correctly assert_(np.all(c.__array__() == d)) # Check that all elements are iterated correctly assert_(list(c.flat) == list(d.flat)) if __name__ == '__main__': from numpy.testing import run_module_suite run_module_suite()
Upload File
Create Folder