+
    /i<                         ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RIH	t	H
t
 ^ RIHt ^ RIHu Ht ^ RIHu Ht ^ RIt^ RIt]P.                  R8  tR t ! R R4      t ! R R	4      t ! R
 R4      tR# )    N)raises)xp_assert_closeassert_almost_equal)check_free_memoryc                     \         P                  P                  \         P                  P                  \         P                  P	                  \
        4      4      R V 4      # )data)ospathjoinabspathdirname__file__)basenames   &c/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/interpolate/tests/test_interpnd.py	data_filer      s8    77<<(AB* *    c                      a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 t]P                  P                   ]P                  P#                  ]RR7      R 4       4       tRtV tR# )TestLinearNDInterpolationc                   \         P                  ! . RO\         P                  R7      p\         P                  ! VP                  ^ ,          \         P                  R7      p\
        P                  ! W4      ! V4      p\        W#4       R# )r   dtypeNr   r   )      r   )r         ?)r   r   )      ?333333?nparrayfloat64arangeshapeinterpndLinearNDInterpolatorr   selfxyyis   &   r   test_smoketest(TestLinearNDInterpolation.test_smoketest   sS    HHN::'IIaggaj

3**103A"r   c                R   \         P                  ! . RO\         P                  R7      p\         P                  ! VP                  ^ ,          \         P                  R7      p\
        P                  ! VR,          VR,          3V4      ! VR,          VR,          4      p\        W#4       R# )r   r   Nr   NNNr   r/      r   r&   s   &   r   test_smoketest_alternate2TestLinearNDInterpolation.test_smoketest_alternate#   sl    HHN::'IIaggaj

3**AcFAcF+;Q?##OA"r   c                2   \         P                  ! . RO\         P                  R7      p\         P                  ! VP                  ^ ,          \         P                  R7      pVRV,          ,
          p\
        P                  ! W4      ! V4      p\        W#4       R# r   r                 @Nr   r   r&   s   &   r   test_complex_smoketest0TestLinearNDInterpolation.test_complex_smoketest,   s`    HHN::'IIaggaj

31H**103A"r   c                   \         P                  ! . RO\         P                  R7      p\         P                  ! VP                  ^ ,          \         P                  R7      pVRV,          ,
          p\
        P                  ! V4      p\        P                  ! W24      pV! V4      p\        W%4       VP                  VJ g   Q hR# r5   )r   r    r!   r"   r#   qhullDelaunayr$   r%   r   tri)r'   r(   r)   r<   interpolatorr*   s   &     r   test_tri_input(TestLinearNDInterpolation.test_tri_input6   s    HHN::'IIaggaj

31HnnQ44S<!_A"3&&&r   c                T  a \         P                  ! . RO\         P                  R7      p\         P                  ! . RO\         P                  R7      oV3R lp\         P                  ! \         P                  ! ^ ^^4      R,          \         P                  ! ^ ^^4      R,          4      w  r4VP                  4       pVP                  4       p\         P                  ! W4.4      P                  P                  4       p\        P                  ! VS4      ! V4      p\        Wb! W44      4       R# )r   r   c                   < W,           ^8*  pV( pW,          pW,          pW,          pW,          p^ V ,          pS	^ ,          ^V,
          V,
          ,          S	^,          V,          ,           S	^,          V,          ,           W&   S	^,          Wg,           ^,
          ,          S	^,          ^V,
          ,          ,           S	^,          ^V,
          ,          ,           W&   V# )r1    )
r(   r)   t1t2x1y1x2y2zvaluess
   &&       r   ip1TestLinearNDInterpolation.test_square.<locals>.ipQ   s    %1*BBBBBB!AAYB,ay|$ay|$AE AY!,ay!b&)*ay!b&)*AE Hr   N)r   r   r1   r1   r1   r1   r   g      ?g       @g      g      @r/   NNr/   r   r    r!   broadcast_arrayslinspaceravelTcopyr$   r%   r   )r'   pointsrK   xxyyxizirJ   s   &      @r   test_square%TestLinearNDInterpolation.test_squareC   s     6bjjI+2::>	* $$R[[Ar%:6%B%'[[Ar%:6%BDXXZXXZXXrh!!&&(**66:2>B2
+r   c                   \         P                  ! . RO\         P                  R7      p\         P                  ! VP                  ^ ,          \         P                  R7      p\
        P                  ! WRR7      ! V4      p\        W#4       R# )r   r   TrescaleNr   )rd   )rd      )re   re   )g      @   r   r&   s   &   r   test_smoketest_rescale0TestLinearNDInterpolation.test_smoketest_rescalep   sU    HHB::'IIaggaj

3**1>qAA"r   c                t   \         P                  ! . RO\         P                  R7      p\         P                  ! . RO\         P                  R7      p\         P                  ! \         P                  ! ^ ^
^4      R,          \         P                  ! ^ ^d^4      R,          4      w  r4VP                  4       pVP                  4       p\         P                  ! W4.4      P                  P                  4       p\        P                  ! W4      ! V4      p\        P                  ! WRR7      ! V4      p\        Wg4       R# )	r   r   NTra   )r   )r   d   )
   rj   )rk   r   rP   rQ   rR   rS   )r'   rY   rJ   rZ   r[   r\   r]   zi_rescaleds   &       r   test_square_rescale-TestLinearNDInterpolation.test_square_rescaley   s     <BJJO+2::>$$R[[B%;F%C%'[[C%<V%DFXXZXXZXXrh!!&&(**6:2>33F " 	B,r   c                   \         P                  ! . RO\         P                  R7      p\         P                  ! VP                  ^ ,          \         P                  R7      pVRV,          ,
          p\
        P                  ! V4      p\        P                  ! VP                  V4      ! V4      p\        P                  ! VP                  VRR7      ! V4      p\        WE4       R# r   r   r6   Tra   Nrc   )r   r    r!   r"   r#   r:   r;   r$   r%   rY   r   r'   r(   r)   r<   r*   
yi_rescales   &     r   test_tripoints_input_rescale6TestLinearNDInterpolation.test_tripoints_input_rescale   s    HH?::'IIaggaj

31HnnQ**3::q9!<223::q!
B+r   c                   \         P                  ! . RO\         P                  R7      p\         P                  ! VP                  ^ ,          \         P                  R7      pVRV,          ,
          p\
        P                  ! V4      pRp\        P                  ! \        VR7      ;_uu_ 4        \        P                  ! W2RR7      ! V4       RRR4       R#   + '       g   i     R# ; i	r   r   r6   zORescaling is not supported when passing a Delaunay triangulation as ``points``.)matchTra   Nrc   )r   r    r!   r"   r#   r:   r;   pytestr   
ValueErrorr$   r%   r'   r(   r)   r<   rw   s   &    r   test_tri_input_rescale0TestLinearNDInterpolation.test_tri_input_rescale   s    HH?::'IIaggaj

31HnnQ9]]:U33))#$?B 4333   ,CC&	c                   \         P                  P                  R 4       \         P                  P                  ^^4      p\         P                  P                  ^4      R\         P                  P                  ^4      ,          ,           p\        P
                  ! W4      p\        P                  ! \        P                  ! V4      4      p\        V! RR4      V! RR4      4       R#   y              ?r   N)
r   randomseedrandr$   r%   pickleloadsdumpsr   )r'   r(   r)   rK   ip2s   &    r   test_pickle%TestLinearNDInterpolation.test_pickle   s    
		tIINN2q!IINN2BIINN2$6!66**10ll6<<+,BsCL#c3-8r   zit fails on 32-bit)reasonc           	        \        R 4       \        P                  ! ^ R^
4      p\        P                  ! ^ R^
4      p\        P                  ! W4      w  r4R p\        P                  ! VP                  4       VP                  4       34      P                  pW4,          P                  4       p\        P                  ! Wg4      p\        P                  ! VV\        ^ R4      \        ^ R4      3R7      p	\        P                  ! VV\        RR4      \        ^ R4      3R7      p
\        P                  ! VV\        ^ R4      \        RR4      3R7      p\        P                  ! VV\        RR4      \        RR4      3R7      pV	P                  4        V
P                  4        VP                  4        VP                  4        V	P                  4        V
P                  4        VP                  4        VP                  4        R# )i'  ih  c                 L    \         P                  W3,          w  r4V ! W434      pV# N)r   mgrid)r=   
slice_rows
slice_colsgrid_xgrid_yress   &&&   r   	do_interp;TestLinearNDInterpolation.test_threading.<locals>.do_interp   s'    XXj&<=NF/0CJr   i4  )targetargsN)r   r   r"   meshgridvstackrV   rW   r$   r%   	threadingThreadslicestartr   )r'   r_ticks	phi_ticksr_gridphi_gridr   rY   rJ   r=   worker_thread_1worker_thread_2worker_thread_3worker_thread_4s   &            r   test_threading(TestLinearNDInterpolation.test_threading   s   
 	% ))AtR(IIar*	;;w:	
 FLLNHNN,<=>@@#**,44VD#**aa?A $**dD 15D>BD $**adD0ABD $**dD 15t3DEG 	r   rB   N)__name__
__module____qualname____firstlineno__r+   r2   r7   r>   r^   rg   rm   rs   r{   r   rx   markslowskipif	_IS_32BITr   __static_attributes____classdictcell____classdict__s   @r   r   r      su     ###'+,Z#-$,C	9 [[[[	*>?' @ 'r   r   c                   ,   a  ] tR t^t o R tR tRtV tR# )TestEstimateGradients2DGlobalc           	        \         P                  ! . RO\        R7      p\        P                  ! V4      pR R3R R3R R3R R3.p\        V4       F  w  pw  rVV! VR,          VR,          4      p\        P                  ! W'RR7      pVP                  R8X  g   Q h\        V\         P                  ! V4      R,          ^ V,          ,           R	R	R
V 2R7       K  	  R# )r   r   c                 "    ^ V ,          ^,           # r   rB   r(   r)   s   &&r   <lambda>>TestEstimateGradients2DGlobal.test_smoketest.<locals>.<lambda>   s    !A#'r   c                     ^ V ,           # r   rB   r   s   &&r   r   r      s    !a%r   c                     RV,           #    rB   r   s   &&r   r   r      s    "q&r   c                 >    ^^V ,          ,           RV,          ,           # rf   gL,@rB   r   s   &&r   r   r      s    !ac'E!G+r   ư>)tolNgh㈵>zitem )rtolatolerr_msgr   rO   )r   )r   r   rO   )r1   r   r   g      ?g333333?g?rM   r   r.   r0   )   r   rR   )
r   r    floatr:   r;   	enumerater$   estimate_gradients_2d_globalr#   r   )	r'   r(   r<   funcsjfuncgradrI   dzs	   &        r   r+   ,TestEstimateGradients2DGlobal.test_smoketest   s    HH @GLNnnQ
 "6*( &)+Z8	
  )/OA|QsVQsV$A66s4HB88v%%%BHHTN7+ad2Ds  0r   c                   \         P                  ! \        R 4      4      p\         P                  P	                  VP
                  ^ ,          4      p\        P                  ! V4      p\        P                  ! 4       ;_uu_ 4        \        P                  ! RR\        P                  4       \        P                  ! W2^R7       RRR4       R#   + '       g   i     R# ; i)zestimate_gradients_hang.npyignorez$Gradient estimation did not converge)maxiterN)r   loadr   r   r   r#   r:   r;   warningscatch_warningsfilterwarningsr$   GradientEstimationWarningr   )r'   rY   rJ   r<   s   &   r   test_regression_23592TestEstimateGradients2DGlobal.test_regression_2359   s     #@ABQ0nnV$ $$&&##622
 11#qI '&&&s   ?CC	rB   N)r   r   r   r   r+   r   r   r   r   s   @r   r   r      s     0J Jr   r   c                      a  ] tR tRt o RR ltR tR tR tR tR t	]
P                  P                  ^4      R	 4       tR
 tR tR tRtV tR# )TestCloughTocher2DInterpolatori  Nc                   \         P                  P                  R 4      pVf   \         P                  ! . RO\        R7      pV'       g0   \
        P                  ! W!! VR,          VR	,          4      RVR7      pM?\
        P                  ! VR,          VR	,          3V! VR,          VR	,          4      RVR7      pVP                  ^2^4      p	V'       g
   V! V	4      p
MV! V	R,          V	R	,          4      p
V! V	R,          V	R	,          4      p \        W3/ VB  R#   \         d4    \        R\        Y,
          4      4       \        RTP                  4       h i ; i)
r   Nr   r   )r   rb   z_check_accuracy: abs(a-b):zip.grad:)r   rM   rO   rN   r   r   )r   g?r.   r0   )r   r   RandomStater    r   r$   CloughTocher2DInterpolatorr   r   AssertionErrorprintabsr   )r'   r   r(   r   	alternaterb   kwrngrK   pabs   &&&&&&,     r   _check_accuracy.TestCloughTocher2DInterpolator._check_accuracy  s"   ii##D)9 &  %&A
 44QQsVQsV8L9=wPB 44afaf5E59!C&!C&5I9=wPB HHRO1A1S61S6"A33 	A'B' 	.AE
;*bgg&	s   
D >Ec                   R  R R R .p\        V4       Fm  w  r#V P                  VRRRRV 2R7       V P                  VRRRRR	V 2R
7       V P                  VRRRRV 2RR7       V P                  VRRRRRRV 2R7       Ko  	  R# )c                 "    ^ V ,          ^,           # r   rB   r   s   &&r   r   FTestCloughTocher2DInterpolator.test_linear_smoketest.<locals>.<lambda>,  s    1qr   c                     ^ V ,           # r   rB   r   s   &&r   r   r   -  s    Qr   c                     RV,           # r   rB   r   s   &&r   r   r   .  s    ar   c                 >    ^^V ,          ,           RV,          ,           # r   rB   r   s   &&r   r   r   /  s    QqS57*r   gvIh%<=gHz>	Function r   r   r   r   TzFunction (alternate) )r   r   r   r   r   zFunction (rescaled) r   r   r   r   rb   zFunction (alternate, rescaled) )r   r   r   r   rb   r   Nr   r   r'   r   r   r   s   &   r   test_linear_smoketest4TestCloughTocher2DInterpolator.test_linear_smoketest)  s     !*	
 !'GA  %d1# !    %d/s3 ! 
   %d.qc2D !    %dt9!= !  (r   c           
         R  R R R .p\        V4       F8  w  r#V P                  VRR^ RV 2R7       V P                  VRR^ RV 2RR	7       K:  	  R
# )c                     V ^,          # r   rB   r   s   &&r   r   ITestCloughTocher2DInterpolator.test_quadratic_smoketest.<locals>.<lambda>G      Ar   c                     V^,          # r   rB   r   s   &&r   r   r   H  r   r   c                 0    V ^,          V^,          ,
          # r   rB   r   s   &&r   r   r   I      A1r   c                     W,          # r   rB   r   s   &&r   r   r   J      r   &.>g)\(?r   r   Tr   Nr   r   s   &   r   test_quadratic_smoketest7TestCloughTocher2DInterpolator.test_quadratic_smoketestD  sw     $	
 !'GA  $TYqc? !    $TYqc?TX ! 	 (r   c                ^   \         P                  ! . RO\         P                  R7      p\         P                  ! VP                  ^ ,          \         P                  R7      pVRV,          ,
          p\
        P                  ! V4      p\        P                  ! W24      ! V4      p\        W$4       R# r5   )
r   r    r!   r"   r#   r:   r;   r$   r   r   )r'   r(   r)   r<   r*   s   &    r   r>   -TestCloughTocher2DInterpolator.test_tri_inputU  sn    HHN::'IIaggaj

31HnnQ008;A"r   c                   \         P                  ! . RO\         P                  R7      p\         P                  ! VP                  ^ ,          \         P                  R7      pVRV,          ,
          p\
        P                  ! V4      pRp\        P                  ! \        VR7      ;_uu_ 4        \        P                  ! W2RR7      ! V4       RRR4       R#   + '       g   i     R# ; irv   )r   r    r!   r"   r#   r:   r;   rx   r   ry   r$   r   rz   s   &    r   r{   5TestCloughTocher2DInterpolator.test_tri_input_rescale`  s    HH?::'IIaggaj

31HnnQ9]]:U33//EaH 4333r}   c                   \         P                  ! . RO\         P                  R7      p\         P                  ! VP                  ^ ,          \         P                  R7      pVRV,          ,
          p\
        P                  ! V4      p\        P                  ! VP                  V4      ! V4      p\        P                  ! VP                  VRR7      ! V4      p\        WE4       R# rp   )r   r    r!   r"   r#   r:   r;   r$   r   rY   r   rq   s   &     r   rs   ;TestCloughTocher2DInterpolator.test_tripoints_input_rescalem  s    HH?::'IIaggaj

31HnnQ00Q?B88QPTUVWX
B+r   c                t   R  R R R R .p\         P                  P                  R4      p\         P                  \         P                  ! . RO\
        R7      VP                  R^4      3,          p\        V4       F8  w  rEV P                  WSRRR	R
V 2R7       V P                  WSRRR	R
V 2RR7       K:  	  R# )c                     V ^,          # r   rB   r   s   &&r   r   ;TestCloughTocher2DInterpolator.test_dense.<locals>.<lambda>}  r   r   c                     V^,          # r   rB   r   s   &&r   r   r  ~  r   r   c                 0    V ^,          V^,          ,
          # r   rB   r   s   &&r   r   r    r  r   c                     W,          # r   rB   r   s   &&r   r   r    r  r   c                     \         P                  ! ^\         P                  ,          V ,          4      \         P                  ! ^\         P                  ,          V,          4      ,          # r   )r   cospisinr   s   &&r   r   r    s3    "%%	*266!BEE'!)+<<r   i  r   r  g{Gzt?g{Gz?r   )r(   r   r   r   r   T)r(   r   r   r   r   rb   N)r   rM   rO   rN   i  )	r   r   r   r_r    r   r   r   r   )r'   r   r   gridr   r   s   &     r   
test_dense)TestCloughTocher2DInterpolator.test_densey  s     $<
 ii##D)uuRXX:%HXXeQ'( ) !'GA  $T	RSQTo !    $T#A3 ! 	 (r   c                    \         P                  P                  ^^4      p\         P                  P                  ^4      p\        \        \
        P                  W4       R# )   N)r   r   randnassert_raisesry   r$   r   )r'   r(   r)   s   &  r   test_wrong_ndim.TestCloughTocher2DInterpolator.test_wrong_ndim  s:    IIOOB"IIOOBj("E"EqLr   c                x   \         P                  P                  R 4      pVP                  ^^4      pVP                  ^4      RVP                  ^4      ,          ,           p\        P
                  ! W#4      p\        P                  ! \        P                  ! V4      4      p\        V! RR4      V! RR4      4       R# r   )
r   r   r   r   r$   r   r   r   r   r   )r'   r   r(   r)   rK   r   s   &     r   r   *TestCloughTocher2DInterpolator.test_pickle  s    ii##D)HHROHHRL2chhrl?*006ll6<<+,BsCL#c3-8r   c                   \         P                  ! RRR\         P                  ! ^4      ^,          3.4      p\         P                  ! . RO4      p\        P                  ! W4      p^ VP
                  R&   Rp\         P                  ! R\         P                  ! V4      ,          R\         P                  ! V4      ,          .4      p\         P                  ! R\         P                  ! \         P                  ^,          V,
          4      ,          R\         P                  ! \         P                  ^,          V,
          4      ,          .4      pV! V4      pV! V4      p\        Wx4       \         P                  P                  ^4      p	V	P                  ^^4      p
V	P                  ^4      pV
P                  VP                  4      P                  VR,          ,           pV
P                  V4      V,           pV
P                  V4      V,           p\        P                  ! W4      p^ VP
                  R&   V! V4      pV! V4      p\        W4       \        W4       R# )	r   r   .r   Nr   rO   )r1   r   r   rR   )r   r    sqrtr$   r   r   r  r  r  r   r   r   r  dotrW   )r'   rY   rJ   rK   alphap1p2v1v2r   Ar   w1w2s   &             r   test_boundary_tri_symmetry9TestCloughTocher2DInterpolator.test_boundary_tri_symmetry  s   
 66CA+>?@)$00@  XXsRVVE]*C"&&-,?@AXXsRVVBEE!GeO44cBFF2557U?<S6STUVV ii##A&IIaOIIaLvxx""QvY.UU2Y]UU2Y]00@VVr   rB   )Nr   FF)r   r   r   r   r   r   r  r>   r{   rs   rx   r   	fail_slowr  r   r   r/  r   r   r   s   @r   r   r     s]     B6"	#I
, [[1 .M
	9%  % r   r   l        )r	   sysr   numpyr   rx   r   r  scipy._lib._array_apir   r   scipy._lib._testutilsr   scipy.interpolate._interpndinterpolate	_interpndr$   scipy.spatial._qhullspatial_qhullr:   r   r   maxsizer   r   r   r   r   rB   r   r   <module>r=     sh    	 
   *  F 3 . . $ $  [[5 	*
@ @F'J 'JT@  @ r   