
    BpjP	                     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    \/var/www/html/pdf-tiff/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S n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U" SS9nU R                  X#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   c                 X    [         R                  R                  R                  XU5        g r   )rC   r?   _regridrE   s      r   interpolate_custom<TestGIL.test_rectbivariatespline.<locals>.interpolate_custom1   s    %%--aA6r      )r=   g      ?working)r   rL   rL   rL   r   )r(   startranger<   sleepr   joinr	   )r
   r@   rI   r   worker_threadir7   r?   s         @@r   test_rectbivariatespline TestGIL.test_rectbivariatespline   s   		 	;	7 a0//TBqAJJsOHHY  	}} !
 
 	
 
 a0//0BIqAJJsOHHY  	}} !
 
 	
 
r   r   N)r    r!   r"   r#   __doc__r   r   r(   pytestmarkxslowxfailrS   r$   r   r   r   r   r   	   sN    O&	 [[[[JK1
 L 1
r   r   )	r:   r&   r<   numpyr.   rV   scipy.interpolaterC   r   r   r   r   <module>r\      s#         G
 G
r   