o
    ohZ                     @   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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raises)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   prntr r   r/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/sympy/printing/tests/test_cupy.pytest_cupy_print   s   r   c                  C   s>   t  } tt | d W d    d S 1 sw   Y  d S )Nzabcd(x))r   r   NotImplementedErrorr   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   .0i_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   linspaceallclosesumrange)sfa_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.nan
EulerGammazcupy.euler_gammaacoszcupy.arccosr   zcupy.log)r   r   r   r   r   r   test_cupy_known_funcs_consts.   s   r3   c                  C   s&   t  } t| ds
J t| dsJ d S )N_print_acos
_print_log)r   hasattrr   r   r   r   test_cupy_print_methods5   s   r7   N)sympy.concrete.summationsr   &sympy.functions.elementary.exponentialr   (sympy.functions.elementary.miscellaneousr   sympy.utilities.lambdifyr   	sympy.abcr   r   r   r	   sympy.codegen.numpy_nodesr
   sympy.printing.numpyr   r   r   sympy.testing.pytestr   r   sympy.externalr   r&   r   r   r/   r3   r7   r   r   r   r   <module>   s    	