+
     ]i=0  c                   s    R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
Ht ^RIHtHtHt ^RIHt ^RIHt R t ! R	 R
]4      t ! R R]4      t ! R R]4      tR# )z/
An experimental support for curvilinear grid.
N)_api)Path)Affine2DIdentityTransform)_FixedAxisArtistHelperBase_FloatingAxisArtistHelperBaseGridHelperBase)
AxisArtist)
GridFinderc                s   \         P                  ! \        4      P                  R,          pV ! W4      p\	        V4      w  rxW,
          p	W,
          p
\         P
                  ! R^.W8  4      \         P                  ! V\         P                  ! W4      4      ,          pV ! W,           V4      p\	        V4      w  rW-,
          pW,
          p\         P
                  ! R^.VV8  4      \         P                  ! V\         P                  ! VV4      4      ,          pV ! WV,           4      pWlV,
          V,          VV,
          V,          3# )z
Compute *func* and its derivatives along x and y at positions *xs*, *ys*,
while ensuring that finite difference calculations don't try to evaluate
values outside of *xlims*, *ylims*.
g      ?)npZfinfoZfloatepsZsortedZtakeZminimumZmaximum)ZfuncZxsZysZxlimsZylimsr   ZvalZxloZxhiZdxloZdxhiZxepsZval_dxZyloZyhiZdyloZdyhiZyepsZval_dys   &&&&&              V/usr/lib64/python3.14/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py_value_and_jacobianr      s     ((5/

#
&C
r,C e}HC8D8DGGRGT\*jjbjj456D")R Fe}HC8D8DGGRGTT\*jjbjjt456D"4i F3,$&#(=>>    c                   sL   a a ] tR t^,t oRtRV 3R lltR tR tR tRt	Vt
V ;t# )FixedAxisArtistHelperz 
Helper class for a fixed axis.
c                sl   < \         SV `  VR7       Wn        Vf   V P                  pW0n        W n        R# )e
nth_coord = along which coordinate value varies.
 nth_coord = 0 ->  x axis, nth_coord = 1 -> y axis
)locN)super__init__grid_helper	nth_coordnth_coord_ticksside)selfr   r   r   	__class__s   &&&&r   r   ZFixedAxisArtistHelper.__init__1   s5     	T"&""nnO.	r   c                s<    V P                   P                  V4       R # N)r   
update_limr   axes   &&r   r   Z FixedAxisArtistHelper.update_lim@   s    ##D)r   c                    VP                   # r   	transDatar   r   r   get_tick_transformZ(FixedAxisArtistHelper.get_tick_transformC       ~~r   c                s*  a aa S P                   ^ 8X  d   VP                  4       MVP                  4       w  r#W#8  d   RRRRRRRR/S P                  ,          oMS P                  o\	        ^Z^Z^ ^ R7      S,          oVV V3R lpV! 4       \        . 4      3# )z tick_loc, tick_angle, tick_labelleftrighttopbottomr$   r%   r'   r&   c               3   s(  <"   SP                   R 3^SP                   ,
          R33 Fe  w  rSP                  P                  RR.V ,          ,          pVR,          S,           F&  p. VR,          OSNV'       d
   VR,          MRN5x  K(  	  Kg  	  R# 5i)	TFlonlatticksr   label N)r   r   
_grid_info)r   Zshow_labelsZgitickangle_tangentr   r   s       r   
iter_majorZ<FixedAxisArtistHelper.get_tick_iterators.<locals>.iter_majorQ   s     ))401t7K7K3KU2S+U&	%%00%	1JKwK--DCDK C C-8DMbC C .+Us   BB)r   get_ylimget_xlimr   dictiter)r   r   Zv1Zv2r1   r0   r   s   f&   @@r   get_tick_iteratorsZ(FixedAxisArtistHelper.get_tick_iteratorsF   s    $(NNa$7T]]_7GWf8Xu66:iiAD 99D"Bqa@F	C |T"X%%r   )r   r   r   r   )__name__
__module____qualname____firstlineno____doc__r   r   r"   r6   __static_attributes____classdictcell____classcell__r   Z__classdict__   @@r   r   r   ,   s#     *& &r   r   c                   sf   a a ] tR t^\t oRV 3R lltR tR tR tR tR t	R t
R tR	 tR
tVtV ;t# )FloatingAxisArtistHelperc                s   < \         SV `  W#4       W0n        Wn        \        P
                  ) \        P
                  3V n        ^dV n        R# )r   N)r   r   valuer   r
   inf	_extremes_line_num_points)r   r   r   rB   axis_directionr   s   &&&&&r   r   Z!FloatingAxisArtistHelper.__init__^   s:    
 	*
&&&"&& #r   c                sh    Vf   \         P                  ) pVf   \         P                  pW3V n        R # r   )r
   rC   rD   )r   e1Ze2s   &&&r   set_extremesZ%FloatingAxisArtistHelper.set_extremesi   s)    :&&B:Br   c                s   V P                   P                  V4       VP                  4       w  r#VP                  4       w  rEV P                   P                  pVP                  VP                  W$W54      pVw  rrV P                  w  rV P                  ^ 8X  d   \        W4      p
\        W4      pM'V P                  ^8X  d   \        W4      p\        W4      p	VP                  W4      w  rpVP                  W4      w  pppV P                  ^ 8X  dc   \        P                  ! V P                  V P                   4      p\        P"                  ! WV P                  4      pVP%                  VV4      w  ppMrV P                  ^8X  db   \        P"                  ! WV P                  4      p\        P                  ! V P                  V P                   4      pVP%                  VV4      w  ppRWW3RW\        P&                  ! V4      3RVV\        P&                  ! V4      3RVP)                  ^RVV4      RVP)                  ^RVV4      RXX3/V n        R# )	    extremeslon_infolat_info
lon_labelsr'   
lat_labelsline_xyN)r   r   r3   r2   grid_finderextreme_finderZinv_transform_xyrD   r   ZmaxZmingrid_locator1grid_locator2r
   ZfullrE   rB   ZlinspaceZtransform_xyZasarrayZ_format_ticksr.   )r   r   x1x2y1y2rP   rJ   Zlon_minZlon_maxZlat_minZlat_maxZe_minZe_maxlon_levslon_n
lon_factorlat_levslat_n
lat_factorxx0yy0ZxxZyys   &&                      r   r   Z#FloatingAxisArtistHelper.update_limp   s   ##D)&&22--k.J.J.0b> .6*'~~>>Q%)G%)G^^q %)G%)G %%g7 	$ %%g7 	$% >>Q''$//<C++g0E0EFC --c37FB^^q ++g0E0EFC''$//<C --c37FB 7<"**Z*@A5"**Z*@A+338Z3+338Z3Bx	
r   c                    \        4       # r   )r   r   r   r   get_axislabel_transformZ0FloatingAxisArtistHelper.get_axislabel_transform   s
    zr   c           	     sh  a a VV 3R  lpS P                   R,          w  r4rVS P                  ^ 8X  d   S P                  pWV,           ^,          pM,S P                  ^8X  d   W4,           ^,          pS P                  p\        VXXW43WV34      w  rpSP                  P                  4       P                  V	4      p^ V^ ,          u;8:  d   ^8:  dg   M R# ^ V^,          u;8:  d   ^8:  dM   M R# W.S P                  ,          pV	\        P                  ! \        P                  ! VRRR1,          !  4      3# R# )c                 s   < SP                   P                  P                  4       SP                  ,           pVP	                  W.4      P
                  # r   )r   rP   get_transformr!   	transformTxyZtrfr   r      && r   trf_xyZ@FloatingAxisArtistHelper.get_axislabel_pos_angle.<locals>.trf_xy   s=    ""..<<>OC==!(***r   rJ   N)NNr	   )
r.   r   rB   r   	transAxesZinvertedrc   r
   rad2degarctan2)r   r   ri   ZxminZxmaxZyminZymaxr^   r_   Zxy1Zdxy1_dxZdxy1_dyZpZds   ff            r   get_axislabel_pos_angleZ0FloatingAxisArtistHelper.get_axislabel_pos_angle   s   	+ "&!<D>>Q**C;!#C^^q ;!#C**C 3CtlTL!:gNN##%//4!>> 	  1Q4n1n  "4>>2A

2::q2w#7888r   c                r`   r   )r   r   r   r   r"   Z+FloatingAxisArtistHelper.get_tick_transform   s     ""r   c                s  a aaaaaaaa S P                   R,          w  r#pW$,          pS P                   R,          w  rgpWh,          p	S P                  w  rVV 3R lpS P                  ^ 8X  dm   W8*  W[8*  ,          p\        VS P                  W],          \
        P                  ) \
        P                  3W34      w  w  oow  rw  ppS P                   R,          oM|S P                  ^8X  dl   W8*  W8*  ,          p\        WV,          S P                  \
        P                  ) \
        P                  3W34      w  w  oow  ppw  rS P                   R,          o\        SX4       UUu. uF  w  ppV'       g   K  VNK  	  uppo\
        P                  ! XX4      o\
        P                  ! XX4      oV^ 8H  V^ 8H  ,          pSV,          \
        P                  ^,          ,           SV&   S P                  S4      SP                  ,
          o\        P                  ! \        P                  P                   R4      oVVVVVVV3R lpV! 4       \#        . 4      3# u uppi )z9tick_loc, tick_angle, tick_label, (optionally) tick_labelrL   rK   c                 s   < SP                   P                  P                  4       SP                  ,           pVP	                  \
        P                  ! \
        P                  ! W4      4      4      P                  # r   )	r   rP   rb   r!   rc   r
   column_stackZbroadcast_arraysrd   re   rh   r   ri   Z;FloatingAxisArtistHelper.get_tick_iterators.<locals>.trf_xy   sO    ""..<<>OC==1D1DQ1J!KLNNNr   rN   rM   c               3   s  <"   \        SSSSS	4       Fg  w  rr#pS
P                  W34      pS! V^ ,          4      '       g   K0  S! V^,          4      '       g   KG  W..\        P                  ! W#.4      OVN5x  Ki  	  R# 5i)rI   N)ziprc   r
   rk   )rf   rg   ZnormalZtangentZlabZc2angle_normalr0   in_01labelstick_to_axesxx1yy1s         r   r1   Z?FloatingAxisArtistHelper.get_tick_iterators.<locals>.iter_major   ss     3\=&I +fs!++QF3A<<E"Q%LL&E2::v.?#@E#EE Js   ;B B &B )rI   i   )r.   rD   r   r   rB   r
   rC   ro   rl   Zpir"   rj   	functoolsZpartialmplZ
transformsZ_interval_contains_closer5   )r   r   r[   r\   r]   r_   rX   rY   rZ   r^   Ze0rG   ri   ZmaskZdxx1Zdyy1Zdxx2Zdyy2ZlZmZmmr1   rp   r0   rq   rr   rs   rt   ru   s   ff                    @@@@@@@r   r6   Z+FloatingAxisArtistHelper.get_tick_iterators   s    '+ooj&A##&*ooj&A##	O
 >>QI#),D5H

CI/@2(6L2JS#ltT__\2F^^q I#),D5HD	4::/@2(6L2JS#tlt__\2F #FD 17 11Q!! 17zz$-

4.aiDAI&(,ruuqy8R..t4t~~E!!NN33V=	F 	F |T"X%%% 8s   #I5Ic                r   r   r    r   r   r   get_line_transformZ+FloatingAxisArtistHelper.get_line_transform   r#   r   c                s    V P                  V4       V P                  R ,          w  r#\        \        P                  ! W#.4      4      # )rO   )r   r.   r   r
   rn   )r   r   rf   rg   s   &&  r   get_lineZ!FloatingAxisArtistHelper.get_line   s4    y)BOOQF+,,r   )rD   r.   rE   r   rB   r   )r7   r8   r9   r:   r   rH   r   ra   rm   r"   r6   rx   ry   r<   r=   r>   r?   r@   r   rA   rA   \   s9     	$ )
V*#.&`- -r   rA   c                   s   a a ] tR t^t oRV 3R lltRR lt]P                  ! RR4      RR l4       tRR lt	R t
RR lt]P                  ! R4      RR	 l4       tR
tVtV ;t# )GridHelperCurveLinearc                s\   < \         SV `  4        RV n        \        VVVVVV4      V n        R# )a_  
Parameters
----------
aux_trans : `.Transform` or tuple[Callable, Callable]
    The transform from curved coordinates to rectilinear coordinate:
    either a `.Transform` instance (which provides also its inverse),
    or a pair of callables ``(trans, inv_trans)`` that define the
    transform and its inverse.  The callables should have signature::

        x_rect, y_rect = trans(x_curved, y_curved)
        x_curved, y_curved = inv_trans(x_rect, y_rect)

extreme_finder

grid_locator1, grid_locator2
    Grid locators for each axis.

tick_formatter1, tick_formatter2
    Tick formatters for each axis.
N)r   r   r.   r   rP   )r   	aux_transrQ   rR   rS   Ztick_formatter1Ztick_formatter2r   s   &&&&&&&r   r   ZGridHelperCurveLinear.__init__   s5    4 	%i&4&3&3&5&57r   c                s    Ve   V P                   P                  V4       V P                   P                  ! R/ VB  R V n        R # )N )rP   Zupdate_transformZupdate_old_limits)r   r{   Zkwargss   &&,r   update_grid_finderZ(GridHelperCurveLinear.update_grid_finder  s;     --i8)&)r   z3.9r   c                sf    Vf   V P                   pVf   Tp\        WVR7      p\        WVVR7      pV# )N)r   )rF   )r   r   r   )r   r   r   rF   Zoffsetr   helperaxislines   &&&&&&  r   new_fixed_axisZ$GridHelperCurveLinear.new_fixed_axis  s<     <99D! N&t)Ld>J r   c                s    Vf   V P                   p\        WW$4      p\        W54      pVP                  P	                  R4       VP                  P                  VP                   P                  4       V# )NT)r   rA   r   ZlineZset_clip_onZset_clip_boxZbbox)r   r   rB   r   rF   r   r   s   &&&&&  r   new_floating_axisZ'GridHelperCurveLinear.new_floating_axis&  s^    <99D)U4d+!!$'""8==#5#56 r   c                sH    V P                   P                  WW44      V n        R # r   )rP   Zget_grid_infor.   )r   rT   rV   rU   rW   s   &&&&&r   _update_gridZ"GridHelperCurveLinear._update_grid2  s    **88Hr   c                s    . pVR9   d3   V P                   R,          R,           F  pVP                  V4       K  	  VR9   d3   V P                   R,          R,           F  pVP                  V4       K  	  V# )bothr)   Zlinesr*   )r   rf   )r   rg   )r.   Zextend)r   ZwhichZaxisZ
grid_linesZgls   &&&  r   get_gridlinesZ#GridHelperCurveLinear.get_gridlines5  so    
= ooe,W55!!"% 6= ooe,W55!!"% 6r   c              #  sZ  "   \        ^Z^Z^ ^ R7      V,          pRR.V,          pV'       gD   V P                  V,          R,          V,           F  p. VR,          OVNVR,          N5x  K  	  R# V P                  V,          R,          V,           F  p. VR,          OVNRN5x  K  	  R# 5i)	iZ   r(   r)   r*   r+   r   r,   r-   N)r4   r.   )r   r   Z	axis_sideZminorr0   Z
lon_or_latr/   s   &&&&   r   get_tick_iteratorZ'GridHelperCurveLinear.get_tick_iterator?  s     "Bqa@KU^I.

3G<YGG@tE{@M@4=@@ H 
3G<YGG5tE{5M5255 Hs   B)B+)r.   r}   rP   )NNNNNr   )NNNN)Nr'   )Zmajorr   )F)r7   r8   r9   r:   r   r~   r    Zmake_keyword_onlyr   r   r   r   Z
deprecatedr   r<   r=   r>   r?   r@   r   rz   rz      sc     !7F  
E;/
 0

I 
__U6 6 6r   rz   )r;   rv   Znumpyr
   Z
matplotlibrw   r    Zmatplotlib.pathr   Zmatplotlib.transformsr   r   Z	axislinesr   r   r   Zaxis_artistr   rP   r   r   r   rA   rz   r|   r   r   <module>r      sa          =O O # #?2-&6 -&`P-< P-fY6N Y6r   