/usr/lib64/python2.6/site-packages/numpy/core/tests
NameSizeModeActions
data/-0755rm
test_blasdot.py4650644editdlrm
test_blasdot.pyc9900644editdlrm
test_blasdot.pyo9900644editdlrm
test_defchararray.py235830644editdlrm
test_defchararray.pyc368470644editdlrm
test_defchararray.pyo323920644editdlrm
test_dtype.py39870644editdlrm
test_dtype.pyc65460644editdlrm
test_dtype.pyo65460644editdlrm
test_errstate.py17120644editdlrm
test_errstate.pyc16540644editdlrm
test_errstate.pyo16540644editdlrm
test_function_base.py9840644editdlrm
test_function_base.pyc23190644editdlrm
test_function_base.pyo20170644editdlrm
test_getlimits.py16300644editdlrm
test_getlimits.pyc37990644editdlrm
test_getlimits.pyo37990644editdlrm
test_machar.py10000644editdlrm
test_machar.pyc17050644editdlrm
test_machar.pyo17050644editdlrm
test_memmap.py21010644editdlrm
test_memmap.pyc33410644editdlrm
test_memmap.pyo32890644editdlrm
test_multiarray.py518580644editdlrm
test_multiarray.pyc702540644editdlrm
test_multiarray.pyo696390644editdlrm
test_numeric.py307730644editdlrm
test_numeric.pyc480280644editdlrm
test_numeric.pyo459700644editdlrm
test_numerictypes.py141940644editdlrm
test_numerictypes.pyc179080644editdlrm
test_numerictypes.pyo175720644editdlrm
test_print.py80910644editdlrm
test_print.pyc92240644editdlrm
test_print.pyo92240644editdlrm
test_records.py53250644editdlrm
test_records.pyc91830644editdlrm
test_records.pyo85340644editdlrm
test_regression.py430970644editdlrm
test_regression.pyc670250644editdlrm
test_regression.pyo625030644editdlrm
test_scalarmath.py37890644editdlrm
test_scalarmath.pyc53950644editdlrm
test_scalarmath.pyo50960644editdlrm
test_shape_base.py45710644editdlrm
test_shape_base.pyc88900644editdlrm
test_shape_base.pyo83260644editdlrm
test_ufunc.py169440644editdlrm
test_ufunc.pyc183660644editdlrm
test_ufunc.pyo181350644editdlrm
test_umath.py359910644editdlrm
test_umath.pyc547650644editdlrm
test_umath.pyo513770644editdlrm
test_umath_complex.py177280644editdlrm
test_umath_complex.pyc168860644editdlrm
test_umath_complex.pyo168860644editdlrm
test_unicode.py112550644editdlrm
test_unicode.pyc150700644editdlrm
test_unicode.pyo150700644editdlrm
Edit: /usr/lib64/python2.6/site-packages/numpy/core/tests/test_scalarmath.py (3789B)
import sys from numpy.testing import * import numpy as np types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uintc, np.int_, np.uint, np.longlong, np.ulonglong, np.single, np.double, np.longdouble, np.csingle, np.cdouble, np.clongdouble] # This compares scalarmath against ufuncs. class TestTypes(TestCase): def test_types(self, level=1): for atype in types: a = atype(1) assert a == 1, "error with %r: got %r" % (atype,a) def test_type_add(self, level=1): # list of types for k, atype in enumerate(types): vala = atype(3) val1 = np.array([3],dtype=atype) for l, btype in enumerate(types): valb = btype(1) val2 = np.array([1],dtype=btype) val = vala+valb valo = val1 + val2 assert val.dtype.num == valo.dtype.num and \ val.dtype.char == valo.dtype.char, \ "error with (%d,%d)" % (k,l) def test_type_create(self, level=1): for k, atype in enumerate(types): a = np.array([1,2,3],atype) b = atype([1,2,3]) assert_equal(a,b) class TestPower(TestCase): def test_small_types(self): for t in [np.int8, np.int16]: a = t(3) b = a ** 4 assert b == 81, "error with %r: got %r" % (t,b) def test_large_types(self): for t in [np.int32, np.int64, np.float32, np.float64, np.longdouble]: a = t(51) b = a ** 4 msg = "error with %r: got %r" % (t,b) if np.issubdtype(t, np.integer): assert b == 6765201, msg else: assert_almost_equal(b, 6765201, err_msg=msg) class TestConversion(TestCase): def test_int_from_long(self): l = [1e6, 1e12, 1e18, -1e6, -1e12, -1e18] li = [10**6, 10**12, 10**18, -10**6, -10**12, -10**18] for T in [None, np.float64, np.int64]: a = np.array(l,dtype=T) assert_equal(map(int,a), li) a = np.array(l[:3], dtype=np.uint64) assert_equal(map(int,a), li[:3]) #class TestRepr(TestCase): # def test_repr(self): # for t in types: # val = t(1197346475.0137341) # val_repr = repr(val) # val2 = eval(val_repr) # assert_equal( val, val2 ) class TestRepr(TestCase): def _test_type_repr(self, t): finfo=np.finfo(t) last_fraction_bit_idx = finfo.nexp + finfo.nmant last_exponent_bit_idx = finfo.nexp storage_bytes = np.dtype(t).itemsize*8 # could add some more types to the list below for which in ['small denorm','small norm']: # Values from http://en.wikipedia.org/wiki/IEEE_754 constr = np.array([0x00]*storage_bytes,dtype=np.uint8) if which == 'small denorm': byte = last_fraction_bit_idx // 8 bytebit = 7-(last_fraction_bit_idx % 8) constr[byte] = 1<