
    lj                    >    d dl mZ d dlZd dlZd dlZd dlmZ ddZdS )    )annotationsN)
PixelArrayframe_numberint
frame_datar   expected_frame_datacontrol_data_filenamestrreturnNonec                   ddl m} ddlm} |                    dd          }|                                }|                    d|  d           |                    |d                   }|                    |           |	                    d           |                    |d	                   }|                    |           |	                    d
           |                    |dddf                   }|
                                }	t          j        |t          j        g d          k    t          j        g dd          t          j        g dd                    }	t          j        |	||k    t          j        g dd                     |                    |	d           |	                    d           t          j                    5  t          j        d           	 |                                 nJ# t&          $ r= |dd          d}
|                    |
           t+          j        d|
 d           Y nw xY wddd           dS # 1 swxY w Y   dS )z_Will visually display with matplotlib differences between frame generated and the one expected.r   N   z!Test difference summary at frame    )fontsize)r   r   	Generated)r      Expectedr   )r   r   r      )r   r   r   r   uint8)dtype)r   r   r   r   nearest)interpolationz3Difference summary: (green = same, red = different)errorz	-diff.pdfz>Interactive matplotlib interface not available, diff saved to .)matplotlib.gridspecgridspecmatplotlib.pyplotpyplotGridSpecfiguresuptitleadd_subplotimshow	set_titlecopynpwherearrayputmaskwarningscatch_warningssimplefiltershowUserWarningsavefigloggingwarning)r   r   r   r	   r   pltgsfigaxdiff_imfilenames              Y/home/agentuser/manim-venv/lib/python3.11/site-packages/manim/utils/testing/_show_diff.pyshow_diff_helperr:      s    +*****######			1a	 	 B
**,,CLLC\CCbLQQQ	D	"	"BIIjLL	D	"	"BII!"""LL	AqqqD	"	"B!&&((Ghbh~~~...
!!!111
w/// G
 Jz)
!!!111  
 IIgYI///LLFGGG		 	"	" 
 
g&&&	HHJJJJ 	 	 	/4???HKK!!!O."*. . .    		
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
s7   I-HIAI	II		II I)
r   r   r   r   r   r   r	   r
   r   r   )	
__future__r   r1   r+   numpyr'   manim.typingr   r:        r9   <module>r@      se    " " " " " "       # # # # # #/ / / / / /r?   