Current File : //usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyc
�
E�`Qc@s\ddlZddlTddlZddlZddlZddlmZidej6dej6dej6Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zdd�Zd�Zd�Zd�Zd�Zejejd dk�d��Zd�Zed��Zed��Zed��Ze dkrXe!�ndS(i����N(t*(tStringIOtinfs-inftnancCs�xIddddgD]5}tt||��tt|��dd|�qW|d�jdkr�tt|d��ttd	��dd|�ngtjd
kr�tjddkr�tjddkr�d
}nd}tt|d��|dd|�dS(Niii����g@��x�Dterr_msgs!Failed str formatting for type %sg _�Bit1e10twin32iis1e+010s1e+10(tassert_equaltstrtfloattitemsizetsystplatformtversion_info(ttptxtref((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pytcheck_float_types$$"	ccs2x+tjtjtjgD]}t|fVqWdS(s� Check formatting.

        This is only for the str function, and only for simple types.
        The precision of np.float and np.longdouble aren't the same as the
        python float precision.

    N(tnptfloat32tdoublet
longdoubleR(tt((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyttest_float_typesscCsOxHtjtjtjgD]-}tt||��t|dd|�qWdS(NRs!Failed str formatting for type %s(RRRRRt_REF(RR((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pytcheck_nan_inf_float(s ccs2x+tjtjtjgD]}t|fVqWdS(s� Check formatting of nan & inf.

        This is only for the str function, and only for simple types.
        The precision of np.float and np.longdouble aren't the same as the
        python float precision.

    N(RRRRR(R((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyttest_nan_inf_float-scCstx�ddddgD]�}tt||��tt|��dd|�tt||d��tt|d��dd|�tt|||d��tt||d��dd|�qW|d�jd	kr	tt|d��ttd��dd|�ngtjd
krGtjddkrGtjddkrGd
}nd}tt|d��|dd|�dS(Niii����g@��x�DRs!Failed str formatting for type %sy�?g _�BiRiis(1e+010+0j)s
(1e+10+0j)(RRtcomplexR
RRR
(RRR((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pytcheck_complex_type8s $,4$"	ccs2x+tjtjtjgD]}t|fVqWdS(s�Check formatting of complex types.

        This is only for the str function, and only for simple types.
        The precision of np.float and np.longdouble aren't the same as the
        python float precision.

    N(Rt	complex64tcdoubletclongdoubleR(R((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyttest_complex_typesMsccs�tjd dkrTidttjd�6dtdtj�6dttjd�6dtdtj�6dttjd	�6d
td	tj�6dttjd	�6dtd	tj�6d
ttjd�6dtdtj�6d
ttjd�6dtdtj�6dttjd	�6dtd	tj�6dttjd	�6dtd	tj�6}n>idttjd�6dtdtj�6dttjd�6dtdtj�6dttjd	�6dtd	tj�6dttjd	�6dtd	tj�6d
ttjd�6dtdtj�6d
ttjd�6dtdtj�6dttjd	�6dtd	tj�6dttjd	�6dtd	tj�6}xNtjtjtjgD]4}x+|j	�D]\}}t
|||fVq�Wq�WdS(s*Check inf/nan formatting of complex types.iis(inf+0j)isinf*js	(-inf+0j)s-inf*js(inf+1j)is	(1+inf*j)s	(-inf+1j)s	(1-inf*j)s(nan+0j)snan*js(nan+1j)s	(1+nan*j)tinfjs-infjs(1+infj)s(1-infj)tnanjs(1+nanj)N(ii(RR
RRRRRRRtitemst_check_complex_inf_nan(tTESTSRtcts((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyttest_complex_inf_nanXsLcCstt||��|�dS(N(RR(R&R'tdtype((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyR$�scCs�t�}t�}tj}z4|t_||�GH|t_|rI|GHn|GHWd|t_Xt|j�|j�dd|�dS(NRsprint failed for type%s(RRtstdoutRtgetvalue(RRRtfiletfile_tpR*((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyt_test_redirected_print�s						
cCs�x-ddddgD]}tt|�|�qWx;tjtjtjgD] }tt|�|t|�qJW|d�jdkr�ttd�|�nZtjdkr�tj	ddkr�tj	dd	kr�d
}nd}ttd�||�dS(Niii����g@��x�Dg _�BiRiis1e+010s1e+10(
R.R	RRRRR
RRR
(RRR((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pytcheck_float_type_print�s "	cCsx-ddddgD]}tt|�|�qW|d�jdkr[ttd�|�nZtjdkr�tjddkr�tjdd	kr�d
}nd}ttd�||�tttjd�|d�tttjd�|d
�tttjd�|d�dS(Niii����g@��x�Dg _�BiRiis(1e+010+0j)s
(1e+10+0j)s(inf+1j)s	(-inf+1j)s(nan+1j)(	R.RR
RRR
RRR(RRR((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pytcheck_complex_type_print�s"	ccs2x+tjtjtjgD]}t|fVqWdS(s"Check formatting when using print N(RRRRR/(R((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyttest_float_type_print�sccs2x+tjtjtjgD]}t|fVqWdS(s"Check formatting when using print N(RRRRR0(R((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyttest_complex_type_print�siicCs�dttjfdttjfddtjfddtjfddtjfddtjfddtjfddtj	fdd	tj
fdd
tjfddtjfddtj
fddtjfddtjfg}tjd
 dkr%|ddtjfddtjfddtjfg7}nx�|D]�\}}}y6t|j|�|j||��d||f�Wq,tk
r�}ttd|t|�t|�t|�f�q,Xq,WdS(s2Test the str.format method with NumPy scalar typess{0}s{0:d}i�iP�I^вl�RU
i����iЊ��ilʈIDl۞s{0:g}g�?iiy�?sfailed with val %s, type %ss=format raised exception (fmt='%s', val=%s, type=%s, exc='%s')N(iiy�?�?y�?�?y�?�?(tTrueRtbool_tFalsetuint8tuint16tuint32tuint64tint8tint16tint32tint64tfloat16Rtfloat64RRR
Rt
complex128RRtformatt
ValueErrortassert_treprR(tteststfmattvaltvaltypete((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyttest_scalar_format�s4!csUtjdkrdg�nddddg���fd�}tjj��|�S(s
    Swap LC_NUMERIC locale to one in which the decimal point is ',' and not '.'
    If not possible, raise nose.SkipTest

    RtFRENCHtfr_FRsfr_FR.UTF-8tfi_FIsfi_FI.UTF-8cs�tjtj�}z`xL�D]5}ytjtj|�PWqtjk
rPqXqWtjd���||�SWdtjtjd|�XdS(Ns5Skipping locale test, because French locale not foundtlocale(RNt	getlocalet
LC_NUMERICt	setlocaletErrortnosetSkipTest(targstkwargstcurloctloc(tfunctlocales(sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pytwrapper�s
(RRRSttoolstmake_decorator(RYR[((RYRZsA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pytin_foreign_locale�s
cCs,tttjd��ttd���dS(Ng333333�?(RRRRR	(((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyttest_locale_singlescCs,tttjd��ttd���dS(Ng333333�?(RRRRR	(((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyttest_locale_doublescCs,tttjd��ttd���dS(Ng333333�?(RRRRR	(((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyttest_locale_longdoublest__main__(ii("tnumpyRt
numpy.testingRSRNRRRRRRRRRRR R(R$tNoneR.R/R0R1R2tdectskipifR
RJR^R_R`Rat__name__trun_module_suite(((sA/usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyt<module>s4
%							,					%"