
    _Mhf                     z   d dl mZ d dlZd dlZd dlmZ d dlZd dlZ ej	        d          d             Z
ej                            d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%        g          ej                            dd	d
g          d                         Z&d Z'ej        j(        d             Z)d Z*d Z+d Z,dS )    fftNassert_allclosemodule)scopec                  B    t           j                            dd          S )Ni      )nprandomrandn     c/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/scipy/fft/tests/test_multithreading.pyxr   	   s    9??3$$$r   funcworkers   c                 Z     || d          } || |          }t          ||           d S )N   r   r   )r   r   r   expectedactuals        r   test_threaded_samer      sB     tAq!!!HT!W%%%FFH%%%%%r   c                 .    t          j         | d          S )Nr   r   r   )r   s    r   _mt_fftr      s    71a    r   c                 J    t          j          d          }t          j        d          5 }|                    t           fdt          d          D                       }d d d            n# 1 swxY w Y   |D ]}t          ||           t          j          d           d S )Nr   r   c                     g | ]}S r   r   ).0_r   s     r   
<listcomp>z0test_mixed_threads_processes.<locals>.<listcomp>'   s    222Aa222r      )r   multiprocessingPoolmapr   ranger   )r   expectpresrs   `    r   test_mixed_threads_processesr,       s     WQ"""F		a	 	  4AeeG2222q222334 4 4 4 4 4 4 4 4 4 4 4 4 4 4  # #6""""GAqs   5A--A14A1c                    t          j                    }t          j        dg|            t	          j        t          d          5  t          j        | d           d d d            n# 1 swxY w Y   t	          j        t          d          5  t          j        | | dz
             d d d            d S # 1 swxY w Y   d S )Nr   r   workers must not be zeromatchr   workers value out of range)os	cpu_countr   ifftpytestraises
ValueError)r   cpuss     r   test_invalid_workersr9   /   s=   <>>DHaS4%    	z)C	D	D	D  1               
z)E	F	F	F % %TE!G$$$$% % % % % % % % % % % % % % % % % %s$   A**A.1A.B88B<?B<c                  j   t          j                    } t          j                    dk    sJ t          j        d          5  t          j                    dk    sJ t          j        d          5  t          j                    | k    sJ 	 d d d            n# 1 swxY w Y   t          j                    dk    sJ 	 d d d            n# 1 swxY w Y   t          j                    dk    sJ t          j        |            5  t          j                    dk    sJ 	 d d d            d S # 1 swxY w Y   d S )Nr   r#   r   )r2   r3   r   get_workersset_workers)r8   s    r   test_set_get_workersr=   ;   s   <>>D?!!!!			 & &  A%%%%_R   	- 	-?$$,,,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-   A%%%%%& & & & & & & & & & & & & & & ?!!!!	$		 & &  A%%%%%& & & & & & & & & & & & & & & & & &sH   .C/B
CB	CB	CCC D((D,/D,c                     t          j        t          d          5  t          j        d          5  	 d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   t          j        t          d          5  t          j        t          j                     dz
            5  	 d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nr.   r/   r   r1   r   )r5   r6   r7   r   r<   r2   r3   r   r   r   test_set_workers_invalidr?   L   s   	z)C	D	D	D  _Q 	 		 	 	 	 	 	 	 	 	 	 	 	 	 	 	               
z)E	F	F	F  _blnn_Q.// 	 		 	 	 	 	 	 	 	 	 	 	 	 	 	 	                 sg   A?AA	AA	AAA<*C&B4(C4B8	8C;B8	<CCC)-scipyr   numpyr   r5   numpy.testingr   r$   r2   fixturer   markparametrizer4   fft2ifft2fftnifftnrfftirfftrfft2irfft2rfftnirfftnhfftihffthfft2ihfft2hfftnihfftndctidctdctnidctndstidstdstnidstnr   r   slowr,   r9   r=   r?   r   r   r   <module>r_      s              ) ) ) ) ) )     				 h% %  % GSXsxCHciHciCJ	3:HciCJ	3:GSXsxGSXsx"   QG,,& & -, &! ! !   	% 	% 	%& & &"    r   