a
    ;e                     @   sl   d dl mZ d dlmZ ddlmZmZ ddlmZmZ ddl	m
Z
mZmZmZ dd Zd	d
 Zdd ZdS )    )getfullargspec)assert_raises   )asarray_elementwise_functions)bitwise_left_shiftbitwise_right_shift)_dtype_categories_boolean_dtypes_floating_dtypes_integer_dtypesc                 C   s   t t| jS N)lenr   args)func r   d/var/www/sunrise/env/lib/python3.9/site-packages/numpy/array_api/tests/test_elementwise_functions.pynargs   s    r   c               <      s  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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dddddddd
;} dd }| D ]|   D ]|\}}t| }tt| t dkr| D ].j|vsڈj|vrtt fdd qqj|vrtt fdd qqd S )Nnumericzfloating-pointzreal floating-pointzinteger or booleanintegerzreal numericzcomplex floating-pointallboolean);absacosacoshaddasinasinhatanatan2atanhZbitwise_andZbitwise_invertr   Z
bitwise_orr   Zbitwise_xorceilZconjcoscoshdivideequalexpexpm1floorZfloor_divideZgreaterZgreater_equalimagisfiniteisinfisnanZlessZ
less_equallogZ	logaddexplog10log1plog2logical_andZlogical_not
logical_orlogical_xormultiplynegative	not_equalZpositivepowreal	remainderroundsignsinsinhsqrtZsquaresubtracttantanhtruncc                  s   sL   t D ]} td| dV  qtD ]} td| dV  qtD ]} td| dV  q4d S )N   )dtypeFg      ?)r   r   r
   r   )dr   r   r   _array_valsV   s    z(test_function_types.<locals>._array_valsr   c                      s
    S r   r   r   r   xyr   r   <lambda>e       z%test_function_types.<locals>.<lambda>c                      s    S r   r   r   )r   rH   r   r   rJ   h   rK   )itemsr	   getattrr   r   rD   r   	TypeError)Z elementwise_function_input_typesrF   	func_nametypesZdtypesr   rG   r   test_function_types   s    >



rQ   c                   C   s    t tdd  t tdd  d S )Nc                   S   s   t tddgtddgS NrC   )r   r   r   r   r   r   rJ   n   rK   z*test_bitwise_shift_error.<locals>.<lambda>c                   S   s   t tddgtddgS rR   )r   r   r   r   r   r   rJ   q   rK   )r   
ValueErrorr   r   r   r   test_bitwise_shift_errork   s    rU   N)inspectr   Znumpy.testingr    r   r   r   r   Z_dtypesr	   r
   r   r   r   rQ   rU   r   r   r   r   <module>   s   X