o
    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J | ttdksJ | ttdks%J | ddks.J | ddks7J | dd	ks@J 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	   r   r   r   Zprntr r   ND:\Projects\ConvertPro\env\Lib\site-packages\sympy/printing/tests/test_cupy.pytest_cupy_print   s   r   c                  C   s   t  } d| dv sJ d S )NzNot supportedzabcd(x))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>J 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 svJ d S )NzCuPy not installedr   )r   
      r   c                 3   s    | ]} | V  qd S Nr   .0Zi_Zx_r   r   	<genexpr>$       z test_cupy_sum.<locals>.<genexpr>numpyc                 3   s    | ]}|  V  qd S r   r   r   r   r   r   r   +   r   )cpr   r   r   r   r   r	   r   ZlinspaceZallclosesumrange)sfZa_Zb_r   r   r   test_cupy_sum   s   48r&   c                   C   sD   t d dksJ t d dksJ td dksJ td dks J d S )	NNaNzcupy.nanZ
EulerGammazcupy.euler_gammaacoszcupy.arccosr   zcupy.log)r   r   r   r   r   r   test_cupy_known_funcs_consts-   s   r)   c                  C   s&   t  } t| ds
J t| dsJ d S )NZ_print_acosZ
_print_log)r   hasattrr   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    	