o
    §ƒðjZ  ã                   @   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   ú /tmp/claude-1000/-var-www-html-academy/3f42efd1-c2b7-4d08-9b05-30d86bb35479/scratchpad/piper/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    	