Current File : //usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyc |
�
E�`Qc @ s\ d d l Z d d l Td d l Z d d l Z d d l Z d d l m Z i d e j 6d e j 6d e j 6Z d � Z
d � Z d � Z d
� Z
d � Z d � Z d
� Z d � Z d d � Z d � Z d � Z d � Z d � Z e j e j d d k � d � � Z d � Z e d � � Z e d � � Z e d � � Z e d k rXe! � n d S( i����N( t *( t StringIOt infs -inft nanc C s� xI d d d d g D]5 } t t | | � � t t | � � d d | �q W| d � j d k r� t t | d � � t t d � � d d | �ng t j d
k r� t j d d k r� t j d d k r� d
} n d } t t | d � � | d d | �d S( Ni i i����g@��x�Dt err_msgs! Failed str formatting for type %sg _�Bi t 1e10t win32i i s 1e+010s 1e+10( t assert_equalt strt floatt itemsizet syst platformt version_info( t tpt xt ref( ( sA /usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyt check_float_type s $$" c c s2 x+ t j t j t j g D] } t | f Vq Wd S( 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( t npt float32t doublet
longdoubleR ( t t( ( sA /usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyt test_float_types s c C sO xH t j t j t j g D]- } t t | | � � t | d d | �q Wd S( NR s! Failed str formatting for type %s( R R R R R t _REF( R R ( ( sA /usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyt check_nan_inf_float( s c c s2 x+ t j t j t j g D] } t | f Vq Wd S( 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( R R R R R ( R ( ( sA /usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyt test_nan_inf_float- s c C st x� d d d d g D]� } t t | | � � t t | � � d d | �t t | | d � � t t | d � � d d | �t t | | | d � � t t | | d � � d d | �q W| d � j d k r t t | d � � t t d � � d d | �ng t j d
k rGt j d d k rGt j d d k rGd
} n d } t t | d � � | d d | �d S( Ni i i����g@��x�DR s! Failed str formatting for type %sy �?g _�Bi R i i s (1e+010+0j)s
(1e+10+0j)( R R t complexR
R R R
( R R R ( ( sA /usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyt check_complex_type8 s $,4$" c c s2 x+ t j t j t j g D] } t | f Vq Wd S( 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( R t complex64t cdoublet clongdoubleR ( R ( ( sA /usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyt test_complex_typesM s c c s� t j d d k rTi d t t j d � 6d t d t j � 6d t t j d � 6d t d t j � 6d t t j d � 6d
t d t j � 6d t t j d � 6d t d t j � 6d
t t j d � 6d t d t j � 6d
t t j d � 6d t d t j � 6d t t j d � 6d t d t j � 6d t t j d � 6d t d t j � 6} n>i d t t j d � 6d t d t j � 6d t t j d � 6d t d t j � 6d t t j d � 6d t d t j � 6d t t j d � 6d t d t j � 6d
t t j d � 6d t d t j � 6d
t t j d � 6d t d t j � 6d t t j d � 6d t d t j � 6d t t j d � 6d t d t j � 6} xN t j t j t j g D]4 } x+ | j � D] \ } } t
| | | f Vq�Wq�Wd S( s* Check inf/nan formatting of complex types.i i s (inf+0j)i s inf*js (-inf+0j)s -inf*js (inf+1j)i s (1+inf*j)s (-inf+1j)s (1-inf*j)s (nan+0j)s nan*js (nan+1j)s (1+nan*j)t infjs -infjs (1+infj)s (1-infj)t nanjs (1+nanj)N( i i ( R R
R R R R R R R t itemst _check_complex_inf_nan( t TESTSR t ct s( ( sA /usr/lib64/python2.7/site-packages/numpy/core/tests/test_print.pyt test_complex_inf_nanX sL c C s t t | | � � | � d S( N( R R ( R&