§
    ‚Ø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lmZ d dl	m
Z
 d dlmZ d dlmZ ej                             dg d	¢¦  «        d
„ ¦   «         Zd„ ZdS )é    )ÚPathN)Úapprox)Ú_image)Úcompare_images)Ú_image_directories)ÚImageComparisonFailurezim1, im2, tol, expect_rms))úbasn3p02.pngúbasn3p02-minorchange.pngé
   N)r	   r
   r   g»íBs�@)r	   zbasn3p02-1px-offset.pngr   g%Ì´ý‰V@)r	   zbasn3p02-half-1px-offset.pngr   g     àO@)r	   zbasn3p02-scrambled.pngr   g‘D/£X”e@)ú
all127.pngú
all128.pngr   é   )r   r   r   r   c                 ó4  — |                      |¦  «         t          t          t          d„ ¦  «        ¦  «        \  }}|| z  }t	          j        ||z  |¦  «         t          || z  ||d¬¦  «        }	|€|	�J ‚dS |	€J ‚|	d         t          |d¬¦  «        k    sJ ‚dS )a   
    Compare two images, expecting a particular RMS error.

    im1 and im2 are filenames relative to the baseline_dir directory.

    tol is the tolerance to pass to compare_images.

    expect_rms is the expected RMS value, or None. If None, the test will
    succeed if compare_images succeeds. Otherwise, the test will succeed if
    compare_images fails and returns an RMS error almost equal to this value.
    c                  ó   — dS )NÚdummy© r   ó    ú™/Users/tedpeters/Documents/Projects/Claude Projects/Misc Tools/notename-sheets/.venv/lib/python3.11/site-packages/matplotlib/tests/test_compare_images.pyú<lambda>z2test_image_comparison_expect_rms.<locals>.<lambda>@   s   € ÀG€ r   T)ÚtolÚin_decoratorNÚrmsg-Cëâ6?)Úabs)ÚchdirÚmapr   r   ÚshutilÚcopyfiler   r   )
Úim1Úim2r   Ú
expect_rmsÚtmp_pathÚmonkeypatchÚbaseline_dirÚ
result_dirÚ
result_im2Úresultss
             r   Ú test_image_comparison_expect_rmsr'      sÉ   € ð` ×Ò�hÑÔÐÝ"¥4Õ);¸O¸OÑ)LÔ)LÑMÔMÑ€L�*ð ˜cÑ!€JÝ
„O�L 3Ñ&¨
Ñ3Ô3Ð3ÝØ�sÑ˜J¨C¸dðDñ Dô D€Gð ÐØˆˆˆˆˆàÐ"Ð"Ð"Ø�uŒ~¥¨
¸Ð!=Ñ!=Ô!=Ò=Ð=Ð=Ð=Ð=Ð=r   c            
      ó„  — t          j        dt           j        ¬¦  «        } t          j        t
          d¬¦  «        5  t          j        | d d …d d …df         | ¦  «         d d d ¦  «         n# 1 swxY w Y   t          j        t
          d¬¦  «        5  t          j        | | d d …d d …d d …t           j        t           j        f         ¦  «         d d d ¦  «         n# 1 swxY w Y   t          j        t
          d¬¦  «        5  t          j        | d d …d d …d d…f         | ¦  «         d d d ¦  «         n# 1 swxY w Y   t          j        t
          d	¬¦  «        5  t          j        | | d d
…d d …d d …f         ¦  «         d d d ¦  «         n# 1 swxY w Y   t          j        t
          d¬¦  «        5  t          j        | | d d …d d…d d …f         ¦  «         d d d ¦  «         n# 1 swxY w Y   t          j        t
          d¬¦  «        5  t          j        | | d d …d d …d d…f         ¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )N)é   r)   é   )Údtypez+must be 3-dimensional, but is 2-dimensional)Úmatchr   z+must be 3-dimensional, but is 5-dimensionalz#must be RGB or RGBA but has depth 2é   z5expected size: \(16, 16, 4\) actual size \(8, 16, 4\)é   z5expected size: \(16, 16, 4\) actual size \(16, 6, 4\)é   z6expected size: \(16, 16, 4\) actual size \(16, 16, 3\)é   )	ÚnpÚzerosÚuint8ÚpytestÚraisesr   r   Úcalculate_rms_and_diffÚnewaxis)Úimgs    r   Útest_invalid_inputr9   O   sü  € Ý
Œ(�;¥b¤hÐ
/Ñ
/Ô
/€Cå	ŒÕ-ØJð
Lñ 
Lô 
Lð 9ð 9åÔ% c¨!¨!¨!¨Q¨Q¨Q°¨'¤l°CÑ8Ô8Ð8ð9ð 9ð 9ñ 9ô 9ð 9ð 9ð 9ð 9ð 9ð 9øøøð 9ð 9ð 9ð 9õ 
ŒÕ-ØJð
Lñ 
Lô 
Lð Qð QåÔ% c¨3¨q¨q¨q°!°!°!°Q°Q°Q½¼
ÅBÄJÐ/NÔ+OÑPÔPÐPðQð Qð Qñ Qô Qð Qð Qð Qð Qð Qð Qøøøð Qð Qð Qð Qõ 
ŒÕ-ØBð
Dñ 
Dô 
Dð :ð :åÔ% c¨!¨!¨!¨Q¨Q¨Q°°°¨(¤m°SÑ9Ô9Ð9ð:ð :ð :ñ :ô :ð :ð :ð :ð :ð :ð :øøøð :ð :ð :ð :õ 
ŒÕ-ØUð
Wñ 
Wô 
Wð :ð :åÔ% c¨3¨r°¨r°1°1°1°a°a°a¨x¬=Ñ9Ô9Ð9ð:ð :ð :ñ :ô :ð :ð :ð :ð :ð :ð :øøøð :ð :ð :ð :õ 
ŒÕ-ØUð
Wñ 
Wô 
Wð :ð :åÔ% c¨3¨q¨q¨q°"°1°"°a°a°a¨x¬=Ñ9Ô9Ð9ð:ð :ð :ñ :ô :ð :ð :ð :ð :ð :ð :øøøð :ð :ð :ð :õ 
ŒÕ-ØVð
Xñ 
Xô 
Xð :ð :åÔ% c¨3¨q¨q¨q°!°!°!°R°a°R¨x¬=Ñ9Ô9Ð9ð:ð :ð :ñ :ô :ð :ð :ð :ð :ð :ð :ð :øøøð :ð :ð :ð :ð :ð :sk   ¼#A+Á+A/Á2A/Â;CÃCÃCÃ>%D/Ä/D3Ä6D3Å%FÆF
ÆF
Æ,%GÇG!Ç$G!È%H5È5H9È<H9)Úpathlibr   r   Únumpyr1   r4   r   Ú
matplotlibr   Úmatplotlib.testing.comparer   Úmatplotlib.testing.decoratorsr   Úmatplotlib.testing.exceptionsr   ÚmarkÚparametrizer'   r9   r   r   r   ú<module>rB      sí   ðØ Ð Ð Ð Ð Ð Ø €€€à Ð Ð Ð Ø €€€Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø <Ð <Ð <Ð <Ð <Ð <Ø @Ð @Ð @Ð @Ð @Ð @ð „×ÒØðð ð ñ ô  ðB>ð >ñC ô  ðB>ð>:ð :ð :ð :ð :r   