
    tKg                      ^   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                   j0                  ej                   j2                  ej                   j4                  ej                   j6                  ej                   j8                  ej:                  ej<                  ej                   j>                  ej@                  ejB                  ejD                  ejF                  ejH                  ejJ                  ejL                  ejN                  ejP                  ejR                   eejT                  dd	       eejV                  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                   j0                  ej                   j2                  ej                   j4                  ej                   j6                  ej                   j8                  ej                   j:                  ej                   j<                  ej                   j>                  ej                   j@                  ej                   jB                  ej                   jD                  ej                   jF                  ej                   jH                  ej                   jJ                  ej                   jL                  ej                   jN                  ej                   jP                  ej                   jR                   eej                   jT                  dd	       eej                   jV                  dd	      fZ-e
j                   e
j"                  e
j$                  e
j&                  e
j(                  e
j*                  e
j,                  e
j.                  e
j0                  e
j2                  e
j4                  e
j6                  e
j8                  e
j:                  e
j<                  e
j>                  e
j@                  e
jB                  e
jD                  e
jF                  e
jH                  e
jJ                  e
jL                  e
jN                  e
jP                  e
jR                  e
jT                  e
jV                  fZ.ej^                  ja                  d
 e1e-e,e.            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                   j0                  ej                   j2                  ej                   j4                  ej                   j6                  ej                   j8                  ej                   j:                  ej                   j<                  ej                   j>                  ej                   j@                  ej                   jB                  fZ3e
j                   e
j"                  e
j$                  e
j&                  e
j(                  e
j*                  e
j,                  e
j.                  e
j0                  e
j2                  e
j4                  e
j6                  e
j8                  e
j:                  e
j<                  e
j>                  e
j@                  e
jB                  fZ4ej^                  ja                  d e1e3e4            d        Z5y)    )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                    t        j                  d      j                  d      } ||j                  t         j                              }t         | |      |d       t        t        d      5  d|_         | |      }t        ||j                         t        |j                  d       d d d        t         | |      |d       y # 1 sw Y   xY w)	N   
   r    g|=)atolTonlyr      )nparangereshapeastypefloat64r   r   r   number_callsr	   return_value)funcnp_funcmockxanswerys         `/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/scipy/fft/tests/test_backend.pytest_backend_callr9   8   s    
		"f%AQXXbjj)*FDGV%0	\	-GQ))*T&&*	 
. DGV%0 
.	-s   /<CCz
func, mockc                    t        j                  d      j                  d      }t        j                  t
        d      5   | |d       d d d        t        t        d      5  d	|_         | |d      }t        ||j                         t        |j                  d
       t        |j                  d
   d   d       d d d        y # 1 sw Y   }xY w# 1 sw Y   y xY w)Nr$   r%   zprecomputed plan)matchfoo)planTr(   r   r*   r=   )r+   r,   r-   pytestraisesNotImplementedErrorr   r   r0   r	   r1   	last_args)r2   r4   r5   r7   s       r8   test_backend_planrB   V   s    
		"g&A	*2D	EQU 
F 
\	-Q))*T&&*T^^A&v.6 
.	- 
F	E 
.	-s    C$ACCC)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        r8   <module>rZ      s7      6 6 ( 7 
 FFJJRVV[[FFKKrvv||FFKKrvv||FFLL"&&--FFKK)):+;+;FFLL*++Z->->NNJOOZ__j>N>NNNJOOZ__j>N>NGKKQ3/GLLaC0
2 
					%))//	%))//	%))**EII,<,<	%))//	%))**EII,<,<															A#	.	Q3	/
	1 
		<,,l.?.?			L..0B0B			L..0B0B			\00,2E2E			L..0B0B			\00,2E2E			<,,			L..			<,,			L..			<,,
	. .E8U0KL1 M1 iimmUYY^^UYY^^iinneiioouyyiinneiioouyyiioouyy//1A1Aiinneiioouyyiioouyy//1A1AC
  1 1<3D3D!3!3\5G5G!3!3\5G5G  ,"5"5|7J7J!3!3\5G5G  ,"5"5|7J7JL
 s:z'BC7 D7rY   