• File: test_arrayprint.pyo
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyo
  • Date Modified: 12/19/2017 2:16 PM
  • File size: 10.33 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

9Zc@`sddlmZmZmZddlZddlZddlmZddl	m
Z
mZmZm
Z
defdYZde
fdYZd	e
fd
YZdddYZd
ZedkrendS(i(tdivisiontabsolute_importtprint_functionN(tsixu(tTestCasetrun_module_suitetassert_tassert_equalt
TestArrayReprcB`seZdZRS(cC`s2tjtjtjg}tt|ddS(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`seZdZRS(clC`s"dddtjtjtjg}g|D]"}|D]}t||^q3q)}tjtjtjg}g|D].}|D]!}ttj|g|^qzqp}ddddddddd	d
d
dd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
|
|kqWdS(CNiiis	[ 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Rtcomplext	complex64tcdoubletclongdoubletstrR
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#eZdZdZdZRS(cC`sKtjd}ttj|dkttj|dddkdS(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`s5tjtjddd}t|dkdS(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.pyt<lambda>JssValue 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`sd}tjd}tjddkr:d}d}nd}d}ttj|di|d	6d
kttj|di|d6d
kttj|didd	6d
kttj|didd6|ttj|didd6|tjd}ttj|didd6dkttj|didd6dktjddg}ttj|didd6dkdS(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;eZdZdZdZdZdZdZRS(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|dtjddtt|ddS(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}tjdidd6tt|ddS(NiR5cS`st|dS(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_formatterscC`s~tjd}tjdidd6tt|dtjdidd6tt|dtjdidd6tt|dtjdidd6tt|dtjdid	d6tt|dtjdidd
6tt|dtjd}tjdidd
6tt|dtjdidd6tt|ddS(NiR5cS`st|dS(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|dS(Ni(R(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-scS`st|dS(Ni(R(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyR-sR7g@cS`st|dS(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_resets$(RRt__doc__RIRKR+RMRO(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyRFts				cC`scddl}|jddkr(d}nd}tjtdgdt}tt||dS(Niisarray(['é'], dtype=object)sarray([u'\xe9'], dtype=object)stdtype(RARBR	R
RtobjectRR
(RAtexpectedR((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_arrayprint.pyttest_unicode_object_arrays	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.pyt<module>s"/4+