Ë
    ômxi®  ã                   ó˜   — d dl Zd dlZd dlmZmZmZmZmZm	Z	 d dl
mZ d dlmZ  ej                  d«      Z G d„ d«      Z G d„ d«      Zy)	é    N)ÚCategoricalÚ	DataFrameÚ
MultiIndexÚSeriesÚStringDtypeÚ
date_range)ÚVersionÚxarrayc                   óB   — e Zd Zej                  d„ «       Zd„ Zd„ Zd„ Zy)ÚTestDataFrameToXArrayc                 ó*  — t        t        d«      t        t        dd«      «      t        j                  dd«      j                  d«      t        j                  ddd	¬
«      g d¢t        t        d«      «      t        dd¬«      t        ddd¬«      dœ«      S )NÚabcdé   é   é   é   Úu1g      @g       @Úfloat64©Údtype)TFTFÚ20130101é   )Úperiodsz
US/Eastern)r   Útz)ÚaÚbÚcÚdÚeÚfÚgÚh)r   ÚlistÚrangeÚnpÚarangeÚastyper   r   )Úselfs    úZ/home/htdocs/ttos/venv/lib/python3.12/site-packages/pandas/tests/generic/test_to_xarray.pyÚdfzTestDataFrameToXArray.df   sv   € ää˜&“\Üœ%  1›+Ó&Ü—Y‘Y˜q !“_×+Ñ+¨DÓ1Ü—Y‘Y˜s C¨yÔ9Ú/Ü ¤ f£Ó.Ü 
°AÔ6Ü 
°A¸,ÔGñ	ó
ð 	
ó    c                 ó¶  — |}t        |«      dk(  rt        j                  d«       ddlm} |d d |_        d|j
                  _        d|j                  _        |j                  «       }|j                  d   dk(  sJ ‚t        |j                  «      dk(  sJ ‚t        |j                  «      dk(  sJ ‚t        j                  t        |j                  j                  «       «      dg«       t!        ||«      sJ ‚|j#                  «       }|d	   j%                  |st&        nd
«      |d	<   d |j                  _        t        j(                  |j+                  «       |«       y )Nr   z'Test doesn't make sense for empty index©ÚDatasetr   ÚfooÚbarr   é   r    Ústr)ÚlenÚpytestÚskipr
   r.   ÚindexÚnameÚcolumnsÚ	to_xarrayÚsizesÚcoordsÚ	data_varsÚtmÚassert_almost_equalr#   ÚkeysÚ
isinstanceÚcopyr'   ÚobjectÚassert_frame_equalÚto_dataframe)r(   Ú
index_flatr*   Úusing_infer_stringr6   r.   ÚresultÚexpecteds           r)   Útest_to_xarray_index_typesz0TestDataFrameToXArray.test_to_xarray_index_types"   s   € Øˆäˆu‹:˜Š?Ü�K‰KÐAÔBå"à˜˜!�9ˆŒØˆ�‰ŒØˆ�
‰
ŒØ—‘“ˆØ�|‰|˜EÑ" aÒ'Ð'Ð'Ü�6—=‘=Ó! QÒ&Ð&Ð&Ü�6×#Ñ#Ó$¨Ò)Ð)Ð)Ü
×Ñœt F§M¡M×$6Ñ$6Ó$8Ó9¸E¸7ÔCÜ˜& 'Ô*Ð*Ð*ð
 —7‘7“9ˆØ  ™×,Ñ,Ù,�F°%ó
ˆ�‰ð !%ˆ×ÑÔÜ
×Ñ˜f×1Ñ1Ó3°XÕ>r+   c                 óœ   — ddl m} d|j                  _        |dd j	                  «       }|j
                  d   dk(  sJ ‚t        ||«      sJ ‚y )Nr   r-   r/   )r
   r.   r6   r7   r9   r:   r@   )r(   r*   r.   rG   s       r)   Útest_to_xarray_emptyz*TestDataFrameToXArray.test_to_xarray_empty>   sK   € Ý"àˆ�‰ŒØ�A�a�×"Ñ"Ó$ˆØ�|‰|˜EÑ" aÒ'Ð'Ð'Ü˜& 'Ô*Ð*Ñ*r+   c                 ó–  — ddl m} t        j                  dgt	        d«      gddg¬«      |_        |j                  «       }|j                  d   dk(  sJ ‚|j                  d   dk(  sJ ‚t        |j                  «      d	k(  sJ ‚t        |j                  «      d
k(  sJ ‚t        j                  t        |j                  j                  «       «      ddg«       t        ||«      sJ ‚|j!                  «       }|j#                  «       }|d   j%                  |st&        nd«      |d<   d |j(                  _        t        j,                  ||«       y )Nr   r-   r   r   ÚoneÚtwo©Únamesr   é   r1   r    r2   )r
   r.   r   Úfrom_productr$   r6   r9   r:   r3   r;   r<   r=   r>   r#   r?   r@   rD   rA   r'   rB   r8   r7   rC   )r(   r*   rF   r.   rG   rH   s         r)   Útest_to_xarray_with_multiindexz4TestDataFrameToXArray.test_to_xarray_with_multiindexF   s!  € Ý"ô ×*Ñ*¨S¨E´5¸³8Ð+<ÀUÈEÀNÔSˆŒØ—‘“ˆØ�|‰|˜EÑ" aÒ'Ð'Ð'Ø�|‰|˜EÑ" aÒ'Ð'Ð'Ü�6—=‘=Ó! QÒ&Ð&Ð&Ü�6×#Ñ#Ó$¨Ò)Ð)Ð)Ü
×Ñœt F§M¡M×$6Ñ$6Ó$8Ó9¸EÀ5¸>ÔJÜ˜& 'Ô*Ð*Ð*à×$Ñ$Ó&ˆØ—7‘7“9ˆØ  ™×,Ñ,Ù,�F°%ó
ˆ�‰ð !%ˆ×ÑÔÜ
×Ñ˜f hÕ/r+   N)	Ú__name__Ú
__module__Ú__qualname__r4   Úfixturer*   rI   rK   rS   © r+   r)   r   r      s'   „ Ø‡^�^ñ
ó ð
ò?ò8+ó0r+   r   c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)ÚTestSeriesToXArrayc                 óH  — |}t        |j                  t        «      r—|j                  j                  dk(  r~t	        t
        j                  «      t	        d«      kD  rYt	        t
        j                  «      t	        d«      k  r4|j                  t        j                  j                  dt        ¬«      «       ddlm} t        t        t        |«      «      |d¬	«      }d
|j                   _        |j%                  «       }t'        |«       t        |«      t        |«      k(  sJ ‚t        |j(                  «      dk(  sJ ‚t+        j,                  t/        |j(                  j1                  «       «      d
g«       t        ||«      sJ ‚t+        j2                  |j5                  «       |«       y )NÚpyarrowz2024.9.0z2025.6.0z-xarray calling reshape of ArrowExtensionArray)ÚreasonÚraisesr   ©Ú	DataArrayÚint64)r6   r   r/   r   )r@   r   r   Ústorager	   r
   Ú__version__Úapplymarkerr4   ÚmarkÚxfailÚNotImplementedErrorr`   r   r$   r3   r6   r7   r9   Úreprr;   r=   r>   r#   r?   Úassert_series_equalÚ	to_series)r(   rE   Úrequestr6   r`   ÚserrG   s          r)   rI   z-TestSeriesToXArray.test_to_xarray_index_types]   s7  € Øˆä�u—{‘{¤KÔ0Ø—‘×#Ñ# yÒ0Üœ×*Ñ*Ó+¬g°jÓ.AÒAÜœ×*Ñ*Ó+¬g°jÓ.AÒAà×ÑÜ—‘×!Ñ!ØJÜ.ð "ó ôõ 	%ä”Uœ3˜u›:Ó&¨e¸7ÔCˆØˆ�	‰	ŒØ—‘“ˆÜˆVŒÜ�6‹{œc %›jÒ(Ð(Ð(Ü�6—=‘=Ó! QÒ&Ð&Ð&Ü
×Ñœt F§M¡M×$6Ñ$6Ó$8Ó9¸E¸7ÔCÜ˜& )Ô,Ð,Ð,ô 	×Ñ˜v×/Ñ/Ó1°3Õ7r+   c                 óT  — ddl m} t        g t        ¬«      }d|j                  _        |j                  «       }t        |«      dk(  sJ ‚t        |j                  «      dk(  sJ ‚t        j                  t        |j                  j                  «       «      dg«       t        ||«      sJ ‚y )Nr   r_   r   r/   r   )r
   r`   r   rB   r6   r7   r9   r3   r;   r=   r>   r#   r?   r@   )r(   r`   rl   rG   s       r)   rK   z'TestSeriesToXArray.test_to_xarray_empty{   s„   € Ý$ä�RœvÔ&ˆØˆ�	‰	ŒØ—‘“ˆÜ�6‹{˜aÒÐÐÜ�6—=‘=Ó! QÒ&Ð&Ð&Ü
×Ñœt F§M¡M×$6Ñ$6Ó$8Ó9¸E¸7ÔCÜ˜& )Ô,Ð,Ñ,r+   c                 ó¤  — ddl m} t        j                  ddgt	        d«      gddg¬«      }t        t	        d	«      d
|¬«      }|j                  «       }t        |«      dk(  sJ ‚t        j                  t        |j                  j                  «       «      ddg«       t        ||«      sJ ‚|j                  «       }t        j                  ||«       y )Nr   r_   r   r   r   rM   rN   rO   é   ra   )r   r6   rQ   )r
   r`   r   rR   r$   r   r9   r3   r=   r>   r#   r;   r?   r@   rj   ri   )r(   r`   Úmirl   rG   Úress         r)   rS   z1TestSeriesToXArray.test_to_xarray_with_multiindex†   s«   € Ý$ä×$Ñ$ s¨C j´%¸³(Ð%;ÀEÈ5À>ÔRˆÜ”U˜1“X W°BÔ7ˆØ—‘“ˆÜ�6‹{˜aÒÐÐÜ
×Ñœt F§M¡M×$6Ñ$6Ó$8Ó9¸EÀ5¸>ÔJÜ˜& )Ô,Ð,Ð,Ø×ÑÓ ˆÜ
×Ñ˜s CÕ(r+   N)rT   rU   rV   rI   rK   rS   rX   r+   r)   rZ   rZ   \   s   „ ò8ò<	-ó
)r+   rZ   )Únumpyr%   r4   Úpandasr   r   r   r   r   r   Úpandas._testingÚ_testingr=   Úpandas.util.versionr	   Úimportorskipr
   r   rZ   rX   r+   r)   ú<module>rx      sF   ðÛ Û ÷÷ õ Ý 'à	ˆ×	Ñ	˜XÓ	&€÷G0ñ G0÷T4)ò 4)r+   