
    (ph'                     H    S SK r S SKrS SKrS SKrS SKrS SKr " S S5      rg)    Nc                       \ rS rSrSrS rS rS r\R                  R                  \R                  R                  SS9S 5       5       rS	rg
)TestGIL
   zECheck if the GIL is properly released by scipy.interpolate functions.c                     / U l         g Nmessages)selfs    S/var/www/html/venv/lib/python3.13/site-packages/scipy/interpolate/tests/test_gil.pysetup_methodTestGIL.setup_method   s	        c                 :    U R                   R                  U5        g r   )r	   append)r
   messages     r   logTestGIL.log   s    W%r   c                 j   ^^^ U R                   m " UUU4S jS[        R                  5      nU" 5       $ )Nc                   &   > \ rS rSrU UU4S jrSrg)0TestGIL.make_worker_thread.<locals>.WorkerThread   c                 0   > T" S5        T" T6   T" S5        g )Ninterpolation startedinterpolation complete )r
   argsr   targets    r   run4TestGIL.make_worker_thread.<locals>.WorkerThread.run   s    +,,-r   r   N)__name__
__module____qualname____firstlineno__r   __static_attributes__)r   r   r   s   r   WorkerThreadr      s    . .r   r%   )r   	threadingThread)r
   r   r   r%   r   s    `` @r   make_worker_threadTestGIL.make_worker_thread   s-    hh	. 	.9++ 	. ~r   z*race conditions, may depend on system load)reasonc                 ,  ^^ S mUU4S jnS mU" SS9nU R                  TU5      nUR                  5         [        S5       H*  n[        R                  " S5        U R                  S5        M,     UR                  5         U R                  / SQ:X  d   eg )	Nc                 t    [         R                  " SSU 5      =p[         R                  " X5      u  p4X4-  nXU4$ )Nr     )nplinspacemeshgrid)n_pointsxyx_gridy_gridzs         r   generate_params9TestGIL.test_rectbivariatespline.<locals>.generate_params!   s7    KK422A[[.NFA7Nr   c                    > [         R                  " SS5       HE  nT" U5      n[        R                  " 5       nT" U6   [        R                  " 5       U-
  U :  d  MC  Us  $    g )Ni  r-   )	itertoolscounttime)requested_timer1   r   time_startedr7   interpolates       r   calibrate_delay9TestGIL.test_rectbivariatespline.<locals>.calibrate_delay'   sM    %OOD$7&x0#yy{T"99;->K 8r   c                 D    [         R                  R                  XU5        g r   )scipyr?   RectBivariateSpline)r2   r3   r6   s      r   r?   5TestGIL.test_rectbivariatespline.<locals>.interpolate/   s    11!:r      )r=   g      ?working)r   rG   rG   rG   r   )r(   startranger<   sleepr   joinr	   )r
   r@   r   worker_threadir7   r?   s        @@r   test_rectbivariatespline TestGIL.test_rectbivariatespline   s    		 	; a0//TBqAJJsOHHY  	}} !
 
 	
 
r   r   N)r    r!   r"   r#   __doc__r   r   r(   pytestmarkxslowxfailrN   r$   r   r   r   r   r   
   sN    O&	 [[[[JK
 L 
r   r   )	r:   r&   r<   numpyr.   rQ   scipy.interpolaterC   r   r   r   r   <module>rW      s!         5
 5
r   