U
    b#                     @   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   p/home/fireinfo/NEWAFireInfo/venv/lib/python3.8/site-packages/numpy/array_api/tests/test_elementwise_functions.pynargs   s    r   c               9      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8} dd	 }| D ]|   D ]|\}}t| }tt| t d
kr| D ].j|ksԈj|krtt fdd qqj|krtt fdd qqd S )Nnumericzfloating-pointzinteger or booleanintegerallboolean)8absacosacoshaddasinasinhatanatan2atanhZbitwise_andZbitwise_invertr   Z
bitwise_orr   Zbitwise_xorceilcoscoshdivideequalexpexpm1floorZfloor_divideZgreaterZgreater_equal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	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_valsS   s    z(test_function_types.<locals>._array_valsr   c                      s
    S r   r   r   r   xyr   r   <lambda>b       z%test_function_types.<locals>.<lambda>c                      s    S r   r   r   )r   rF   r   r   rH   e   rI   )itemsr	   getattrr   r   rB   r   	TypeError)Z elementwise_function_input_typesrD   	func_nametypesZdtypesr   rE   r   test_function_types   s    ;



rO   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 NrA   )r   r   r   r   r   r   rH   k   rI   z*test_bitwise_shift_error.<locals>.<lambda>c                   S   s   t tddgtddgS rP   )r   r   r   r   r   r   rH   n   rI   )r   
ValueErrorr   r   r   r   test_bitwise_shift_errorh   s      rS   N)inspectr   Znumpy.testingr    r   r   r   r   Z_dtypesr	   r
   r   r   r   rO   rS   r   r   r   r   <module>   s   U