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_ufunclike.py
from __future__ import division, absolute_import, print_function import numpy.core as nx import numpy.lib.ufunclike as ufl from numpy.testing import ( run_module_suite, TestCase, assert_, assert_equal, assert_array_equal ) class TestUfunclike(TestCase): def test_isposinf(self): a = nx.array([nx.inf, -nx.inf, nx.nan, 0.0, 3.0, -3.0]) out = nx.zeros(a.shape, bool) tgt = nx.array([True, False, False, False, False, False]) res = ufl.isposinf(a) assert_equal(res, tgt) res = ufl.isposinf(a, out) assert_equal(res, tgt) assert_equal(out, tgt) def test_isneginf(self): a = nx.array([nx.inf, -nx.inf, nx.nan, 0.0, 3.0, -3.0]) out = nx.zeros(a.shape, bool) tgt = nx.array([False, True, False, False, False, False]) res = ufl.isneginf(a) assert_equal(res, tgt) res = ufl.isneginf(a, out) assert_equal(res, tgt) assert_equal(out, tgt) def test_fix(self): a = nx.array([[1.0, 1.1, 1.5, 1.8], [-1.0, -1.1, -1.5, -1.8]]) out = nx.zeros(a.shape, float) tgt = nx.array([[1., 1., 1., 1.], [-1., -1., -1., -1.]]) res = ufl.fix(a) assert_equal(res, tgt) res = ufl.fix(a, out) assert_equal(res, tgt) assert_equal(out, tgt) assert_equal(ufl.fix(3.14), 3) def test_fix_with_subclass(self): class MyArray(nx.ndarray): def __new__(cls, data, metadata=None): res = nx.array(data, copy=True).view(cls) res.metadata = metadata return res def __array_wrap__(self, obj, context=None): obj.metadata = self.metadata return obj a = nx.array([1.1, -1.1]) m = MyArray(a, metadata='foo') f = ufl.fix(m) assert_array_equal(f, nx.array([1, -1])) assert_(isinstance(f, MyArray)) assert_equal(f.metadata, 'foo') if __name__ == "__main__": run_module_suite()
Upload File
Create Folder