o
    Ö­j½  ã                    @   s*  d dl mZ d dlZd dlZd dlmZmZmZ d dl	m
Z
 d dlmZmZ d dlZdZejjejjejjejjejjejjejjejjejjejjejjejjejjejejejjej ej!ej"ej#ej$ej%ej&ej'ej(ej)eej*ddd	�eej+ddd	�fZ,ejjejjejjejjejjejjejjejjejjejjejjejjejjejjejjejjejj ejj!ejj"ejj#ejj$ejj%ejj&ejj'ejj(ejj)eejj*ddd	�eejj+ddd	�fZ-e
je
je
je
je
je
je
je
je
je
je
je
je
je
je
je
je
j e
j!e
j"e
j#e
j$e
j%e
j&e
j'e
j(e
j)e
j*e
j+fZ.ej/ 0d
e1e-e,e.ƒ¡dd„ ƒZ2ejjejjejjejjejjejjejjejjejjejjejjejjejjejjejjejjejj ejj!fZ3e
je
je
je
je
je
je
je
je
je
je
je
je
je
je
je
je
j e
j!fZ4ej/ 0de1e3e4ƒ¡dd„ ƒZ5dS )é    )ÚpartialN)Ú_fftlogÚ
_pocketfftÚset_backend)Úmock_backend)Úassert_allcloseÚassert_equal)ÚfftÚfft2ÚfftnÚifftÚifft2ÚifftnÚrfftÚrfft2ÚrfftnÚirfftÚirfft2ÚirfftnÚdctÚidctÚdctnÚidctnÚdstÚidstÚdstnÚidstnÚfhtÚifhté   g      à?)ÚdlnÚmuzfunc, np_func, mockc                 C   sž   t  d¡ d¡}|| t j¡ƒ}t| |ƒ|dd� ttdd�� d|j_	| |ƒ}t
||jƒ t
|jj	dƒ W d   ƒ n1 s?w   Y  t| |ƒ|dd� d S )	Né   ©é
   r   g»½×Ùß|Û=)ÚatolT©Úonlyr   é   )ÚnpÚarangeÚreshapeÚastypeÚfloat64r   r   r   Únumber_callsÚcr   Úreturn_value)ÚfuncÚnp_funcÚmockÚxÚanswerÚy© r7   úY/var/www/html/CropPilot/venv/lib/python3.10/site-packages/scipy/fft/tests/test_backend.pyÚtest_backend_call8   s   ür9   z
func, mockc                 C   sÀ   t  d¡ d¡}tjtdd�� | |dd� W d   ƒ n1 s w   Y  ttdd��+ d	|j_	| |dd�}t
||jƒ t
|jj	d
ƒ t
|jjd
 d dƒ W d   ƒ d S 1 sYw   Y  d S )Nr"   r#   zprecomputed plan)ÚmatchÚfoo)ÚplanTr&   r   r(   r<   )r)   r*   r+   ÚpytestÚraisesÚNotImplementedErrorr   r   r.   r/   r   r0   Ú	last_argsÚl)r1   r3   r4   r6   r7   r7   r8   Útest_backend_planV   s   ÿ"ûrB   )6Ú	functoolsr   Únumpyr)   Ú	scipy.fftÚscipyr   r   r   Úscipy.fft.testsr   Únumpy.testingr   r   r=   Úfnamesr	   r
   r   r   r   r   r   r   r   r   r   r   ÚhfftÚhfft2ÚhfftnÚihfftÚihfft2Úihfftnr   r   r   r   r   r   r   r   r   r   Únp_funcsÚfuncsÚmocksÚmarkÚparametrizeÚzipr9   Ú
plan_funcsÚ
plan_mocksrB   r7   r7   r7   r8   Ú<module>   sx    ööö
ûû