Ë
    'YHhÒ  ã                   óx   — d dl Zd dlmZmZ d dlmZ d dlZd dlm	Z	m
Z
 	 d dlmZ  G d„ d«      Zy# e$ r Y Œw xY w)é    N)Úassert_equalÚassert_raises)ÚSeries)Ú_recodeÚinteraction_plotc                   ó´  — e Zd Zed„ «       Zej                  j                  d„ «       Zej                  j                  d„ «       Z	ej                  j                  ej                  j                  dddg«      d„ «       «       Zej                  j                  d„ «       Zej                  j                  d	„ «       Zej                  j                  d
„ «       Zd„ Zy)ÚTestInteractionPlotc                 óR  — t         j                  j                  d«       t         j                  j                  ddd¬«      | _        t         j                  j                  ddd¬«      | _        t        j                  t         j                  j                  ddd¬«      «      | _        y )Ni90  é   é   é<   )Úsizeé   é   )ÚnpÚrandomÚseedÚrandintÚweightÚdurationÚlogÚdays)Úclss    úd/var/www/html/planif/env/lib/python3.12/site-packages/statsmodels/graphics/tests/test_factorplots.pyÚsetup_classzTestInteractionPlot.setup_class   sr   € ä
	‰	‰uÔÜ—Y‘Y×&Ñ& q¨°Ð&Ó3ˆŒ
Ü—y‘y×(Ñ(¨¨1°"Ð(Ó5ˆŒÜ—6‘6œ"Ÿ)™)×+Ñ+¨A¨b°rÐ+Ó:Ó;ˆó    c                 ój   — t        | j                  | j                  | j                  ddgddgd¬«      }y )NÚredÚblueÚDú^é
   )ÚcolorsÚmarkersÚms©r   r   r   r   ©ÚselfÚclose_figuresÚfigs      r   Útest_plot_bothz"TestInteractionPlot.test_plot_both   s.   € ä˜tŸ{™{¨D¯M©M¸4¿9¹9Ø˜v˜°°S°	¸bôB‰r   c                 ód   — t        | j                  | j                  | j                  ddgd¬«      }y )Nr    r!   r"   ©r$   r%   r&   r'   s      r   Útest_plot_rainbowz%TestInteractionPlot.test_plot_rainbow   s'   € ä˜tŸ{™{¨D¯M©M¸4¿9¹9Ø˜c˜ rô+‰r   ÚastypeÚstrÚintc                 óÆ  — t        | j                  d¬«      j                  |«      }t        | j                  d¬«      }t        | j                  d¬«      }t        |||ddgd¬«      }|j                  d	   }|j                  «       j                  «       j                  «       }t        |d«       t        |j                  «       d
«       t        |j                  «       d«       y )NÚWeight)ÚnameÚDurationÚDaysr    r!   r"   r-   r   zmean of Days)r   r   r/   r   r   r   ÚaxesÚ
get_legendÚ	get_titleÚget_textr   Ú
get_ylabelÚ
get_xlabel)	r(   r/   r)   r   r   r   r*   ÚaxÚtraces	            r   Útest_plot_pandasz$TestInteractionPlot.test_plot_pandas!   s¬   € ô ˜Ÿ™¨(Ô3×:Ñ:¸6ÓBˆÜ˜$Ÿ-™-¨jÔ9ˆÜd—i‘i fÔ-ˆÜ˜v x°Ø(+¨S z°bô:ˆàX‰Xa‰[ˆØ—‘“×)Ñ)Ó+×4Ñ4Ó6ˆÜU˜JÔ'ÜR—]‘]“_ nÔ5ÜR—]‘]“_ hÕ/r   c                 ó°   — t        | j                  | j                  | j                  ddgddg¬«      }t	        t        |t        j                  «      d«       y )NÚrÚgú--ú-.)r#   Ú
linestylesT)r   r   r   r   r   Ú
isinstanceÚpltÚFigurer'   s      r   Útest_formattingz#TestInteractionPlot.test_formatting/   sA   € ä˜tŸ{™{¨D¯M©M¸4¿9¹9ÈcÐRUÈYÐdhÐimÐcnÔoˆÜ”Z ¤S§Z¡ZÓ0°$Õ7r   c           	      óX  — t        t        t        | j                  | j                  | j
                  dg¬«       t        t        t        | j                  | j                  | j
                  g d¢¬«       t        t        t        | j                  | j                  | j
                  g d¢¬«       y )Nr    )r$   )ÚbrA   rB   )r#   )rC   rD   ú:)rE   )r   Ú
ValueErrorr   r   r   r   )r(   r)   s     r   Útest_formatting_errorsz*TestInteractionPlot.test_formatting_errors4   sn   € ä”jÔ"2°D·K±KÀÇÁÐPT×PYÑPYÐdgÐchÕiÜ”jÔ"2°D·K±KÀÇÁÐPT×PYÑPYÒboÕpÜ”jÔ"2°D·K±KÀÇÁÐPT×PYÑPYÒfuÖvr   c                 ó¶  — t        | j                  | j                  | j                  d¬«      }t	        t        |t        j                  «      d«       t        | j                  | j                  | j                  d¬«      }t	        t        |t        j                  «      d«       t        t        t         | j                  | j                  | j                  d¬«       y )NÚline)ÚplottypeTÚscatterÚunknown)
r   r   r   r   r   rF   rG   rH   r   rM   r'   s      r   Útest_plottypez!TestInteractionPlot.test_plottype:   s‡   € ä˜tŸ{™{¨D¯M©M¸4¿9¹9ÈvÔVˆÜ”Z ¤S§Z¡ZÓ0°$Ô7Ü˜tŸ{™{¨D¯M©M¸4¿9¹9ÈyÔYˆÜ”Z ¤S§Z¡ZÓ0°$Ô7Ü”jÔ"2°D·K±KÀÇÁÐPT×PYÑPYÐdmÖnr   c                 óÞ   — t        ddgdz  t        j                  ddd«      d¬«      }t        |dd	d
œ«      }t	        |j
                  j                  |j
                  j                  d¬«       y )NÚarK   r"   r   é(   é   Ú
index_test)Úindexr4   r   )rV   rK   z_recode changed the index)Úerr_msg)r   r   Úaranger   r   rZ   Úvalues)r(   ÚseriesÚseries_s      r   Útest_recode_seriesz&TestInteractionPlot.test_recode_seriesB   s\   € Ü˜˜c˜
 R™¬r¯y©y¸¸BÀÓ/BØ)ô+ˆä˜&¨°Ñ"2Ó3ˆÜW—]‘]×)Ñ)¨6¯<©<×+>Ñ+>Ø8ö	:r   N)Ú__name__Ú
__module__Ú__qualname__Úclassmethodr   ÚpytestÚmarkÚ
matplotlibr+   r.   Úparametrizer?   rI   rN   rT   r`   © r   r   r	   r	      sð   „ àñ<ó ð<ð ‡[[×ÑñBó ðBð ‡[[×Ññ+ó ð+ð ‡[[×ÑØ‡[[×Ñ˜X¨¨u ~Ó6ñ
0ó 7ó ð
0ð ‡[[×Ññ8ó ð8ð ‡[[×Ññwó ðwð
 ‡[[×Ññoó ðoó:r   r	   )Únumpyr   Únumpy.testingr   r   Úpandasr   re   Ú statsmodels.graphics.factorplotsr   r   Úmatplotlib.pyplotÚpyplotrG   ÚImportErrorr	   ri   r   r   ú<module>rq      s:   ðÛ ß 5Ý Û ç Fð	Ý#÷
9:ò 9:øð	 ò 	Ùð	ús    1 ±9¸9