+
    i                        ^ RI t^ RIHtHtHt ^ RIHu Ht	 ^ RI
t
^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHtHt  ! R R4      tR tR tR	 tR
 tR tR t]
P>                  PA                  R. . 3^.^.3^^.^^.3. R=O. R>O3. R?O. R@O3. RAO. RBO3.4      R 4       t!R t"]! R.4      R 4       t#R t$R t%R t&R t'R t(R t)R t*R t+R t,R t-R t.]! R.RRR 7      R! 4       t/]! R".RR#R 7      R$ 4       t0R% t1R& t2]
P>                  PA                  R']Pf                  ]Ph                  .R(R).R*7      R+ 4       t5R, t6R- t7R. t8R/ t9R0 t:R1 t;R2 R3 lt<R4 t=R5 t>R6 t?]! R7.R87      R9 4       t@R: tAR; tBR< tCR# )C    N)assert_array_equalassert_array_almost_equalassert_array_less)Path)image_comparisoncheck_figures_equalc                   B  a  ] tR t^t o . R
Ot. ROt. RO. RO.tRR.t]P                  P                  R]]./ ]]RR.3]]]./ ]]]R.3]].]! ]R7      ]]]R.3]].]! ]R7      ]]R].3]]].]! ]R7      ]]]].3]].]! ]]R7      ]]]].3.4      R 4       tR	tV tR# )TestTriangulationParamsFTzargs, kwargs, expectedN	trianglesmaskr   r   c                    ^^.pR^RR/p\         P                  P                  W,           / VCVC4      w  rgrrVw  rrWlJ g   Q hW}J g   Q h\        W4       WJ g   Q hW8X  g   Q hW8X  g   Q hR# )   ab4N)mtriTriangulation_extract_triangulation_paramsr   )selfargskwargsexpected
other_argsother_kwargsx_y_
triangles_mask_args_kwargs_xyr   r   s   &&&&            ڃ/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/tests/test_triangulation.py!test_extract_triangulation_params9TestTriangulationParams.test_extract_triangulation_params   s     V
QS)<<!#=f#=#=? 	2
5 !)iwwww:1}}"""&&&     r   r   r   r   r,   r   r   r   r      r   r/      )__name__
__module____qualname____firstlineno__r$   r%   r   r   pytestmarkparametrizedictr'   __static_attributes____classdictcell__)__classdict__s   @r&   r
   r
      s     AAI&I4=D[[5
QaD$'(
Q		BAy$ 78
Q	*Q9d,CD
Q41at"45
Q		DdOaIt-DE
Q	51i7NO8 ''r)   r
   c                      R .p . RO. RO. RO.V .p\         P                  P                  V/ 4      w  r#rErgVe   Q hW`.8X  g   Q hR# )TNr   r/   r   r   r   r   r.   )r   r   r   )r   r   r   r   r    r!   r"   r#   s           r&   *test_extract_triangulation_positional_maskr@   +   sP    6Dy9+t4D88rB .BJu==F??r)   c                     . R	Op . R
Op\         P                  ! \        RR7      ;_uu_ 4        \        P                  ! V ^^.4       RRR4       \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! W. RO4       RRR4       \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! WR4       RRR4       \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! W. RO.4       RRR4       \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! W. RO.4       RRR4       R#   + '       g   i     EL+; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   zx and y must be equal-lengthmatchNz>triangles must be a \(N, 3\) int array, but found shape \(3,\)z3triangles must be a \(N, 3\) int array, not 'other'otherzfound value 99zfound value -1r+   r-   r.   )r   r   c   )r   r   r,   r6   raises
ValueErrorr   r   r$   r%   s     r&   test_triangulation_initrJ   7   s*   AA	z)G	H	H1q!f% 
I	
 
 	1+	

 
H
J 
J 	1)
J 
z)9	:	:1*. 
;	z)9	:	:1*. 
;	: 
I	H	H
 


J 
J 
;	:	:	:	:s;   E)3E=9F=F#F6)E:	=F	F 	#F3	6G	c                     . ROp . ROp. RO. R	O.p\         P                  ! WV4      p\        VP                  . R
O. RO.4       VP	                  RR.4       \        VP
                  RR.4       VP	                  R4       VP
                  e   Q hRp. ROR.R.RR3 FA  p\        P                  ! \        VR7      ;_uu_ 4        VP	                  V4       RRR4       KC  	  R#   + '       g   i     KX  ; i)r   FTNz3mask array must have same length as triangles arrayrB   r+   r-   r.   )r/   r1   r   )r,   r,   r   )r,   r,   r   )FTF)	r   r   r   	neighborsset_maskr   r6   rG   rH   )r$   r%   r   triangmsgr   s         r&   test_triangulation_set_maskrP   K   s    AAI&Ii0F v''+{)CD OOUDM"v{{UDM2 OOD;;
@C%wtD]]:S11OOD! 21 E111s   C$$C5c                     ^p ^p\         P                  ! \         P                  ! RRV 4      \         P                  ! RRV4      4      w  r#VP                  4       pVP                  4       pW,          p^V ^,
          ,          V^,
          ,          p^V ,          V,          ^V ,          ,
          ^V,          ,
          ^,           p\        P
                  ! W#4      p\        VP                  V4       \        VP                  V4       \        VP                  4      V8X  g   Q h\         P                  ! VP                  4      ^ 8X  g   Q h\         P                  ! VP                  4      V^,
          8X  g   Q h\        VP                  4      V8X  g   Q h\         P                  ! VP                  4      ^ 8X  g   Q h\         P                  ! VP                  4      V^,
          8X  g   Q hVP                  pRVn        \!        VP                  V4       \!        \         P"                  ! VP                  4      \         P$                  ! V4      4       R# )                 ?N)npmeshgridlinspaceravelr   r   r   r$   r%   lenr   minmaxedgesrL   
_neighborsr   uniquearange)	nxnyr$   r%   npoints
ntrianglesnedgesrN   rL   s	            r&   test_delaunayre   b   s   	
B	
B;;r{{3R0"++c32KLDA		A		AeGbdr!t$JrT"Wqt^ad"Q&F %F fhh*fhh* v J...66&""#q(((66&""#wqy000 v||&&&66&,,1$$$66&,,719,,,
   IFv''3 ryy!1!12BIIg4FGr)   c                     ^
p ^p^p\         P                  P                  ^4       \         P                  P                  V 4      p\         P                  P                  V 4      pW2,          W1&   WB,          WA&   \        P                  ! W44      p\        \         P                  ! VP                  4      \         P                  ! \         P                  ! V 4      V4      4       R# )
   N)
rU   randomseedr   r   r   r^   r   deleter_   )rb   	duplicateduplicate_ofr$   r%   rN   s         r&   test_delaunay_duplicate_pointsrm      s    GILIINN2
		!A
		!A?AL?AL %F ryy!1!12yy7!3Y?Ar)   c                     \         P                  ! R R^4      p \         P                  ! R R^4      p\        P                  ! \        4      ;_uu_ 4        \
        P                  ! W4       RRR4       \         P                  ! V R4      p \         P                  ! VR4      p\
        P                  ! W4       R#   + '       g   i     LV; i)rS         $@N       @g       @)rU   rW   r6   rG   RuntimeErrorr   r   appendrI   s     r&   test_delaunay_points_in_liners      s     	Cr"A
Cr"A	|	$	$1  
% 			!SA
		!SAq 
%	$s   B88C	zx, yc                     \         P                  ! \        4      ;_uu_ 4        \        P                  ! W4       R R R 4       R #   + '       g   i     R # ; iNrF   rI   s   &&r&   !test_delaunay_insufficient_pointsrv      s0     
z	"	"1  
#	"	"	"s   AA	c            
        a \         P                  ! R R.RR.RR.RR.RR.RR.RR..4      p \         P                  ! RR.RR.RR.R	R.R	R.R
R.RR..4      pR oV3R lp\        P                  ! V R,          V R,          4      pV F  pV! W44      ^8X  d   K  Q h	  \        P                  ! V R,          V R,          4      pR# )gLXz?gCM??g~9B.?g/7R?g9?gHC?gt?g(\?g?ffffff?      ?皙?c                 x    \         P                  ! W34      P                  p\        V4      P	                  V4      # ru   )rU   vstackTr   contains_point)xtriytrixy
tri_pointss   &&& r&   tri_contains_point0test_delaunay_robust.<locals>.tri_contains_point   s.    YY|,..
J..r22r)   c                 J   <a a \        VV V3R  lS P                   4       4      # )c              3   |   <"   T F1  pS! SP                   V,          SP                  V,          S4      x  K3  	  R # 5iru   rI   ).0trir   rN   r   s   & r&   	<genexpr>Ctest_delaunay_robust.<locals>.tris_contain_point.<locals>.<genexpr>   s4      0.s &fhhsmVXXc]BGG.s   9<)sumr   )rN   r   r   s   ffr&   tris_contain_point0test_delaunay_robust.<locals>.tris_contain_point   s#     0$..0 0 	0r)   Ng     g     g     ڿg     ڿg     ڿgq=
ףpݿgzGڿgQ޿g)\(ܿNNNr   r   r   )r   NNr   )r   r   )rU   arrayasarrayr   r   )r   test_pointsr   rN   
test_pointr   s        @r&   test_delaunay_robustr      s     	01	01	01	01	01	01	124 5J **	u	u	u	e	e	u	e K30 
4 0*T2BCF!
!&5::: "
 
5 1:e3DEFr)   ztripcolor1.pngc                     \         P                  ! . R	O4      p \         P                  ! . R
O4      p\         P                  ! . RO. RO. RO. RO. RO. RO. RO. RO. RO. RO.
4      p\        P                  ! WV4      pV RV,          ,           pWP                  ,          P                  ^R7      pWP                  ,          P                  ^R7      pRV,          V,           p\        P                  ! ^y4       \        P                  ! W4RR7       \        P                  ! R4       \        P                  ! ^z4       \        P                  ! W7RR7       \        P                  ! R4       R# )r         ?axisk)
edgecolorszpoint colors)
facecolorsr   r   N)
r   r   r   r   r   r   r   r   r   ry   )
r   r   r   r   r   r   r   r   r   ry   r   r   r1   )r      r1   r   r/   r   )r/   rR   r   )r1   r      )r      r   )r   rR   	   )r   r   r   )   r   r   )rR   r   r   )
rU   r   r   r   r   meanpltsubplot	tripcolortitle)r$   r%   r   rN   CpointsxmidymidCfacess           r&   test_tripcolorr      s    


>?A


>?A

9999i	4 5I i0F#a%iG###+D###+DX_FKKMM&c2IInKKMM&<IIlr)   c            	         . ROp . ROp\         P                  ! 4       w  r#\        P                  ! \        RR7      ;_uu_ 4        VP                  W4       RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  W. RO4       RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  W. ROR7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  W^^.RR	7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  W^^.RR
7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  W. ROR7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  W^^.R4       RRR4       VP                  W. RO4       VP                  W. RORR
7       VP                  W^^.4       VP                  W^^.R7       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELi; i  + '       g   i     EL:; i  + '       g   i     EL; i  + '       g   i     L; i)r   z!tripcolor\(\) missing 1 required rB   Nz!The length of c must match eitherz,length of facecolors must match .* trianglesr   z-'gouraud' .* at the points.* not at the facesgouraud)r   shading)r   z+positional.*'c'.*keyword-only.*'facecolors')CzUnexpected positional parameterunused_positionalr+   r-   r   r/   r1   )r   r/   r1   r   )r   subplotsr6   rG   	TypeErrorr   rH   )r$   r%   figaxs       r&   test_tripcolor_colorr     s   AAllnGC	y(L	M	M
Q 
N	z)L	M	M
Q9% 
N	zK
M 
M
Ql3
M 
zL
N 
N
Qq!fi@
N 
zL
N 
N
QAq695
N 
yJ
L 
L
Q\*
L 
y(I	J	J
QAq6#67 
K LL|$LL|YL7LL1vLL1a&L)/ 
N	M	M	M	M	M
M 
M 
M
N 
N 
N
N 
N 
N
L 
L 
L 
K	JsT   I II(I<JJ$J8 I	I%	(I9	<J	J!	$J5	8K	c                     \         P                  P                  R 4       \         P                  P                  ^
4      \         P                  P                  ^
4      \         P                  P                  ^
4      r!p \        P
                  ! 4       P                  4       pRpVP                  WW$R7      P                  pVP                  VP                  3V8X  g   Q hR# )i!N,)climN)      ?ry   )rU   rh   ri   randr   figureadd_subplotr   normvminvmax)r   r   cr   r   r   s         r&   test_tripcolor_climr   %  s    IINN8iinnR ")).."4biinnR6H!A		!	!	#BD<<a<+00DIItyy!T)))r)   c            	         . ROp . R	OpRR.p\         P                  ! 4       w  r4\        P                  ! \        RR7      ;_uu_ 4        VP                  WW"R7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  WRVR7       RRR4       R#   + '       g   i     LS; i  + '       g   i     R# ; i)
r   皙?r   z"Positional parameter c .*no effectrB   r   Nzinterpreted as cr+   r-   )r   r   r6   warnsUserWarningr   )r$   r%   r   r   r   s        r&   test_tripcolor_warningsr   /  s    AA	c
AllnGC	k)M	N	N
Q1+ 
O	k)M	N	N
Q-!< 
O	N 
O	N	N	N	Ns   B'B:'B7	:C	c                  $   \         P                  ! . RO. RO.\         P                  R7      p \         P                  ! . RO4      pV P                  4       p\        P
                  ! VR,          VR,          V 4      P                   \        W 4       R# )r1   dtypeNr1   r/   r   )r1   r   r   ))r   r   )r   g?)r   r   )r   r   r   r   )rU   r   int32copyr   r   r\   r   )r   pointsold_triangless      r&   test_no_modifyr   ;  s^    )Y/rxx@IXX89FNN$Mvd|VD\9=CC}0r)   c                     \         P                  ! \         P                  ! ^4      \         P                  ! ^4      4      w  rV P                  4       p VP                  4       p. RO. RO. R	O. R
O. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO.p\         P                  ! \        V4      4      p^VR&   \        P                  ! WW#4      pVP                  4       p. ROp. ROp\         P                  ! Wg4      w  rgVP                  4       pVP                  4       pV! Wg4      p\        V. RO4       V! VR,
          VR,
          4      p\        V. RO4       . ROp. ROpV! Wg4      p\        V. RO4       RR.pRR.pV! Wg4      p\        V^ ^.4       Rp	. R Op R^ ^ ^ ^ V	^.p. R!O. R"O. R#O. R	O. R$O. R%O. R&O. R'O.p\        P                  ! WV4      pVP                  4       p. R)OpR(R.p\         P                  ! Wg4      w  rgV! Wg4      p\        V. R*O. R+O.4       Rp	RV	) ^ ^ ^ ^ ^.p . R,Op. R-O. R.O. R/O. R0O. R1O. R2O. R3O. R'O.p\        P                  ! WV4      pVP                  4       pR(R.p. R)Op\         P                  ! Wg4      w  rgV! Wg4      p\        VRR.^ ^.^ ^.^ ^.^^.^^.RR..4       . R4Op . R5Op. R-O. R6O.p\        P                  ! WV4      pVP                  4       p. R7Op. R8OpV! Wg4      p\        V. R9O4       VP                  ^^ .4       WTP                  4       8X  g   Q hV! Wg4      p\        V. R:O4       R# );r   r   rg   Nr   rS         @皙?Nr   r   r   r   rR   r   r   r/   rR   r/   r   rR   r/   r1   r   r1   r   r   r   rR   r   rR   r   r   rR   r   r   r   rg   r   r   r   rg   r      rg   r   r      r      r   r   rg   r   rg      r   rg   r   r   r      r   )r         ?      @      
@r,   )r   r/   r   r,   r   r,   rg   r,   r   r      r,   r,   r,   r,   r,   )r,   r,   r,   r,   r,   r   r1   rR   r,   r   r,   r   r,   r   r      )r         ?      @r   r   r   r   r   rS   rT   rp   r   )rS   rS   rS   r   r   r   rT   rp   r   r   r   r   )r   r/   r   r   r   r   r1   r   r   r   rg   r   r   r   r   r/   r1   r   r   r>   r   r1   r/   r   r   r1   r/   r1   rR   r1   r   rR   r   rR   r   r   r   rR   皙)r   r   ?gffffff?gffffff?g333333@g333333@)r,   r   r   r   r   r/   r,   )r,   r   r   r   r   r   r,   )r   r   r   r   r/   r1   r   r.   )r   r   rR   r   )r   r1   r   )r   r   rR   )r/   r   r1   )r1   r   r   r   r   r   r   r   r   r   r   r   r1   r/   )gɿ皙?rz   g333333?)r   r   r   r   )r,   r   r   r,   )r,   r,   r   r,   )rU   rV   r_   rX   zerosrY   r   r   get_trifinderr   rM   )
r$   r%   r   r   rN   	trifinderxsystrisdeltas
             r&   test_trifinderr
  E  s@   ;;ryy|RYYq\2DA		A		AIy)YIy)Z[*k;|\;I 88C	N#DDJi6F$$&I	!B	!B[[ FB	B	BRDt > ?RVRV$Dt = > 
FB	EBRDtGH sB
sBRDtaW% E'A	a!aE1%AIy)YIy2Ii0F$$&I	-B
B[[ FBRDt557 8 E	eVQQ1%A'AIy)YIy2Ii0F$$&I
B	-B[[ FBRDtr2hAAAAA!2h( )
 	AAI&Ii0F$$&I	B	BRDt^,
OOQF,,....RDt_-r)   c                    aaa \         P                  ! \         P                  ! ^4      \         P                  ! ^4      4      w  rV P                  4       p VP                  4       pRV ,          RV,          ,
          p. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO. R O. R!O. R"O. R#O. R$O. R%O. R&O.p\         P                  ! \        V4      4      p^VR&   \        P                  ! WW44      p\        P                  ! WR4      p\        P                  ! WR4      p\        P                  ! WRRR7      p\         P                  ! RR^4      p	. R'Op
\         P                  ! W4      w  rWgV3 F,  pV! W4      p\        VRV	,          RV
,          ,
          4       K.  	  . R(Op	T	p
\         P                  ! W4      w  rWgV3 F1  pV! W4      p\        VP                  R	.^,          .^,          4       K3  	  \         P                  ! RR^4      p	. R)Op
\         P                  ! W4      w  rWgV3 Fp  pV! W4      p\        P                  ! VRV	,          RV
,          ,
          4       V	^8  V	^8*  ,          V
^8  ,          V
^8*  ,          p\        VP                  V4       Kr  	  RR*R
uoooVVV3R lpVVV3R lp\         P                  ! . R+O4      p \         P                  ! . R,O4      p\         P                  ! . R-O. R.O. R/O. R0O. R1O. R2O. R3O. R4O.4      p\        P                  ! WV4      pV! W4      pV! W4      p\         P                  ! RR^4      p	\         P                  ! RR^4      p
\         P                  ! W4      w  r\        P                  ! WRRVR7      pV! W4      p\        VV! W4      4       VP!                  W4      w  ppV! W4      w  pp\        VV4       \        VV4       ^p\         P                  ! \         P                  ! RRV^,           4      \         P                  ! RRV^,           4      4      w  rV P                  4       p VP                  4       pV! W4      p\        P                  ! W\#        V^,           4      R7      p\         P                  ! \         P                  ! RR^4      \         P                  ! RR^4      4      w  rV	P                  4       p	V
P                  4       p
\        P                  ! WR4      p\        P                  ! WR4      p\        P                  ! WRRR7      pV! W4      p\         P$                  ! V! W4      V,
          4      pWx3 F  p\         P$                  ! V! W4      V,
          4      p\         P&                  ! V4      ^
\         P&                  ! V4      ,          8  g   Q h\         P(                  ! VV4      ^d\         P(                  ! VV4      ,          8  d   K  Q h	  R# )5r   Gz?)\(@r   geomkindr         @      ?T333333?c                    < SV R ,
          ^,          ,          SVR ,
          ^,          ,          ,           SV ,          V,          ,           # )r   r*   r$   r%   r   r   r   s   &&r&   quadtest_triinterp.<locals>.quad  s3    !C%!|a3
l*QqSU22r)   c                    < ^S,          V R,
          ,          SV,          ,           ^S,          VR,
          ,          SV ,          ,           3# )r/   r   r*   r  s   &&r&   gradient_quad%test_triinterp.<locals>.gradient_quad  s8    !QsUac!1Q3#;1#455r)   rS   rT   userr  dzr   r   r   Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   ry   r   r  )g      пr   r  r   )r   ry   r   r  g)\()r  &jjZ? rh?rS   rT   rT   rS   )333333?HPs?X9v?rS   rS   rT   rT   r.   r1   r   r   r   r   r/   r   r/   rR   r   rR   r/   r   rR   r   r   r   r   r   r   r1   )rU   rV   r_   rX   r  rY   r   r   LinearTriInterpolatorCubicTriInterpolatorrW   r   r   r   matestr   gradientmeshgrid_trianglesabsr[   dot)r$   r%   zr   r   rN   linear_interpcubic_min_E
cubic_geomr  r  interpzsr  r  r  
cubic_user	interp_zsinterp_dzsdxinterp_dzsdydzsdxdzsdyndiff_lin
diff_cubicr   r   r   s                            @@@r&   test_triinterpr@    s   ;;ryy|RYYq\2DA		A		AQaAIy)YIy)Z[*k;|\;I 88C	N#DDJi6F..v9M++F6K**66BJ	T4	#B	!B[[ FB z:B^!"tBwb'8: ;
 
#B	B[[ FB z:2"277dVAXJqL1 ;
 
T4	#B	!B[[ FB z:B^((d2gR.?AaB!G$a0B!G<277D)	 ; ucIQ136 	67A
78A)Y	9#Y	9F GIi0FQ
A	q	B	RQ	B	RQ	B[[ FB**66bIJ2"Iib6#-#6#6q#< \<"1(NUElE2lE2 	A;;r{{2r1Q3/RQqS1IJDA		A		AQ
A0B1Q30GHF[[S#q12;;sC3KLFB	B	B..v9M++F6K**66BJ	bBvvmB+b01H+VVF2NR/0
vvh2z(:#::::x*bffZ445 	6 5 ,r)   c                  z   RR lp RRr!RRrCRRre\         P                  ! WVRR	R	R.4      p\         P                  ! W$VRRR	R	.4      p\         P                  ! . RO. RO. RO. RO. RO. RO. RO. RO.4      p	\        P                  ! WxV	4      p
\	        ^	4       EF  p\         P
                  ! ^\         P                  R
7      p\         P
                  ! ^\         P                  R
7      p\         P
                  ! ^\         P                  R
7      p\         P
                  ! ^^.\         P                  R
7      pV^,          pR	VVV^,          3&   V^ 8X  d   R	W&   M%V^8X  d   R	W^,          &   MV^8X  d   R	W^,          &   \        P                  ! WRW3R7      pV ! VW3VR,          4       V ! VW43VR,          4       V ! VWV3VR,          4       V ! VW,           R,          W$,           R,          34       V ! VW,           R,          W&,           R,          34       V ! VWS,           R,          Wd,           R,          34       V ! VW,           V,           R,          W$,           V,           R,          34       V ! VRV,          V,           V,           R,          RV,          V,           V,           R,          34       V ! VVRV,          ,           V,           R,          VRV,          ,           V,           R,          34       V ! VW,           RV,          ,           R,          W$,           RV,          ,           R,          34       EK  	  R # )Nc           	        ^pRpRpVw  rgWd\         P                  ! \         P                  ! R^\         P                  ,          V4      4      ,          ,           pWt\         P                  ! \         P                  ! R^\         P                  ,          V4      4      ,          ,           p	V ! V.V.4      ^ ,          p
V P                  V.V.4      w  rVeG   \        W^ ,          4       \        V^ ,          V^,          4       \        V^ ,          V^,          4       V ! W4      V
,
          pV P                  W4      w  rW,
          pW,
          p\        WV,          4       \        VWE,          4       \        VWE,          4       R# )a  
Checks the continuity of interpolator (and its derivatives) near
location loc. Can check the value at loc itself if *values* is
provided.

*interpolator* TriInterpolator
*loc* location to test (x0, y0)
*values* (optional) array [z0, dzx0, dzy0] to check the value at *loc*
绽|=g      Y@rS   N)rU   cosrW   pisinr-  r   r   )interpolatorlocvaluesn_starepsilonr   loc_xloc_ystar_xstar_yr1  dzxdzydiff_ztab_dzxtab_dzydiff_dzxdiff_dzys   &&&               r&   check_continuity;test_triinterpcubic_C1_continuity.<locals>.check_continuity  s'    B"%%(H!IIIB"%%(H!III%5'*1-!**E7UG<
%a3%c!ffQi8%c!ffQi8f-1)226B==&!),(GI.(GI.r)   r  r   r  r!  r  r"  rS   rT   r   r  r  r   r         @g      @ru   r.   r#  r$  r%  r&  r'  r(  r)  r   r   )r   r/   )rU   r   r   r   ranger  float64r+  )rW  r   aybxbycxcyr$   r%   r   rN   idofr1  rP  rQ  rI  caser5  s                     r&   !test_triinterpcubic_C1_continuityrc    s   /> Sv
""b"b"-.A
""b"b"-.A)Y	9#Y	9F GIi0FaHHQbjj)hhq

+hhq

+1a&

3Qw!$tTAX~19AGQYCqMQYCqM**66/2j: 	"6$<8"6$<8"6$<825#+s{!;<25#+s{!;<25#+s{!;<258R-"%(B!?@2b58B;"2RU2Xb["4D!EF2be8B;"2R2Xb["4D!EF25B;"2RU2b5["4D!EF9 r)   c            	      p   R  p ^^r!\         P                  P                  ! V ! W4      !  pVP                  4        VP	                  4       p\        W,          4       F  p\        P                  ! W,          \        P                  R7      pRWe&   \         P                  P                  W6\        P                  ! W,          4      RR7      w  rx\        \        P                  ! WG4      V4       K  	  ^^1rV ! W4      w  rrV^W8  ,          ,           ^W8  ,          ,           pV^W8  ,          ,           ^W8  ,          ,           p\        P                  ! WV	^,
          W^,
          ..4      p\        P                  ! W^,
          W^,
          V
..4      p\        P                  ! V. RO.4      p\         P                  P                  WVW,          ^,           W,          ^,           34      pVP                  4        VP	                  4       p\        W,          ^,           4       F  p\        P                  ! W,          ^,           \        P                  R7      pRWe&   \         P                  P                  W6\        P                  ! W,          ^,           4      RR7      w  rx\        \        P                  ! WG4      V4       K  	  \        P                  ! ^\        P                  R7      p\        P                  ! . RO\        P                  R7      p\        P                  ! . RO\        P                  R7      pR	p\         P                  P                  WW4      pVP                  4        VP	                  4       p\        V\        P                  ! . R
O. RO. RO.\        P                  R7      4       R# )c                .   W,          p\         P                  ! \         P                  ! V\         P                  R7      \         P                  ! V^,
          \         P                  R7      \         P                  ! ^V\         P                  R7      \         P                  ! W ,
          \         P                  R7      \         P                  ! W\         P                  R7      .4      p\         P                  ! \         P                  ! V\         P                  R7      \         P                  ! ^V\         P                  R7      \         P                  ! V^,
          \         P                  R7      \         P                  ! W\         P                  R7      \         P                  ! W ,
          \         P                  R7      .4      p\         P                  ! ^\         P                  ! V\         P
                  R7      ,          \         P                  ! V^,
          \         P
                  R7      ) \         P                  ! V^,
          \         P
                  R7      ) \         P                  ! W ,
          \         P
                  R7      ) \         P                  ! W ,
          \         P
                  R7      ) .4      pRWR^V,          ^,
           V^,
          RV1&   RV^V,          ^,
          ^V,          ^,
           V^,
          RV1&   WSW@V,          W,          33# )z
Return the sparse, (n*m, n*m) matrix in coo format resulting from the
discretisation of the 2-dimensional Poisson equation according to a
finite difference numerical scheme on a uniform (n, m) grid.
r   rS   N)rU   concatenater_   r   onesr[  )r=  mlrowscolsvalss   &&    r&   poisson_sparse_matrix<test_triinterpcubic_cg_solver.<locals>.poisson_sparse_matrixe  s    C~~IIarxx(IIac*BIIa"((,KIIac*BIIa"((,KM N ~~IIarxx(IIa"((+RYYqs"((-KIIa"((+RYYqs"((-KM N ~~bggarzz**WWQqS

++bggac.L-LWWQS

++bggac.L-LN O
 !#qs1uacf1f$&QqSU1Q3q5!A#&q&!4A#qs++r)   r   rT   rC  )Ar   x0tolN)rT   rT   rT   rT   )r   r   r/   r   r   r   r   r/   r/   r/   r/   r/   r   r   r   r   r   )r   r   r/   r   r   r   r   r   r   r   r   r   r/   r/   r/   r/   r/   )r1   r1   )rT   rp   rS   )rp   rT         @)rS   rr  rT   )r   _triinterpolate_Sparse_Matrix_coocompress_cscto_denserZ  rU   r  r[  _cgr   r0  rf  rg  r   r   )rm  r=  rh  mat	mat_denseitestr   r$   _i_zeroj_zerorl  rj  rk  dims                  r&   test_triinterpcubic_cg_solverr  a  s   ,2 !



1
13H3N
OCIqsHHQS

+##''#rxx},2 ( 4!"&&"6:  BV/5D!T^$$q$.'99D!T^$$q$.'99D>>4&(F1H!EFGD>>4(F1Hf!EFGD>>4!123D



1
1$d3437AC!G2DFCIqsQwHHQS1WBJJ/##''#rwwquqy7I,2 ( 4!"&&"6:   772RZZ(D88G(($D88G(($D
C



1
1$d
HCIilL329;*E Fr)   c            	         R Rr\         P                  ! V RV ,          R R.4      p\         P                  ! W) R R .4      p\         P                  ! ^\         P                  R7      p. R
O. RO.p\         P                  ! ^^.4      p\         P                  ! R ^\         P
                  ,          ^4       EF  p\         P                  ! V4      V,          \         P                  ! V4      V,          ,           p\         P                  ! V4      ) V,          \         P                  ! V4      V,          ,           p	\        P                  ! WV4      p
\        P                  ! WRR7      p\        P                  P                  V4      pVP                  4       p\         P                  ! V^4      ^,
          VR&   \        ^4       F<  p\         P                  ! V^4      ^VRV3,          ,          ,
          Wn^,           R3&   K>  	  \!        \         P"                  ! \         P$                  ! V4      ^ R7      \         P                  ! R R .\         P                  R7      4       EK  	  R	# )rS   gˡE?r   rT   r   r  r  r   r   Nr0   r  )r   r   )rU   r   r  r[  rW   rE  rD  rF  r   r   r+  rs  _DOF_estimator_geomcompute_geom_weightsr   rZ  r   rZ   r/  )r   r\  r$   r%   r1  r   sum_wthetax_roty_rotrN   r4  dof_estimatorweightsitris                  r&    test_triinterpcubic_geom_weightsr    s   
 E
"c"fb"%&A
"c2r"#A
"**%AI&IHHaVER255"-ua"&&-/1q 266%=?2##E)<..vvF
,,@@L446ffWa(1,d!HD!vvgq1Agag6F4FFEq&!) !"&&Q"?"$((B82::"F	H .r)   c                      R p \         P                  ! . R	O4      p\         P                  ! R
^ ^ ^ ^ V ^.4      p^^ .^ ^.^^.^^.RR
.R^..pV EF;  pV^ ,          V,          V^,          V,          ,           pV^,          ) V,          V^ ,          V,          ,           pYVrRV,          RV,          ,
          p	. RO. RO. RO. RO. RO. RO. RO. RO.p
\        P                  ! WxV
4      p\         P                  ! \         P
                  ! VP                  4      \         P                  ! VP                  4      ^4      p\         P                  ! \         P
                  ! VP                  4      \         P                  ! VP                  4      ^4      p\         P                  ! W4      w  rVP                  4       pVP                  4       pVP                  4       ! W4      R
8H  p\         P                  P                  RV,          RV,          ,
          VR7      p\        P                  ! W4      p\        P                  ! W4      p\        P                  ! WRR7      pVVV3 F  pV! W4      p\        VV4       K  	  ^pVP                   V^ 3,          pVP                   V^3,          p\         P                  ! VP                  V,          VP                  V,          ^
4      p\         P                  ! VP                  V,          VP                  V,          ^
4      pRV,          RV,          ,
          pVVV3 FO  pVP#                  WV\         P$                  ! ^
\         P&                  R7      ,          R7      w  p\        VV4       KQ  	  EK>  	  R# )rS   r  r  r   r  r  r   )	tri_indexNr   r,   r>   r   r   r   r   r   r   r   )rU   r   r   r   rW   rZ   r$   r[   r%   rV   rX   r  mar*  r+  r   r   _interpolate_multikeysrg  r   )r	  rp  y0transformationstransformationr  r  r$   r%   r1  r   rN   r  r  mask_out	zs_targetr2  r3  r4  r5  r6  r  pt1pt2s                           r&   test_triinterp_colinearr    s    E	1	2B	2A1eQ/	0B 1v1v1v1vBx"aIO)q!"$~a'8';;""2%q(9"(<<AFT!VO	9i	96	##A)4[[)266&((+;R@[[)266&((+;R@R$XXZXXZ((*22b8EEKKR$r' 1KA	226=//:..vvF
$k:>FB%i4 ? tQw'tQw'[[#r:[[#r:Gd2g%	$k:>F//$rwwr'B"B 0 DCB%i4 ?A *r)   c                     ^p ^
pRpR p\         P                  ! VRV4      p\         P                  ! ^ V ,           ^\         P                  ,          V ,           V RR7      p\         P                  ! VR\         P                  3,          V^R7      pVR;;,          \         P                  V ,          ,          uu&   V\         P
                  ! V4      ,          P                  4       pV\         P                  ! V4      ,          P                  4       p\        P                  ! Wg4      pV! Wg4      p	\         P                  ! RR^4      p
\         P                  ! RR^4      p\         P                  ! W4      w  rV
P                  4       p
VP                  4       p/ p\        ^4       EF  p^\         P                  ,          V ,          V,          p\         P
                  ! V4      V,          \         P                  ! V4      V,          ,           p\         P                  ! V4      ) V,          \         P
                  ! V4      V,          ,           p\         P
                  ! V4      V
,          \         P                  ! V4      V,          ,           p\         P                  ! V4      ) V
,          \         P
                  ! V4      V,          ,           p\        P                  ! VVVP                  4      p\        P                  ! VV	4      p\        P                  ! VV	4      p\        P                  ! VV	R	R
7      pRVRVR	V/pR FG  pVV,          pV^ 8X  d   V! W4      VV&   K   V! VV4      p\         P"                  ! VVV,          4       KI  	  EK  	  RpR F  pVR8X  d   VV,          pTpVV
,          pTpMTpVV,          pT
pVV,          p\        P                  ! VVVP                  4      p\        P                  ! VV	4      p\        P                  ! VV	4      p\        P                  ! VV	R	R
7      pRVRVR	V/pR F1  pVV,          ! VV4      p\         P"                  ! VVV,          4       K3  	  K  	  R# )   333333?c                    \         P                  ! R V ,
          R V,
          4      p\         P                  ! R V ,
          R V,
          4      p\         P                  ! V ) R,
          V) R,
          4      p\         P                  ! V ) R,
          V) R,
          4      p^\         P                  ! V^
,          ^,          4      ^,
          ,          R,          \         P                  ! RV,          4      ,          \         P                  ! V^
,          ^,          4      ^,
          R,          \         P                  ! RV,          4      ,          ,           RV ^,          V^,          ,           ,          ,           ) p\         P
                  ! V4      V,
          \         P
                  ! V4      \         P                  ! V4      ,
          ,          # r   r  g      >@      @g      &@rx   rU   hypotarctan2exprD  r[   rZ   r$   r%   r1theta1r2theta2r1  s   &&     r&   r1  )test_triinterp_transformations.<locals>.z  "   XXcAgsQw'C!GS1W-XXqb3hS)QBHqb3h/B
#A%&s*RVVBvI->>vvr"uqj!!#S(266#f*+==>1a4!Q$;  ! q	!bffQiq	122r)   ffffff?Fendpoint.r   rT   r  r  linmin_EgZ$.Ar$   Nr   :r   Nr/         )r  r  r  rI   )rU   rW   rE  repeatnewaxisrD  flattenrF  r   r   rV   rX   rZ  r   r*  r+  r,  r   )n_anglesn_radii
min_radiusr1  radiianglesrp  r  triang0z0xs0ys0	interp_z0i_angler  r$   r%   r  r  rN   r2  r3  r4  
dic_interp
interp_keyr5  interpzscale_factorscaled_axiss                                r&   test_triinterp_transformationsr    s    HGJ3 KK
D'2E[[Xqw'9!E3FYYvc2::o.a@F
7OruuX~%O
v
	'	'	)B
v
	'	'	)B  (G	
2B ++c2r
"C
++c2r
"C{{3$HC
))+C
))+CI8"%%("W,FF5M"rvve}R//VVE]N2ub 00VVE]3s!22ffUm^C"&&-"33##Aq'*;*;<2262>//;..vrG
]{j*
 3J
+F!|(.s(8	*% R.001::1FH 3 0 L!#r!AA#BBAr!AB#B##Aq'*;*;<2262>//;..vrG
]{j*
 3J ,R4G,,Wi
6KL 3) "r)   ztri_smooth_contouring.pngTg;On?)remove_textrq  c            	         ^p ^
pRpR p\         P                  ! VRV4      p\         P                  ! ^ V ,           ^\         P                  ,          V ,           V RR7      p\         P                  ! VR\         P                  3,          V^R7      pVR;;,          \         P                  V ,          ,          uu&   V\         P
                  ! V4      ,          P                  4       pV\         P                  ! V4      ,          P                  4       p\        P                  ! Wg4      pV! Wg4      p	VP                  \         P                  ! WhP                  ,          P                  ^R7      WxP                  ,          P                  ^R7      4      V8  4       \        P                  ! V4      p
V
P                  V	^R7      w  r\         P                   ! R	R
R4      p\"        P$                  ! VRRR7       \"        P&                  ! WVRR7       R# )r  r  c                    \         P                  ! R V ,
          R V,
          4      p\         P                  ! R V ,
          R V,
          4      p\         P                  ! V ) R,
          V) R,
          4      p\         P                  ! V ) R,
          V) R,
          4      p^\         P                  ! V^
,          ^,          4      ^,
          ,          R,          \         P                  ! RV,          4      ,          \         P                  ! V^
,          ^,          4      ^,
          R,          \         P                  ! RV,          4      ,          ,           RV ^,          V^,          ,           ,          ,           ) p\         P
                  ! V4      V,
          \         P
                  ! V4      \         P                  ! V4      ,
          ,          # r  r  r  s   &&     r&   r1  %test_tri_smooth_contouring.<locals>.zk  r  r)   r  Fr  .r   subdivrS   rT   g?r   z0.5)lwcolorblack)levelscolorsNr  )rU   rW   rE  r  r  rD  r  rF  r   r   rM   r  r   r   UniformTriRefinerrefine_fieldr_   r   triplot
tricontour)r  r  r  r1  r  r  rp  r  r  r  refinertri_refiz_test_refir  s                 r&   test_tri_smooth_contouringr  d  s    HGJ3 KK
D'2E[[Xqw'9!E3FYYvc2::o.a@F
7OruuX~%O
v
	'	'	)B
v
	'	'	)B  (G	
2BRXXb!2!2388a8@ !2!2388a8@B!" #
 $$W-G#00A0>HYYr2u%FKKCu-NN8Hr)   ztri_smooth_gradient.pnggZd;O?c                     R  p ^p^
pRp\         P                  ! VRV4      p\         P                  ! ^ ^\         P                  ,          VRR7      p\         P                  ! VR\         P                  3,          V^R7      pVR;;,          \         P                  V,          ,          uu&   V\         P
                  ! V4      ,          P                  4       pV\         P                  ! V4      ,          P                  4       pV ! Wg4      p\        P                  ! Wg4      p	V	P                  \         P                  ! WiP                  ,          P                  ^R7      WyP                  ,          P                  ^R7      4      V8  4       \        P                  ! V	4      p
V
P                  V^R7      w  r\        P                   ! W) 4      pVP#                  V	P$                  V	P&                  4      w  r\         P                  ! W4      p\(        P*                  ! 4        \(        P,                  ! 4       P/                  R4       \(        P0                  ! V	R	R
7       \         P2                  ! RRR4      p\4        P6                  R,          p\(        P8                  ! WVV. ROR7       \(        P:                  ! V	P$                  V	P&                  VV,          VV,          RR^RRRRR7       R# )c                <   V ^,          V^,          ,           p\         P                  ! W4      p\         P                  ! V4      V,          p\         P                  ! V4      V,
          \         P                  ! V4      \         P                  ! V4      ,
          ,          # )zAn electric dipole potential V.)rU   r  rD  r[   rZ   )r$   r%   r_sqr  r1  s   &&   r&   dipole_potential2test_tri_smooth_gradient.<locals>.dipole_potential  s_    !tad{

1 FF5M$q	!q	"&&) 344r)   r  r  Fr  .r   r  equalz0.8)r  rS   rT   g{Gz?hot)r  cmap
linewidthsr   ro   bluegy&1|?r   rY  )unitsscalezorderr  width	headwidth
headlengthNr  )rp   rT   rT   rT   )rU   rW   rE  r  r  rD  r  rF  r   r   rM   r  r   r   r  r  r+  r-  r$   r%   r   r   gca
set_aspectr  r_   mpl	colormapsr  quiver)r  r  r  r  r  r  r$   r%   VrN   r  r  r  tciExEyE_normr  r  s                      r&   test_tri_smooth_gradientr    s   5 HGJKK
D'2E[[AbeeGX>FYYvc2::o.a@F
7OruuX~%O	rvvf~	&&(A	rvvf~	&&(AA%F
OOBHHQ//05515=//05515=? ! "
 $$V,G#0010=H 
#
#FB
/C\\&((FHH-FBXXbF JJLGGI!KKe$YYr2t$F==DNN8d24 JJvxx2f9biQfbR9r)   c                     \         P                  ! . RO4      p \         P                  ! R R R\         P                  ! R4      ,          RR.4      p\         P                  ! . RO. RO. RO.\         P                  R7      p\         P                  ! . RO\        R7      p\
        P                  ! WW#R7      p\
        P                  ! V4      p\        VP                  ^R.4       \        VP                  RR	7      \         P                  P                  RRR\         P                  ! R4      ,           ,          \         P                  .V4      4       \         P                  ! . RO4      p \         P                  ! . RO4      p\         P                  ! . RO.\         P                  R7      p\
        P                  ! WV4      p\
        P                  ! V4      p\        VP                  4       \         P                  ! R .4      4       ^	pR
 p\         P                  ! RRV^,           4      p \         P                  ! V! V R4      V! V R4      4      w  rV P!                  4       p VP!                  4       p\
        P                  ! W\#        V^,           4      R7      p\
        P                  ! V4      pVP%                  R4      p\         P&                  ! ^\        R7      p	. ROp
RW&   \)        W4       \         P&                  ! ^\        R7      pRV^P&   VP+                  V4       VP%                  R4      p. ROpRW&   \)        W4       R# )rS   rT   r   rp   r   r   FTr   )rescalec                 r    \         P                  ! V 4      V,          \         P                  ! V 4      ,          # ru   )rU   r/  sign)r$   r   s   &&r&   powertest_tritools.<locals>.power  s!    vvay!|BGGAJ&&r)   r   r   r  NrS   rT   r   rS   rp   r  r.   r   r   FFTgV͞^&?)rS   rT   rp   )rT   rY  r  )r   r   r/   r1   r   r   r   r         "   #   ~                                    ),   -   >   ?   N   O   P   Q   R   S   b   rE   t   u   )rU   r   sqrtr   boolr   r   TriAnalyzerr   scale_factorscircle_ratiosr  masked_arraynanrW   rV   rX   r.  get_flat_tri_maskr  r   rM   )r$   r%   r   r   rN   analyserr=  r  	mask_flat
verif_maskcorners_indexcenter_indexs               r&   test_tritoolsr$    sa    	&'A
"b#bggbk/334A)Y	:"((KI88(5Di;F'Hh44q-6HIu-
CR^!4bff=tDF
 	A
#$A)BHH5Ii0F'Hh446"G 	
A' 	CQqS!A;;uQ|U1d^4DA		A		A0B1Q30GHF'H**3/I#T*JGM $Jy- 88Ct$DDH
OOD**3/IML#Jy-r)   c                     ^p ^p\         P                  ! RRV ^,           4      p\         P                  ! W"4      w  r#VP                  4       pVP                  4       p\         P                  ! ^V ^,          ,          \
        R7      pRW@^,          R% \        P                  ! W#\        V ^,           4      VR7      p\        P                  ! V4      pVP                  VR7      pVP                  pVP                  p	W^,          ,          p
\         P                  ! RRV
^,           4      p\         P                  ! W4      w  rVP                  4       pVP                  4       p\         P                  ! \         P                  ! VRV,           ,          ^4      \         P                  ! VRV	,           ,          ^4      4      p\        VR4       VP                   p\         P"                  ! VP                  VP$                  ,          ^R7      R	,          p\         P"                  ! VP                  VP$                  ,          ^R7      R	,          pVP'                  4       pV! VV4      pVP                   V,          p\        VV4       \         P(                  ! . RO4      p\         P(                  ! . RO4      p\        P                  ! W#. RO. RO.4      \        P                  ! W#. RO. RO.4      .p\         P*                  ! VR
,
          VR,
          4      p. p\-        ^4       F  p\        P                  ! VV,          4      pVP/                  V^R7      w  pp\         P0                  ! VP                  VP                  V34      ^ ,          pV\         P2                  ! VR,          VR,          34      ,          pVV.,          pK  	  \5        V^ ,          V^,          4       R# )r1   rT   r   TNr   r  r   r   r   r   r   r  rS   rT   rS   rT   rS   rS   rT   rT   r   r   r/   r   r1   r   r   )rU   rW   rV   rX   r  r  r   r   r.  r  refine_triangulationr$   r%   isinaroundr   r   r   r   r  r   r  rZ  r  dstacklexsortr   )r=  r  r$   r%   r   rN   r  refi_triangx_refiy_refin_refix_verify_verifind1d	refi_maskrefi_tri_barycenter_xrefi_tri_barycenter_y
tri_finderrefi_tri_indicesrefi_tri_maskr1  xyz_datairefined_triang	refined_zxyzs                             r&   test_trirefiner@    s   	AF
CQqS!A;;qDA		A		A88AadF$'DDAK0B1Q30G%)+F$$V,G..f.=K]]F]]F]Fkk#r6!8,G{{74GmmoGmmoGGGBIIgs7{3Q7IIfc&j1157Eud#   IFF;==1F1F#G()+-/0FF;==1F1F#G()+-/0%%'J!"7"79KK 01My-0 	

'(A


'(A  	9'=>  	9'=>@F
S!c'"AH1X((3$+$8$81$8$E!	ii))>+;+;YGHK"**c$iT345SE  hqk8A;7r)   rG  linearcubic)idsc                    \         P                  R,          w  r\         P                  ! VP                  4       ^4      p\         P                  ! VP                  4       ^4      p\         P                  ! V4      p\
        P                  ! W4      p\
        P                  ! V4      pV ! WC4      pVP                  W6^R7       R# )Nr/   N)triinterpolatorr  N)rE  rE  )	rU   mgridr  r  
zeros_liker   r   r  r  )rG  r$   r%   r1  r   r  r5  s   &      r&   test_trirefine_maskedrI  0  s     88FDA
		!))+q!A
		!))+q!A
aA


Q
"C$$S)G#!F1=r)   c                   . p\        V ^,
          4       F  p\        V ^,
          4       Fj  pW#V ,          ,           pV^,           W0,          ,           pW#^,           V ,          ,           pV^,           V^,           V ,          ,           pWWW.WGV..,          pKl  	  K  	  \        P                  ! V\        P                  R7      # )zM
Return (2*(N-1)**2, 3) array of triangles to mesh (N, N)-point np.meshgrid.
r   )rZ  rU   r   r   )r=  r   r<  jr   r   r   ds   &       r&   r.  r.  B  s     C1Q3ZqsAaCA1AqS!GA11aAIay))C   88Crxx((r)   c                      \         P                  ! 4       P                  4       p \        P                  ! . RO. RO. RO. RO.R7      pV P                  VR4      f   Q R4       hR# )	rS   r   zb-Nz(triplot should return the artist it addsr&  r'  r   r   )r   r   r   r   r   r  )r   rN   s     r&   test_triplot_returnrN  Q  sW    		!	!	#B2i(*F ::fd#/ 323/r)   c                     \         P                  ! . RO. RO.4      p \         P                  ! V 4      '       d   Q h\         P                  ! V RRR7      p\         P                  ! V4      '       g   Q h\         P                  ! . RO4      p\         P                  ! . R	O4      p\        P                  ! W#V 4      p\        P                  ! W#V4      p\        P
                  ! V4      p\        P
                  ! V4      pVP                  ^R7      pVP                  ^R7      p	\        VP                  V	P                  4       R# )
r/   TF)r   orderr  Nr(  )r/   r   r   )g(\?gzG?gQ?g{Gz?)gQ@@gzGA@gQA@gףp=
A@)	rU   r   	isfortranr   r   r  r)  r   r   )

triangles1
triangles2r$   r%   triang1triang2refiner1refiner2fine_triang1fine_triang2s
             r&   ,test_trirefiner_fortran_contiguous_trianglesr[  [  s     9i01J||J''''*4s;J<<
####
)*A
-.A  z2G  z2G%%g.H%%g.H000:L000:L|--|/E/EFr)   c                     \         P                  ! R^^d4      p \        \         P                  \         P                  ! W 4      4      w  rW^,
          8  VR8  ,          VR8  ,          pW,          W#,          r!\         P
                  ! ^4      pV\         P                  ! V4      ,          V\         P                  ! V4      ,          ,
          pV\         P                  ! V4      ,          V\         P                  ! V4      ,          ,           p\        P                  ! WV4      pVP                  pRVn        VP                  p	\        W4       R# )r/   Nr  g333333g333333)rU   rW   maprX   rV   radiansrD  rF  r   r   rL   r]   r   )
xir$   r%   wr  x1y1rN   qhull_neighborsown_neighborss
             r&   test_qhull_triangle_orientationre  r  s    	RC	 BrxxR,-DA	
Uq5y!QX.A4qJJrNE	
266%=1RVVE]?	*B	
266%=1RVVE]?	*B 'F &&O F$$M6r)   c                     \         P                  ! . RO4      p \         P                  ! R R R\         P                  ! R4      ,          RR.4      p\         P                  ! . R	O. R
O. RO.\         P                  R7      p\         P                  ! . RO\        R7      p\
        P                  ! WW#R7      p\
        P                  ! V4      pVP                  4        R# )rS   rT   r   r   r   r   Nr  r  r.   r   r   r  )	rU   r   r  r   r  r   r   r  _get_compressed_triangulation)r$   r%   r   r   rN   r  s         r&   #test_trianalyzer_mismatched_indicesrh    s    
&'A
"b#bggbk/334A)Y	:"((KI88(5Di;F'H **,r)   c            	          . ROp . ROp. ROp\         P                  ! 4        \        P                  ! \        4      ;_uu_ 4        \         P
                  ! WVRR .4       RRR4       R#   + '       g   i     R# ; i)rS   rT   N)rS   rT   rT   )rS   rS   rT   )r  r   r  )r   r   r6   rG   rH   tricontourf)r$   r%   r1  s      r&   "test_tricontourf_decreasing_levelsrk    sL    AAAJJL	z	"	"a#s, 
#	"	"	"s   A))A:	c                    V ^8  d   QhRR/# )r/   returnNr*   )formats   "r&   __annotate__ro    s     X= X=t X=r)   c                  V   ^ RI Hp  \        P                  ! \        RR7      ;_uu_ 4        \
        P                  P                  4        RRR4       \        P                  ! \        RR7      ;_uu_ 4        \
        P                  P                  \        P                  ! . 4      \        P                  ! ^.4      \        P                  ! . .4      RRRR4       RRR4       \        P                  ! . RO\        P                  R7      p\        P                  ! . RO\        P                  R7      p\        P                  ! \        RR7      ;_uu_ 4        \
        P                  P                  W\        P                  ! ^ ^..4      RRRR4       RRR4       \        P                  ! . RO.\        P                  R7      p\        P                  ! \        R	R7      ;_uu_ 4        \
        P                  P                  WV\        P                  ! ^ ^.4      RRR4       RRR4       \        P                  ! \        R
R7      ;_uu_ 4        \
        P                  P                  WVR\        P                  ! ^..4      RR4       RRR4       \        P                  ! \        RR7      ;_uu_ 4        \
        P                  P                  WVRR\        P                  ! R..4      R4       RRR4       \
        P                  P                  WVRRRR4      p\        P                  ! \        RR7      ;_uu_ 4        VP                  . 4       RRR4       ^ ^.R3 FA  p\        P                  ! \        R	R7      ;_uu_ 4        VP                  V4       RRR4       KC  	  VP                  \        P                  ! R.4      4       \        VP                  4       \        P                   ! R4      4       VP                  R4       \        VP                  4       ^^ .^^ .^^..4       \        P                  ! \        RR7      ;_uu_ 4        \
        P                  P#                  4        RRR4       \        P                  ! \        RR7      ;_uu_ 4        \
        P                  P#                  V\        P                  ! ^.4      4       RRR4       \        P                  ! . RO4      p\
        P                  P#                  WF4      p\        P                  ! \        RR7      ;_uu_ 4        VP%                  ^^ 4       RRR4       \        P                  ! \        RR7      ;_uu_ 4        \
        P                  P'                  4        RRR4       \
        P                  P'                  V4      p\        P                  ! \        RR7      ;_uu_ 4        VP)                  \        P                  ! ^ .4      \        P                  ! ^ ^.4      4       RRR4       R#   + '       g   i     EL; i  + '       g   i     ELi; i  + '       g   i     EL; i  + '       g   i     ELI; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELU; i  + '       g   i     EKd  ; i  + '       g   i     EL`; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELy; i  + '       g   i     R# ; i)r   )_triz1__init__\(\): incompatible constructor arguments.rB   Nz,x and y must be 1D arrays of the same lengthFr   z.triangles must be a 2D array of shape \(\?,3\)zCmask must be a 1D array with the same length as the triangles arrayz,edges must be a 2D array with shape \(\?,2\)zGneighbors must be a 2D array with the same shape as the triangles arrayzMz must be a 1D array with the same length as the triangulation x and y arraysTz?z must be a 1D array with the same length as the x and y arraysz(filled contour levels must be increasingz*x and y must be array-like with same shaper*   )r   r   r   r?   r.   r,   )r   r/   )
matplotlibrq  r6   rG   r   r  r   rH   rU   r   r[  int_calculate_plane_coefficientsrM   r   	get_edgesemptyTriContourGeneratorcreate_filled_contourTrapezoidMapTriFinder	find_many)	rq  r$   r%   r  rN   r   r1  tcgr  s	            r&   test_internal_cpp_apir|    sE    
F
H 
H 	 
H
 
M
O 
Orxx|RXXqc]BHHbTNBPRTV$	&
O
 	"**-A
"**-A	C
E 
E 	qRXX1vh%7RUK
E
 88YKrww/D	%
& 
& 	qT288QF+;RUK	
& 
M
O 
OqT2rxx!EJ
O 
%
& 
& 	qT2r288bTF3CUK	
& XX##A$BEBF	2
3 
3 	++B/	
3 Q]])* * OOD!	* *  OOBHHdV$%v'')288F+;<
OOBv'')QFQFQF+CD 
F
H 
H 	$$&
H
 
T
V 
V 	$$VRXXqc];
V
 	A
((
&
&v
1C	I
K 
K!!!Q'
K
 
F
H 
H 	&&(
H
 ..v6I	K
M 
MBHHaSM288QF+;<
M 
Mc
H 
H 
H

O 
O 
O
E 
E 
E
& 
& 
&
O 
O 
O
& 
& 
&
3 
3 
3* * *
H 
H 
H

V 
V 
V
K 
K 
K

H 
H 
H
M 
M 
Ms   X&6A$X:<Y';Y";Y65;Z
 ZZ2[6[5[/4\>\&X7	:Y	Y	"Y3	6Z	
Z	Z/	2[[	[,	/\ 	\	\(	c                  :   \         P                  ! . RO4      p \         P                  ! . RO4      pRp\        P                  ! W4      p\        P                  ! W,           W,           4      p\	        VP
                  4      \	        VP
                  4      8X  g   Q hR# )r   g    _BN)r   r   r   r   r   )r   r   r   r   r   )rU   r   r   r   rY   r   )r$   r%   offsetrN   triang_offsets        r&   test_qhull_large_offsetr    so    


$%A


$%AF%F&&qz1:>Mv C(?(?$@@@@r)   c            
         . ROp . ROp\         P                  ! W4      p\        P                  ! 4        \        P
                  ! \        RR7      ;_uu_ 4        \        P                  ! V^ ^^\        P                  .4       RRR4       \        P
                  ! \        RR7      ;_uu_ 4        \        P                  ! V^ ^^\        P                  ) .4       RRR4       \        P
                  ! \        RR7      ;_uu_ 4        \        P                  ! V^ ^^\        P                  .4       RRR4       \        P
                  ! \        RR7      ;_uu_ 4        \        P                  ! V\        P                  P                  . RO. R	OR7      4       RRR4       R#   + '       g   i     EL'; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)
r   zCz array must not contain non-finite values within the triangulationrB   Nz9z must not contain masked points within the triangulationr   r   r   )r   r   r/   r1   )r   r   r   r   )r   r   r   r   r6   rG   rH   rj  rU   infr  r  r   )r$   r%   rN   s      r&   test_tricontour_non_finite_zr    sg   AA%FJJL	z *K 
L 
LAq"&& 12
L 
z *K 
L 
LAq266' 23
L 
z *K 
L 
LAq"&& 12
L 
z *D 
E 
EL| LM
E 
E
L 
L 
L
L 
L
L 
L
E 
E 
Es0   *F .+F4*G;G F1	4G	G	G+	c                  *   . ROp . ROp. ROp\         P                  ! 4       w  r4VP                  WV4      pVP                  WV4      pVP                  VP                  8w  g   Q hVP                  WR4      pVP                  VP                  8X  g   Q hR# )rS   N)rS   r   rT   )rS   rT   rS   )rT   rp   r   )r   r   rj  r  _contour_generator)r$   r%   r1  r   r   tcs1tcs2tcs3s           r&   test_tricontourset_reuser    s     	AAAllnGC>>!"D==q!D""d&=&======!D""d&=&====r)   png)
extensionsc                     . ROp. ROp. RO.pV P                  4       P                  W#VRR7       VP                  4       P                  W#VRR7       R# )r   z--)ls)	linestyleNr>   r?   r.   )r   r  )fig_testfig_refr$   r%   datas   &&   r&   test_triplot_with_lsr  ,  sO    AA;Ddt4qTT:r)   c                      . ROp . ROp. RO.p\         P                  ! 4       w  r4VP                  WVRR7      w  rVVP                  4       w  rxVR.8X  g   Q h\	        V4      ^8X  g   Q hV^ ,          VJ g   Q hR# )r   label)r  Nr>   r?   r.   )r   r   r  get_legend_handles_labelsrY   )	r$   r%   r  r   r   linesmarkershandleslabelss	            r&   test_triplot_labelr  5  sz    AA;DllnGCZZd'Z:NE224OGgYw<11:r)   c                     . ROp . ROp\         P                  ! W4      p\        P                  ! 4       w  r4VP	                  V. ROR.R7      pVP                  4       p\        V4      ^8X  g   Q h^^ .^^.^ ^..p\        V^ ,          P                  V4       \        V^ ,          P                  . R	O4       \        V^ ,          P                  RR7      V.4       VP	                  V. R
OR.R7      pVP                  4       p\        V4      ^8X  g   Q h^^.^^.^^.^^.^^..p\        V^ ,          P                  V4       \        V^ ,          P                  . RO4       \        V^ ,          P                  4       V.4       R# )r   r   r  F)closed_onlyNr   r   r   r   r/   r   r   r   r   r/   r   r   r   r   r   r   r/   r/   r   r   r   r   r   r   r/   r/   r/   r  )r   r   r   r   r  	get_pathsrY   r   verticesr   codesto_polygonsr$   r%   rN   r{  r   cspathsexpected_verticess           r&   test_tricontour_pathr  A  s[   AA%FLLNEA 
vu	=BLLNEu:??Q!Q!Q0eAh//1BCuQx~~y1a/2C1DF 
vu	=BLLNEu:??Q!Q!Q!Q!Q@eAh//1BCuQx~~'78eAh2247H6IJr)   c                     . ROp . ROp\         P                  ! W4      p\        P                  ! 4       w  r4VP	                  V. RORR.R7      pVP                  4       p\        V4      ^8X  g   Q h^^.^^.^^.^^.^^..p\        V^ ,          P                  V4       \        V^ ,          P                  . RO4       \        V^ ,          P                  4       V.4       VP	                  V. R	ORR.R7      pVP                  4       p\        V4      ^8X  g   Q h^^ .^^.^ ^.^ ^ .^^ ..p\        V^ ,          P                  V4       \        V^ ,          P                  . RO4       \        V^ ,          P                  4       V.4       VP	                  V. ROR
R.R7      pVP                  4       p\        V4      ^8X  g   Q h^ ^ .^^ .^^.^ ^.^ ^ .^^.^^.^^.^^.^^..
p\        V^ ,          P                  V4       \        V^ ,          P                  . RO4       \        V^ ,          P                  4       \        P                  ! V^.4      4       R# )r   r   r   r  Nr  r  r  r  r  g      )
r   r/   r/   r/   r  r   r/   r/   r/   r  )r   r   r   r   rj  r  rY   r   r  r   r  r  rU   splitr  s           r&   test_tricontourf_pathr  [  s.   AA%FLLNEA 
c
	CBLLNEu:??Q!Q!Q!Q!Q@eAh//1BCuQx~~'78eAh2247H6IJ 
c
	CBLLNEu:??Q!Q!Q!Q!Q@eAh//1BCuQx~~'78eAh2247H6IJ 
s	DBLLNEu:??Q!Q!Q!Q!QQ!Q!Q!Q!QAeAh//1BCuQx~~'GHeAh224bhh?PSTRU6VWr)   )r   r/   r   )rR   r   rR   r  )rR   r   r   )r   r   r   r/   r   r/   )rR   rR   rR   r   rR   r   )DnumpyrU   numpy.testingr   r   r   numpy.ma.testutilsr  	testutilsr,  r6   rr  r  matplotlib.pyplotpyplotr   matplotlib.trir   r   matplotlib.pathr   matplotlib.testing.decoratorsr   r   r
   r@   rJ   rP   re   rm   rs   r7   r8   rv   r   r   r   r   r   r   r
  r@  rc  r  r  r  r  r  r  r$  r@  r*  r+  rI  r.  rN  r[  re  rh  rk  r|  r  r  r  r  r  r  r  r*   r)   r&   <module>r     s(   F F # #       O' ':/(".'HTA( HS1#JVaV 		+,
" 
!
!
*FZ #$% &6*<*	=1d.N\6~SGlKF\H4;5|ZMz ./TuM#I N#IL ,-4UK/9 L/9h5.p58p 44335&0  2>	2>)3G.7.
--X=vAN0> (; );	K4 Xr)   