o
    .1f	                     @   s\   d dl Zd dlZd dlmZmZ d dlmZ g dZ	dd Z
dd Zdd
dZdddZdS )    N)to_rgbto_rgba)assert_array_equal)ZalphaZ	edgecolorZ	facecolorfillZhatchZheightZ	linestyleZ	linewidthpathsZxyZxydataZsizesZzorderc                 C   s   t | t |ks
J t| |D ]l\}}|j|jksJ | }| }tD ]U}||vr,q%|| }|| }|dkrQt||D ]\}	}
t|	j|
j t|	j|
j q=q%|dkrhtj	
|}tj	
|}||ksgJ q%t|tjrtt|| q%||kszJ q%qd S )Nr   Zcolor)lenzip	__class__Z
properties	USE_PROPSr   ZverticesZcodesmplZcolorsr   
isinstancenpndarray)Zlist1Zlist2Za1Za2Zprop1Zprop2keyZv1Zv2Zp1Zp2 r   0lib/python3.10/site-packages/seaborn/_testing.pyassert_artists_equal   s0   r   c                 C   st   |    |   ksJ t|  | D ]\}}| | ks%J qt|  |  t|  |  d S N)Z	get_titleZget_textr   Z	get_textsr   Zget_patches	get_lines)Zleg1Zleg2t1t2r   r   r   assert_legends_equal2   s   r   Tc                 C   s^   t | j|j t | j|j t | j|j |r+|  | ks!J |  | ks-J d S d S r   )r   ZpatcheslinescollectionsZ
get_xlabelZ
get_ylabel)Zax1Zax2labelsr   r   r   assert_plots_equal@   s   r   c                 C   s<   dd }|| } ||}|rt nt}|| ||ksJ d S )Nc                 S   s>   t | tjr| jdkrtj| dd } | jdkrtd| S )N   r   )Zaxisz"Color arrays must be 1 dimensional)r   r   r   ndimuniqueZsqueeze
ValueError)xr   r   r   handle_arrayM   s   

z)assert_colors_equal.<locals>.handle_array)r   r   )abZcheck_alphar!   fr   r   r   assert_colors_equalK   s
   	r%   )T)Znumpyr   Z
matplotlibr   Zmatplotlib.colorsr   r   Znumpy.testingr   r
   r   r   r   r%   r   r   r   r   <module>   s    
