U
    	Ç-eB  ã                   @   s´   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZmZ d dlmZ d dlmZmZmZ d dlmZ d d	lmZ ed
ƒZdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )é    )ÚSum)Úlog)Úsqrt)Úlambdify)ÚxÚiÚaÚb)Ú	logaddexp)ÚCuPyPrinterÚ_cupy_known_constantsÚ_cupy_known_functions)Úskip)Úimport_moduleÚcupyc                  C   s„   t ƒ } |  tttƒ¡dkst‚|  ttƒ¡dks4t‚|  ttƒ¡dksJt‚|  d¡dks\t‚|  d¡dksnt‚|  d¡d	ks€t‚d S )
Nzcupy.logaddexp(a, b)zcupy.sqrt(x)zcupy.log(x)zacos(x)zcupy.arccos(x)zexp(x)zcupy.exp(x)zAbs(x)zabs(x))	r   Údoprintr
   r   r	   ÚAssertionErrorr   r   r   ©Zprntr© r   ú_/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/sympy/printing/tests/test_cupy.pyÚtest_cupy_print   s    r   c                  C   s   t ƒ } d|  d¡kst‚d S )NzNot supportedzabcd(x))r   r   r   r   r   r   r   Útest_not_cupy_print   s    r   c               	      sð   t stdƒ ttt tttfƒ} ttttf| dƒ}d\}}t  ddd¡‰ t  	|||ˆ ƒt
‡ fdd„t||d ƒD ƒƒ¡s|t‚ttt tttfƒ} ttttf| d	ƒ}d\}}t  ddd¡‰ t  	|||ˆ ƒt
‡ fd
d„t||d ƒD ƒƒ¡sìt‚d S )NzCuPy not installedr   )r   é
   éÿÿÿÿé   r   c                 3   s   | ]}ˆ | V  qd S ©Nr   ©Ú.0Zi_©Zx_r   r   Ú	<genexpr>$   s     z test_cupy_sum.<locals>.<genexpr>Únumpyc                 3   s   | ]}|ˆ  V  qd S r   r   r   r   r   r   r   +   s     )Úcpr   r   r   r   r   r	   r   ZlinspaceZallcloseÚsumÚranger   )ÚsÚfZa_Zb_r   r   r   Útest_cupy_sum   s    4r&   c                   C   sD   t d dkst‚t d dks t‚td dks0t‚td dks@t‚d S )	NÚNaNzcupy.nanZ
EulerGammazcupy.euler_gammaÚacoszcupy.arccosr   zcupy.log)r   r   r   r   r   r   r   Útest_cupy_known_funcs_consts-   s    r)   c                  C   s&   t ƒ } t| dƒst‚t| dƒs"t‚d S )NZ_print_acosZ
_print_log)r   Úhasattrr   r   r   r   r   Útest_cupy_print_methods4   s    r+   N)Zsympy.concrete.summationsr   Z&sympy.functions.elementary.exponentialr   Z(sympy.functions.elementary.miscellaneousr   Zsympy.utilities.lambdifyr   Z	sympy.abcr   r   r   r	   Zsympy.codegen.numpy_nodesr
   Zsympy.printing.numpyr   r   r   Zsympy.testing.pytestr   Zsympy.externalr   r!   r   r   r&   r)   r+   r   r   r   r   Ú<module>   s   	