/
usr
/
lib64
/
python2.6
/
site-packages
/
numpy
/
core
/
tests
/
/usr/lib64/python2.6/site-packages/numpy/core/tests
mkdir
upload
Name
Size
Mode
Actions
data/
-
0755
rm
test_blasdot.py
465
0644
edit
dl
rm
test_blasdot.pyc
990
0644
edit
dl
rm
test_blasdot.pyo
990
0644
edit
dl
rm
test_defchararray.py
23583
0644
edit
dl
rm
test_defchararray.pyc
36847
0644
edit
dl
rm
test_defchararray.pyo
32392
0644
edit
dl
rm
test_dtype.py
3987
0644
edit
dl
rm
test_dtype.pyc
6546
0644
edit
dl
rm
test_dtype.pyo
6546
0644
edit
dl
rm
test_errstate.py
1712
0644
edit
dl
rm
test_errstate.pyc
1654
0644
edit
dl
rm
test_errstate.pyo
1654
0644
edit
dl
rm
test_function_base.py
984
0644
edit
dl
rm
test_function_base.pyc
2319
0644
edit
dl
rm
test_function_base.pyo
2017
0644
edit
dl
rm
test_getlimits.py
1630
0644
edit
dl
rm
test_getlimits.pyc
3799
0644
edit
dl
rm
test_getlimits.pyo
3799
0644
edit
dl
rm
test_machar.py
1000
0644
edit
dl
rm
test_machar.pyc
1705
0644
edit
dl
rm
test_machar.pyo
1705
0644
edit
dl
rm
test_memmap.py
2101
0644
edit
dl
rm
test_memmap.pyc
3341
0644
edit
dl
rm
test_memmap.pyo
3289
0644
edit
dl
rm
test_multiarray.py
51858
0644
edit
dl
rm
test_multiarray.pyc
70254
0644
edit
dl
rm
test_multiarray.pyo
69639
0644
edit
dl
rm
test_numeric.py
30773
0644
edit
dl
rm
test_numeric.pyc
48028
0644
edit
dl
rm
test_numeric.pyo
45970
0644
edit
dl
rm
test_numerictypes.py
14194
0644
edit
dl
rm
test_numerictypes.pyc
17908
0644
edit
dl
rm
test_numerictypes.pyo
17572
0644
edit
dl
rm
test_print.py
8091
0644
edit
dl
rm
test_print.pyc
9224
0644
edit
dl
rm
test_print.pyo
9224
0644
edit
dl
rm
test_records.py
5325
0644
edit
dl
rm
test_records.pyc
9183
0644
edit
dl
rm
test_records.pyo
8534
0644
edit
dl
rm
test_regression.py
43097
0644
edit
dl
rm
test_regression.pyc
67025
0644
edit
dl
rm
test_regression.pyo
62503
0644
edit
dl
rm
test_scalarmath.py
3789
0644
edit
dl
rm
test_scalarmath.pyc
5395
0644
edit
dl
rm
test_scalarmath.pyo
5096
0644
edit
dl
rm
test_shape_base.py
4571
0644
edit
dl
rm
test_shape_base.pyc
8890
0644
edit
dl
rm
test_shape_base.pyo
8326
0644
edit
dl
rm
test_ufunc.py
16944
0644
edit
dl
rm
test_ufunc.pyc
18366
0644
edit
dl
rm
test_ufunc.pyo
18135
0644
edit
dl
rm
test_umath.py
35991
0644
edit
dl
rm
test_umath.pyc
54765
0644
edit
dl
rm
test_umath.pyo
51377
0644
edit
dl
rm
test_umath_complex.py
17728
0644
edit
dl
rm
test_umath_complex.pyc
16886
0644
edit
dl
rm
test_umath_complex.pyo
16886
0644
edit
dl
rm
test_unicode.py
11255
0644
edit
dl
rm
test_unicode.pyc
15070
0644
edit
dl
rm
test_unicode.pyo
15070
0644
edit
dl
rm
Edit:
/usr/lib64/python2.6/site-packages/numpy/core/tests/test_shape_base.py
(4571B)
from numpy.testing import * from numpy.core import array, atleast_1d, atleast_2d, atleast_3d, vstack, \ hstack, newaxis class TestAtleast1d(TestCase): def test_0D_array(self): a = array(1); b = array(2); res=map(atleast_1d,[a,b]) desired = [array([1]),array([2])] assert_array_equal(res,desired) def test_1D_array(self): a = array([1,2]); b = array([2,3]); res=map(atleast_1d,[a,b]) desired = [array([1,2]),array([2,3])] assert_array_equal(res,desired) def test_2D_array(self): a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]); res=map(atleast_1d,[a,b]) desired = [a,b] assert_array_equal(res,desired) def test_3D_array(self): a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]); a = array([a,a]);b = array([b,b]); res=map(atleast_1d,[a,b]) desired = [a,b] assert_array_equal(res,desired) def test_r1array(self): """ Test to make sure equivalent Travis O's r1array function """ assert(atleast_1d(3).shape == (1,)) assert(atleast_1d(3j).shape == (1,)) assert(atleast_1d(3L).shape == (1,)) assert(atleast_1d(3.0).shape == (1,)) assert(atleast_1d([[2,3],[4,5]]).shape == (2,2)) class TestAtleast2d(TestCase): def test_0D_array(self): a = array(1); b = array(2); res=map(atleast_2d,[a,b]) desired = [array([[1]]),array([[2]])] assert_array_equal(res,desired) def test_1D_array(self): a = array([1,2]); b = array([2,3]); res=map(atleast_2d,[a,b]) desired = [array([[1,2]]),array([[2,3]])] assert_array_equal(res,desired) def test_2D_array(self): a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]); res=map(atleast_2d,[a,b]) desired = [a,b] assert_array_equal(res,desired) def test_3D_array(self): a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]); a = array([a,a]);b = array([b,b]); res=map(atleast_2d,[a,b]) desired = [a,b] assert_array_equal(res,desired) def test_r2array(self): """ Test to make sure equivalent Travis O's r2array function """ assert(atleast_2d(3).shape == (1,1)) assert(atleast_2d([3j,1]).shape == (1,2)) assert(atleast_2d([[[3,1],[4,5]],[[3,5],[1,2]]]).shape == (2,2,2)) class TestAtleast3d(TestCase): def test_0D_array(self): a = array(1); b = array(2); res=map(atleast_3d,[a,b]) desired = [array([[[1]]]),array([[[2]]])] assert_array_equal(res,desired) def test_1D_array(self): a = array([1,2]); b = array([2,3]); res=map(atleast_3d,[a,b]) desired = [array([[[1],[2]]]),array([[[2],[3]]])] assert_array_equal(res,desired) def test_2D_array(self): a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]); res=map(atleast_3d,[a,b]) desired = [a[:,:,newaxis],b[:,:,newaxis]] assert_array_equal(res,desired) def test_3D_array(self): a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]); a = array([a,a]);b = array([b,b]); res=map(atleast_3d,[a,b]) desired = [a,b] assert_array_equal(res,desired) class TestHstack(TestCase): def test_0D_array(self): a = array(1); b = array(2); res=hstack([a,b]) desired = array([1,2]) assert_array_equal(res,desired) def test_1D_array(self): a = array([1]); b = array([2]); res=hstack([a,b]) desired = array([1,2]) assert_array_equal(res,desired) def test_2D_array(self): a = array([[1],[2]]); b = array([[1],[2]]); res=hstack([a,b]) desired = array([[1,1],[2,2]]) assert_array_equal(res,desired) class TestVstack(TestCase): def test_0D_array(self): a = array(1); b = array(2); res=vstack([a,b]) desired = array([[1],[2]]) assert_array_equal(res,desired) def test_1D_array(self): a = array([1]); b = array([2]); res=vstack([a,b]) desired = array([[1],[2]]) assert_array_equal(res,desired) def test_2D_array(self): a = array([[1],[2]]); b = array([[1],[2]]); res=vstack([a,b]) desired = array([[1],[2],[1],[2]]) assert_array_equal(res,desired) def test_2D_array2(self): a = array([1,2]); b = array([1,2]); res=vstack([a,b]) desired = array([[1,2],[1,2]]) assert_array_equal(res,desired)
Save
cmd:
run