+
     ]ic,  c                   s*   ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ]! RR.RR7      RR	 l4       t].tR
.tR t]P"                  P%                  R]]R7      R 4       t]P"                  P%                  R]]R7      R 4       t]P"                  P%                  R]]R7      R 4       t]P"                  P%                  R]]R7      R 4       t]P"                  P%                  R]]R7      R 4       tR tR tR tR tR t ! R R4      tR# )i    N_preprocess_data)Axes)subprocess_run_for_testing)check_figures_equalxyreplace_nameslabel_namerc           
      H    R \        V4       R\        V4       RV RV RV 2
# zx: z, y: z, ls: z, w: z	, label: Zlistaxr   r   Zlslabelw   &&&&&&L/usr/lib64/python3.14/site-packages/matplotlib/tests/test_preprocess_data.py	plot_funcr      s/    a	tAwivbTqc5'JJ    r   c                 s   R p R pR pR p\        RR.R7      ! V 4       \        RR.R7      ! V4       \        RR.R7      ! V4       \        P                  ! \        4      ;_uu_ 4        \        . ROR7      ! V4       R	R	R	4       \        . R	R
7      ! V 4       \        . R	R
7      ! V4       \        . R	R
7      ! V4       \        . R	R
7      ! V4       \        P                  ! \        4      ;_uu_ 4        \        RR7      ! V 4       R	R	R	4       \        P                  ! \        4      ;_uu_ 4        \        RR7      ! V4       R	R	R	4       R	#   + '       g   i     L; i  + '       g   i     Lb; i  + '       g   i     R	# ; i)z.Test decorator invocations -> no replacements.c                     R # N )r   r   r   s   &&&r   funcZ%test_compiletime_checks.<locals>.func   s    r   c                 r   r   r   )r   r   r   argss   &&&*r   	func_argsZ*test_compiletime_checks.<locals>.func_args    s    Dr   c                 r   r   r   )r   r   r   kwargss   &&&,r   func_kwargsZ,test_compiletime_checks.<locals>.func_kwargs!   s    r   c                  r   r   r   )r   r   s   *,r   func_no_ax_argsZ0test_compiletime_checks.<locals>.func_no_ax_args"   s    $r   r   r   r   zNr   r	   )r   r   r   )r   pytestraisesZAssertionError)r   r   r   r   s       r   test_compiletime_checksr#      s    (-. C:.t4C:.{;C:.y9 
~	&	&7	B 
'
 248>248C248E248I 
~	&	&S)$/ 
' 
~	&	&S))4 
'	& 
'	& 
'	& 
'	&	&s$   +E6E#3E6E 	#E3	6F	r   )Zidsc                s    V ! RRR4      R8X  g   Q hV ! RRRR7      R8X  g   Q hV ! RRRRR7      R8X  g   Q hV ! RRRR	R7      R
8X  g   Q hV ! RRRRR7      R8X  g   Q hV ! RRRR	R7      R
8X  g   Q hR# )z%Test without data -> no replacements.Nr   r   z.x: ['x'], y: ['y'], ls: x, w: xyz, label: None)r   r    )r   z*x: ['x'], y: ['y'], ls: x, w: xyz, label: textz.x: ['x'], y: ['y'], ls: x, w: xyz, label: text)r   r   r   r   )r   s   &r   test_function_call_without_datar&   =   s     sC <= > =$<= > =sCr*89 : 9sCv.<= > =2.89 : 962<= > =r   c                sl    R^R^/pV ! RVP                  4       VP                  4       4      R8X  g   Q hR# )z8Tests with dict input, unpacking via preprocess_pipelineabNz4x: ['a', 'b'], y: [1, 2], ls: x, w: xyz, label: None)keysvaluesr   data   & r   "test_function_call_with_dict_inputr.   N   s?     CDtyy{DKKM2BC D Cr   c                s
   R^^.R^^	.RR/pV ! RRRVR7      R8X  g   Q hV ! RRRVR7      R8X  g   Q hV ! RRRR	VR
7      R8X  g   Q hV ! RRRRVR
7      R8X  g   Q hV ! RRRR	VR7      R8X  g   Q hV ! RRRRVR7      R8X  g   Q hR# )zCTest with dict data -> label comes from the value of 'x' parameter.r'   r(   r   NOTNr,   -x: [1, 2], y: [8, 9], ls: x, w: xyz, label: br   r   r,   r$   r   r,   ,x: [1, 2], y: [8, 9], ls: x, w: xyz, label: r%   0x: [1, 2], y: [8, 9], ls: x, w: xyz, label: textr   r   r   r,   r   r+   r-   r   !test_function_call_with_dict_datar7   V   s     !Qq!fc51DsCd+;< = <$/;< = <sCr5:; < ;sCvD9>? @ ?2D9:; < ;6=>? @ ?r   c                s   R^^.RR/pV ! RRRVR7      R8X  g   Q hV ! RRRVR7      R8X  g   Q hV ! RRRR	VR
7      R8X  g   Q hV ! RRRRVR
7      R8X  g   Q hV ! RRRR	VR7      R8X  g   Q hV ! RRRRVR7      R8X  g   Q hR# )zETest the case that one var is not in data -> half replaces, half keptr'   r   r/   Nr(   r0   z,x: [1, 2], y: ['b'], ls: x, w: xyz, label: br2   r$   r3   z+x: [1, 2], y: ['b'], ls: x, w: xyz, label: r%   z/x: [1, 2], y: ['b'], ls: x, w: xyz, label: textr6   r   r+   r-   r   -test_function_call_with_dict_data_not_in_datar8   h   s     !Qe$DsCd+:; < ;$/:; < ;sCr59: ; :sCvD9=> ? >2D99: ; :6==> ? >r   c           
     s   VP                  R\        P                  ! ^^.\        P                  R7      R\        P                  ! ^^	.\        P                  R7      RRR./4      pV ! RRRVR7      R8X  g   Q hV ! RRRVR	7      R8X  g   Q hV ! RRRR
VR7      R8X  g   Q hV ! RRRRVR7      R8X  g   Q hV ! RRRR
VR7      R8X  g   Q hV ! RRRRVR7      R8X  g   Q hR# )zDTest with pandas dataframe -> label comes from ``data["col"].name``.r'   )Zdtyper(   r   r/   Nr0   r1   r2   r$   r3   r4   r%   r5   r6   )Z	DataFramenpZarrayZint32)r   Zpdr,   s   && r   #test_function_call_with_pandas_datar:   z   s    <<bhh1vRXX>bhh1vRXX>uen. /D sCd+;< = <$/;< = <sCr5:; < ;sCvD9>? @ ?2D9:; < ;6=>? @ ?r   c            	     s>   R^^.R^^	.RR/p \        RR7      RR l4       pV! RRRRV R	7      R
8X  g   Q hV! RRRRV R7      R
8X  g   Q hV! RRRRRV R7      R8X  g   Q hV! RRRRRV R7      R8X  g   Q hV! RRRRRV R7      R8X  g   Q hV! RRRRRV R7      R8X  g   Q hR# )zETest without a "replace_names" argument, all vars should be replaced.r'   r(   r   xyzr   r    Nc           
      r
   r   r   r   r   r   func_replace_allZ8test_function_call_replace_all.<locals>.func_replace_all   /    T!WIU47)6"U1#YugNNr   )r   r,   r1   )r   r   r   r,   r$   )r   r   r,   r4   r%   r5   )r   r   r   r   r,   )r   Nr/   r    )r,   r<        r   test_function_call_replace_allr?      s   !Qq!fc51D#&O 'O T3s>;< = <TSC3TB;< = <T3s"4H:; < ; 	sC3f4H:	;<	; 	s"4H6	78	7 	s&tL:	;<	;r   c                 s    \        RR.RR7      RR l4       p R^^.R^^	.RR	/pV ! RRRVR
7      R8X  g   Q hV ! RRRVR7      R8X  g   Q hV ! RRRRVR7      R8X  g   Q hV ! RRRRVR7      R8X  g   Q hR# )z<Test with "label_namer=None" -> no label replacement at all.r   r   Nr   c           
      r
   r   r   r   r   r   func_no_labelZ1test_no_label_replacements.<locals>.func_no_label   r=   r   r'   r(   r   r/   r0   z0x: [1, 2], y: [8, 9], ls: x, w: xyz, label: Noner2   r$   r3   r4   r%   r5   r   Nr;   r    )r@   r,   r>   r   test_no_label_replacementsrB      s     S#JDAO BO !Qq!fc51D$St4>? @ ?$#48>? @ ?$S>:; < ;$STB>? @ ?r   c                  s    \        R R.RR7      RR l4       p R^^.R^^	.RR/p\        P                  ! \        4      ;_uu_ 4        V ! RRRR	R	VR
7       RRR4       R#   + '       g   i     R# ; i)r   r   r   c                 r   r   r   )r   r   r   r   s   &&&&r   r   Z/test_more_args_than_pos_parameter.<locals>.func   s    r   r'   r(   r   r/   Nr   r0   )   )r   r!   r"   Z	TypeErrorr+   r>   r   !test_more_args_than_pos_parameterrD      sl    S#JC@ A !Qq!fc51D	y	!	!T3S#D1 
"	!	!	!s   AA0	c                  s4   \        4       R  4       p \        P                  ! RV P                  4      '       g   Q h\        P                  ! RV P                  4      '       d   Q h\        . R7      RR l4       p \        P                  ! RV P                  4      '       d   Q h\        P                  ! RV P                  4      '       d   Q h\        R.R7      RR l4       p \        P                  ! RV P                  4      '       d   Q h\        P                  ! RV P                  4      '       d   Q h\        R	R
.R7      RR l4       p \        P                  ! RV P                  4      '       d   Q h\        P                  ! RV P                  4      '       d   Q hR# )c                    R# zX
Parameters
----------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
Nr   )r   r   r   s   &*,r   funcy&test_docstring_addition.<locals>.funcy       r   z#all parameters also accept a stringzthe following parametersr   Nc                rE   rF   r   r   r   r   r   bar   &&&&&r   rG   rH      rI   r   rK   c                rE   rF   r   rJ   rL   r   rG   rH      rI   r   z&the following parameters .*: \*bar\*\.r   tc                rE   rF   r   )r   r   r   r   rM   rL   r   rG   rH      rI   r   z+the following parameters .*: \*x\*, \*t\*\.r   )r   reZsearchZ__doc__)rG   s    r   test_docstring_additionrO      sc     99;U]]KKKKyy4emmDDDDB' ( yy?OOOOyy4emmDDDDUG, - yy?OOOOyyB( ( ( ( S#J/ 0 yy?OOOOyyG( ( ( ( (r   c                 sr    Rp \         P                  RV .p\        VRRR7      pRVP                  9  g   Q hR# )zw
Test that the docstring contains the correct *data* parameter stub
for all methods that we run _preprocess_data() on.
zYimport logging; logging.basicConfig(level=logging.DEBUG); import matplotlib.pyplot as pltz-cT)r%   Zcapture_outputzdata parameter docstring errorN)sysZ
executabler   Zstderr)ZprogramZcmdZcompleted_procs      r   test_data_parameter_replacementrQ      sE    	* 
 >>4
)C/$tN ,>3H3HHHHr   c                   s"  a  ] tR tRt o ]P
                  ]P                  ]P                  .t]	P                  P                  R]4      ]! R.R7      R 4       4       t]	P                  P                  R]4      ]! R.R7      R 4       4       tRtV tR# )	TestPlotTypesi	  plotterZpng)Z
extensionsc                s    . ROp. ROp\        \        WE4      4      pV! VP                  4       VP                  4       VP	                  4       4       V! VP                  4       WE4       R# )rC   NrC   i   i   i   i   i   )ZdictZzipsubplotsr)   r*   )selfrS   fig_testfig_refr   r   Zddicts   &&&&   r   test_dict_unpackZTestPlotTypes.test_dict_unpack  sR     SY!!#

elln	.  "A)r   c           	     s    . ROp. ROpV! VP                  4       RRRVRV/R7       V! VP                  4       WE4       R# )rC   ZxvalZyvalr0   NrT   rU   )rV   )rW   rS   rX   rY   r   r   s   &&&&  r   test_data_kwargZTestPlotTypes.test_data_kwarg  sD     !!#VVa+	-  "A)r   r   N)Z__name__Z
__module__Z__qualname__Z__firstlineno__r   ZscatterrK   ZplotZplottersr!   markparametrizer   rZ   r[   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   rR   rR   	  s     dhh		2H[[Y1UG,* - 2* [[Y1UG,* - 2*r   rR   rA   )rN   rP   Znumpyr9   r!   Z
matplotlibr   Zmatplotlib.axesr   Zmatplotlib.testingr   Zmatplotlib.testing.decoratorsr   r   Z	all_funcsZall_func_idsr#   r\   r]   r&   r.   r7   r8   r:   r?   rB   rD   rO   rQ   rR   r   r   r   <module>r^      sR   	 
   '   9 = c
<K =K K	}5B => >>  =D >D =@ >@" =? >?" =@ >@(<2@$21(hI"* *r   