Ë
    u™ãj*  ã                  óà   — d Z ddlmZ ddlmZmZ erddlmZm	Z
mZ ddlmZ ddlZddlZddlZddlmZ ddlmZmZmZmZ ddlmZ dd	lmZ 	 	 	 	 	 	 	 	 dd
„Z 	 	 	 	 	 	 	 	 dd„Z! G d„ d«      Z"y)z#
Tests for plotting compatibility.
é    )Úannotations)ÚTYPE_CHECKINGÚLiteral)ÚaxesÚaxisÚlines)ÚExtensionArrayN)ÚPeriodDtypeÚis_any_real_numeric_dtypeÚis_bool_dtypeÚis_datetime64_any_dtype)Úmpl_cleanup_context)Ú_check_plot_worksc                ó$  — ddl m} ddlm} |j	                  |«      sRt        |j                  «      s=t        |j                  t        j                  «      rI|j                  j                  dk(  r0|j                  t        j                  t        j                  ¬«      }n©|j                  «       }|j                  j                  } |«       5  |j                   |   }ddd«       t#        | |› d�«      }	j%                  ||	«      }
t        j&                  |j)                  ||
|	«      «      j+                  t        j                  «      }| j,                  d   } t#        |d|› d	�«      d
¬«      }t/        j0                  ||«       y# 1 sw Y   ŒªxY w)a?  Check that the data plotted matches the expected converted data from the Series.

    Parameters
    ----------
    ax : maxes.Axes
        The Axes object containing the plot.
    ser : pd.Series
        The Series containing the expected data.
    axis : Literal["x", "y"]
        The axis to check ("x" or "y").
    r   )Úunits)Úpandas_convertersÚm)Úna_valueNr   Úget_ÚdataF)Úorig)Ú
matplotlibr   Ú%pandas.plotting._matplotlib.converterr   Ú_is_natively_supportedr   ÚdtypeÚ
isinstanceÚpdÚ
ArrowDtypeÚkindÚto_numpyÚnpÚfloat64ÚnanÚtypeÚregistryÚgetattrÚdefault_unitsÚarrayÚconvertÚastyper   ÚtmÚassert_almost_equal)ÚaxÚserr   Úmunitsr   Úconverted_dataÚarrÚtype_Ú	converterÚaxis_ÚunitÚlineÚ	line_datas                úo/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/pandas/tests/extension/base/plotting.pyÚ_check_plot_datar9   #   s6  € õ  +åGð 	×%Ñ% cÔ*Ü˜Ÿ™Ô#Ü�s—y‘y¤"§-¡-Ô0°S·Y±Y·^±^ÀsÒ5Jð Ÿ™¤b§j¡j¼2¿6¹6˜ÓB‰ð �l‰l‹nˆØ—	‘	—‘ˆÙÓ ñ 	/ØŸ™¨Ñ.ˆI÷	/ä# B¨4¨&°¨Ó6ˆØ×&Ñ& s¨EÓ2ˆÜŸ™ )×"3Ñ"3°C¸¸uÓ"EÓF×MÑMÜ�J‰Jó
ˆð
 Ÿ(™( 1™+€DØ0”˜  T F¨$Ð/Ó0°eÔ<€Iô ×Ñ˜9 nÕ5÷	/ð 	/ús   ÃFÆFc                óB  — t        | d   j                  «      r	d|vrd|d<   t        | j                  f||dœ|¤Ž}| |   j                  }t	        ddg||gd¬«      D ]A  \  }}|dk(  r't        |«      st        |t        «      st        |«      sŒ2t        || |   |«       ŒC y)	aô  Helper function to plot a DataFrame with the given x and y columns.

    Parameters
    ----------
    data : DataFrame
        A DataFrame with an ExtensionArray in a "Data" column.
    x : str
        The name of the column to use for the x-axis.
    y : str
        The name of the column to use for the y-axis.
    kind : str, optional
        The kind of plot to create. If None, the default plot type is used.
    **kwargs
        Additional keyword arguments to pass to the plot function.
    ÚDataÚinclude_boolT©ÚxÚyr>   r?   )ÚstrictN)
r   r   r   ÚplotÚzipr   r   r
   r   r9   )Ú	plot_datar>   r?   Úkwargsr-   Úx_dtyper   Úcols           r8   Ú_plotrG   R   s¯   € ô, �Y˜vÑ&×,Ñ,Ô-°.ÈÑ2NØ!%ˆˆ~Ñô 
˜9Ÿ>™>Ð	>¨Q°!Ñ	>°vÑ	>€Bð ˜‰l× Ñ €GÜ˜#˜s˜ a¨ V°DÔ9ò 
3‰	ˆˆcð �3Š;Ü% gÔ.Ü˜'¤;Ô/Ü& wÔ/àÜ˜˜Y s™^¨TÕ2ñ
3ó    c                  óV   — e Zd Z ej                  ddgddg¬«      d
d„«       Zd„ Zd„ Zy	)ÚBasePlottingTestsTFÚskipnaÚ	no_skipna)ÚparamsÚidsc                ó¦   — t        j                  |t        j                  t	        |«      «      dœ«      }|j
                  r|j                  «       }|S )N)r;   ÚNumeric)r   Ú	DataFramer!   ÚarangeÚlenÚparamÚdropna)Úselfr   ÚrequestÚdfs       r8   rC   zBasePlottingTests.plot_data‚   s9   € ä�\‰\ 4´B·I±I¼cÀ$»iÓ4HÑIÓJˆØ�=Š=Ø—‘“ˆBØˆ	rH   c                ó^   — t        «       5  t        |dd¬«       ddd«       y# 1 sw Y   yxY w)z/Test that EA data can be plotted on the x-axis.r;   rP   r=   N©r   rG   )rV   rC   s     r8   Útest_plot_on_x_axisz%BasePlottingTests.test_plot_on_x_axis‰   s)   € ä Ó"ñ 	4Ü�)˜v¨Õ3÷	4÷ 	4ñ 	4ús   ‹#£,c                ó`   — t        «       5  t        |fdddœ|¤Ž ddd«       y# 1 sw Y   yxY w)z/Test that EA data can be plotted on the y-axis.rP   r;   r=   NrZ   )rV   rC   rD   s      r8   Útest_plot_on_y_axisz%BasePlottingTests.test_plot_on_y_axisŽ   s1   € ä Ó"ñ 	>Ü�)Ð=˜y¨FÑ=°fÒ=÷	>÷ 	>ñ 	>ús   ‹$¤-N)r   r	   Úreturnúpd.DataFrame)Ú__name__Ú
__module__Ú__qualname__ÚpytestÚfixturerC   r[   r]   © rH   r8   rJ   rJ      s7   „ ð €V‡^�^˜D %˜=¨x¸Ð.EÔFòó Gðò4ó
>rH   rJ   )r-   z
maxes.Axesr.   z	pd.Seriesr   zLiteral['x', 'y']r^   ÚNone)rC   r_   r>   Ústrr?   rg   r^   rf   )#Ú__doc__Ú
__future__r   Útypingr   r   r   r   Úmaxesr   Úmaxisr   ÚmlinesÚpandas.core.arraysr	   Únumpyr!   rc   Úpandasr   Úpandas._testingÚ_testingr+   Úpandas.api.typesr
   r   r   r   Úpandas.conftestr   Úpandas.tests.plotting.commonr   r9   rG   rJ   re   rH   r8   ú<module>rv      s¤   ðñõ #÷ñ
 ÷ñ õ
 2ã Û ã Ý ÷ó õ 0Ý :ð,6Øð,6à	ð,6ð ð,6ð 
ó	,6ð^*3Øð*3à
ð*3ð ð*3ð
 
ó*3÷Z>ò >rH   