ó É9Zc@`sÞddlmZmZmZddlZddlZddlmZddl m Z m Z m Z m Z defd„ƒYZde fd„ƒYZd e fd „ƒYZd dd „ƒYZd „ZedkrÚe ƒndS(i(tdivisiontabsolute_importtprint_functionN(tsixu(tTestCasetrun_module_suitetassert_t assert_equalt TestArrayReprcB`seZd„ZRS(cC`s2tjtjtjgƒ}tt|ƒdƒdS(Nsarray([ nan, inf])(tnptarraytnantinfRtrepr(tselftx((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyt test_nan_inf s(t__name__t __module__R(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR stTestComplexArraycB`seZd„ZRS(c lC`s"dddtjtj tjg}g|D]"}|D]}t||ƒ^q3q)}tjtjtjg}g|D].}|D]!}ttj|g|ƒƒ^qzqp}ddddddddd d d d d d d dddddddddddddddddddddddddddd d d!d"d"d#d$d$d%d&d&d'd(d(d)d*d*d+d,d,d-d.d.d.d/d/d/d0d0d0d1d1d2d3d3d4d5d5d6d7d7d7d8d8d8d9d9d9d:d:d;d<d<d=d>d>d?d@d@d@dAdAdAdBdBdBgl} x-t || ƒD]\} } t | | kƒqþWdS(CNiiiÿÿÿÿs [ 0.+0.j]s [ 0.0+0.0j]s [ 0.+1.j]s [ 0.0+1.0j]s [ 0.-1.j]s [ 0.0-1.0j]s [ 0.+infj]s [ 0.0+infj]s [ 0.-infj]s [ 0.0-infj]s [ 0.+nanj]s [ 0.0+nanj]s [ 1.+0.j]s [ 1.0+0.0j]s [ 1.+1.j]s [ 1.0+1.0j]s [ 1.-1.j]s [ 1.0-1.0j]s [ 1.+infj]s [ 1.0+infj]s [ 1.-infj]s [ 1.0-infj]s [ 1.+nanj]s [ 1.0+nanj]s [-1.+0.j]s [-1.0+0.0j]s [-1.+1.j]s [-1.0+1.0j]s [-1.-1.j]s [-1.0-1.0j]s [-1.+infj]s [-1.0+infj]s [-1.-infj]s [-1.0-infj]s [-1.+nanj]s [-1.0+nanj]s [ inf+0.j]s [ inf+0.0j]s [ inf+1.j]s [ inf+1.0j]s [ inf-1.j]s [ inf-1.0j]s [ inf+infj]s [ inf-infj]s [ inf+nanj]s [-inf+0.j]s [-inf+0.0j]s [-inf+1.j]s [-inf+1.0j]s [-inf-1.j]s [-inf-1.0j]s [-inf+infj]s [-inf-infj]s [-inf+nanj]s [ nan+0.j]s [ nan+0.0j]s [ nan+1.j]s [ nan+1.0j]s [ nan-1.j]s [ nan-1.0j]s [ nan+infj]s [ nan-infj]s [ nan+nanj]( R R R tcomplext complex64tcdoublet clongdoubletstrR tzipR( Rtrvalstrptiptcvalstdtypestctdttactualtwantedtrestval((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyttest_strsT"/;                                   (RRR%(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyRstTestArray2StringcB`s#eZd„Zd„Zd„ZRS(cC`sKtjdƒ}ttj|ƒdkƒttj|ddƒdkƒdS(sBasic test of array2string.is[0 1 2]tmax_line_widthis[0 1 2]N(R tarangeRt array2string(Rta((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyt test_basicAscC`s5tjtjdƒdd„ƒ}t|dkƒdS(s0This should only apply to 0-D arrays. See #1218.gø?tstylecS`sdt|ƒS(NsValue in 0-D array: (R(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pytJssValue in 0-D array: 1.5N(R R)R R(Rtstylestr((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyttest_style_keywordGs cC`sªd„}tjdƒ}tjddkr:d}d}n d}d}ttj|di|d 6ƒd kƒttj|di|d 6ƒd kƒttj|did „d 6ƒd kƒttj|did„d6ƒ|ƒttj|did„d6ƒ|ƒtjdƒ}ttj|did„d6ƒdkƒttj|did„d6ƒdkƒtjddgƒ}ttj|did„d6ƒdkƒdS(s6Test custom format function for each element in array.cS`s:tj|ƒdkrdStj|ƒdkr2dSdSdS(Nit.itotO(R tabs(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyt_format_functionOs iis [0x0 0x1 0x2]s [0o0 0o1 0o2]s[0x0L 0x1L 0x2L]s [0L 01L 02L]t formattertalls[. o O]tint_kindcS`sd|S(Ns%.4f((R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-bss[0.0000 1.0000 2.0000]cS`s t|ƒS(N(thex(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-dstintcS`s t|ƒS(N(toct(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-fsg@cS`sd|S(Ns%.2f((R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-jst float_kinds[0.00 1.00 2.00]cS`sd|S(Ns%.2f((R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-lstfloattabctdefcS`s|dS(Ni((ts((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-pstnumpystrs[abcabc defdef]N(R R(tsyst version_infoRR)RR (RR4Rtx_hextx_octR?((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyttest_format_functionMs2       (RRR+R/RE(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR&@s  tTestPrintOptionscB`s;eZdZd„Zd„Zd„Zd„Zd„ZRS(s.Test getting and setting global print options.cC`stjƒ|_dS(N(R tget_printoptionstoldopts(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pytsetUpwscC`stj|jdS(N(R tset_printoptionsRH(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyttearDownzscC`sRtjdddgƒ}tt|ƒdƒtjddƒtt|ƒdƒdS(Ngø?igÞƒBÊÀó?s.array([ 1.5 , 0. , 1.23456789])t precisionis"array([ 1.5 , 0. , 1.2346])(R R RR RJ(RR((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR+}scC`s@tjdƒ}tjdid„d6ƒtt|ƒdƒdS(NiR5cS`st|dƒS(Ni(R(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-…sR6sarray([-1, 0, 1])(R R(RJRR (RR((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyttest_formatterƒscC`s~tjdƒ}tjdid„d6ƒtt|ƒdƒtjdidd6ƒtt|ƒdƒtjdid„d6ƒtt|ƒdƒtjdidd6ƒtt|ƒdƒtjdid „d6ƒtt|ƒdƒtjdidd 6ƒtt|ƒdƒtjd ƒ}tjdid „d 6ƒtt|ƒdƒtjdidd6ƒtt|ƒdƒdS(NiR5cS`st|dƒS(Ni(R(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-ŠsR6sarray([-1, 0, 1])R9sarray([0, 1, 2])cS`st|dƒS(Ni(R(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-scS`st|dƒS(Ni(R(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-”sR7g@cS`st|dƒS(Ni(R(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-šsR<sarray([-1.0, 0.0, 1.0])R;sarray([ 0., 1., 2.])(R R(RJRR tNone(RR((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyttest_formatter_resetˆs$(RRt__doc__RIRKR+RMRO(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyRFts     cC`scddl}|jddkr(d}nd}tjtdƒgdtƒ}tt|ƒ|ƒdS(Niisarray(['é'], dtype=object)sarray([u'\xe9'], dtype=object)sétdtype(RARBR R RtobjectRR (RAtexpectedR((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyttest_unicode_object_arrayŸs   t__main__((t __future__RRRRAtnumpyR t numpy.compatRt numpy.testingRRRRRRRRR&RFRTR(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyts  "/4+