o
    	h                      @   sF   d dl Zd dlZd dlmZmZ d dlmZ G dd dZ	dd Z
dS )    N)assert_allclosesuppress_warningsc                   @   sH   e Zd Zejjdd Zejdg dejdg ddd Zd	S )
TestSphHarmc                 C   s  d}d}t dt j}t ddt j }t ||\}}tj||||dd\}}}tj|||dd\}}	}
t t |d t | dg}t j	|dt
td|jd  d}t||t d	| |   t|d
 |	t d	| |   t|d d	| | t d	| |   t|d |
t d	| |   t|d d	| |	 t d	| |   t|d |d  t|d | | | t d	| |   d S )N   
   r      )diff_n   r   axis              ?).r   ).r	   ).r   r   ).r   r	   ).r	   r   ).r	   r	   )nplinspacepimeshgridscsph_harm_y_allsph_legendre_p_allconcatenatearangeexpand_dimstuplerangendimr   exp)selfm_maxn_maxthetaphiyy_jacy_hesspp_jacp_hessm r(   U/var/www/vscode/kcb/lib/python3.10/site-packages/scipy/special/tests/test_sph_harm.pytest_p   s    "" ( (.zTestSphHarm.test_pr   )   r   2   r   )r	         	      c           	      C   s   t dt j}t ddt j }t |d }t j|ttd|jd d}t t |d t | dg}t j|dttd|jd  d}t	
||||}t	||||}t jj||dd d S )Nr   r   r	   r   r
   gh㈵>)rtol)r   r   r   r   r   r   r   r   r   r   r   
sph_harm_ytestingr   )	r   r   r   r   r    nr'   y_actual	y_desiredr(   r(   r)   test_all!   s   ""zTestSphHarm.test_allN)	__name__
__module____qualname__pytestmarkslowr*   parametrizer7   r(   r(   r(   r)   r      s    
r   c                  C   s   dd } dd }dd }dd }| |||g}g d	}g d
}t ddt j }t dt j}t ||\}}t|||D ]7\}	}}t '}
|
jtd tt	
|||||	||ddd| d| dd W d    n1 snw   Y  q<d S )Nc                 S   s   dt dt j  S )N      ?r	   )r   sqrtr   r   r    r(   r(   r)   Y00<   s   z!test_first_harmonics.<locals>.Y00c                 S   0   dt ddt j   t d|   t | S )Nr?      r   y             r   r@   r   r   sinrA   r(   r(   r)   Yn11?      0z"test_first_harmonics.<locals>.Yn11c                 S   s   dt dt j  t | S )Nr?   rD   )r   r@   r   cosrA   r(   r(   r)   Y01B   s   z!test_first_harmonics.<locals>.Y01c                 S   rC   )Ng      rD   r   r   rE   rA   r(   r(   r)   Y11E   rH   z!test_first_harmonics.<locals>.Y11)r   r   r	   )r   r	   r	   r	   r   r   )categorygV瞯<zY^_z
 incorrect)r1   atolerr_msg)r   r   r   r   zipr   filterDeprecationWarningr   r   sph_harm)rB   rG   rJ   rK   harmsr'   r4   r   r    harmsupr(   r(   r)   test_first_harmonics2   s*   
rX   )numpyr   r;   numpy.testingr   r   scipy.specialspecialr   r   rX   r(   r(   r(   r)   <module>   s    +