
    EVfp                     N   d Z ddlZddlZddlZddlZddlZddlZddlmZ	 ddl
mZmZ ddZej                  j                  ddd	d
ddd ej                   dddeeg      d ej                   ddde      g	      d        Zej                  j                  dddg      d        Zy)z
Test output reproducibility.
    N)pyplot)needs_ghostscriptneeds_usetexmhic           	      v   t        j                  |       t         j                  j                  d|d       t	        j
                         }d| v r|j                  ddd      }t        d      }|j                  |dgdz  d       |j                  |d	gdz  d
       |j                  |dgdz  d       |j                  |dgdz  d       |j                  |dgdz  d       d| v r|j                  ddd	      }|j                  t        dd      t        dd            |j                  t        dd      dgdz  t        dd            z   }|j                  g d       d}t        ||      D ]  \  }	}
|	j                  |
        d| v rg dg dg dg}|j                  ddd      j                  |d       g dg dg dg}|j                  ddd      j                  |d       g dg dg dg}|j                  ddd      j                  |d       t        d      }|j                  ddd      }|j                  ||       |j                  d       |j                  d       |j!                  d       t#        t$        j&                  d t$        j&                        }|j)                  ||!       y )"Nasdf)zsvg.hashsaltztext.usetexm      
   D)marker   x   ^   H   vh)bottom)g      ?g      @g      @g      @)-+r   \*oO.i)r
   r   r   )r   r   r
   )r   r
   r   nearest)interpolation)r
   r   r   bilinear)r   r
   r   bicubiczA string $1+2+\sigma$buffer)format)mplusercParamsupdatepltfigureadd_subplotrangeplotbar
set_xtickszip	set_hatchimshow	set_title
set_xlabel
set_ylabelgetattrsysstdoutsavefig)objectsfmtusetexfigax1r   ax2barspatternsr0   patternAaxr:   s                 j/var/www/html/software/conda/envs/catlas/lib/python3.12/site-packages/matplotlib/tests/test_determinism.py_save_figurerH      sb   GGCLLLGH
**,C
g~ooaA&"IQC"HS)QC"HS)QC"HS)QC"HS)QC"HS)
g~ooaA&aU1a[1aaS1WU1a[AB+,<h/ 	#LCMM'"	# g~	9-1a '''C	9-1a '''D	9-1a '''CaA	Aq	!BGGAqMLL)*MM*+MM*+SZZ3::6FKKsK#    zobjects, fmt, usetex) pdfF)r	   rK   F)r   rK   F)r    rK   F)r   rK   F)r   psFrL   T)marks)r   svgFrN   c                 >   t        d      D cg c]J  }t        j                  t        j                  ddd| d|d| dgi t
        j                  ddd	
      L }}|dd D ]2  }|dk(  r!|r||d   k7  st        j                  d       )||d   k(  r2J  yc c}w )a?  
    Output three times the same graphs and checks that the outputs are exactly
    the same.

    Parameters
    ----------
    objects : str
        Objects to be included in the test document: 'm' for markers, 'h' for
        hatch patterns, 'i' for images.
    fmt : {"pdf", "ps", "svg"}
        Output format.
    r   -R-czHfrom matplotlib.tests.test_determinism import _save_figure;_save_figure(z, )	946684800AggSOURCE_DATE_EPOCH
MPLBACKENDenvr
   NrL   r   z+failed, maybe due to ghostscript timestamps)	r.   
subprocesscheck_outputr9   
executableosenvironpytestskip)r<   r=   r>   _plotsps         rG   test_determinism_checkrd   @   s    D q  	^^T4$Kr#6(!=>&2:: &K$&		'E  12Y !$;6E!H}IJa= =!s   ABzfmt, string)rK   s!   /CreationDate (D:20000101000000Z))rL   s(   %%CreationDate: Sat Jan 01 00:00:00 2000c                     t        j                  t        j                  ddd| dgi t        j
                  ddd      }||v sJ y	)
a  
    Test SOURCE_DATE_EPOCH support. Output a document with the environment
    variable SOURCE_DATE_EPOCH set to 2000-01-01 00:00 UTC and check that the
    document contains the timestamp that corresponds to this date (given as an
    argument).

    Parameters
    ----------
    fmt : {"pdf", "ps", "svg"}
        Output format.
    string : bytes
        Timestamp string for 2000-01-01 00:00 UTC.
    rP   rQ   zMfrom matplotlib.tests.test_determinism import _save_figure; _save_figure('', rR   rS   rT   rU   rX   N)rZ   r[   r9   r\   r]   r^   )r=   stringbufs      rG   "test_determinism_source_date_epochrh   l   s]    0 
!
!	t G1
&	'"rzz " "	#C S==rI   )__doc__r]   rZ   r9   r_   
matplotlibr'   matplotlib.testing.comparer   r+   matplotlib.testing._markersr   r   rH   markparametrizeparamrd   rh    rI   rG   <module>rq      s    
  
   ! $ G,$^ 4l4E%F	HUE4|<!!< 5
 	<		rI   