OwlCyberSecurity - MANAGER
Edit File: compare.cpython-38.pyc
U ��]TH � @ sX d Z ddlZddlZddlZddlmZ ddlZddlZddlZddl Z ddl mZ ddlZ ddlZddlmZ ddlmZ ddd gZd d� Ze�d�d-d d��Zdd� Zd.dd�Zdd� Ze�d�jZdd� ZG dd� de�ZG dd� de �Z!G dd� de!�Z"G dd� de!�Z#d d!� Z$i Z%e$� d"d � Z&d#d$� Z'd%d&� Z(d'd(� Z)d/d*d�Z*d+d,� Z+dS )0zD Provides a collection of utilities for comparing (image) results. � N)�Path)� TemporaryFile)�ImageComparisonFailure)�cbook� compare_float�compare_images�comparable_formatsc C s t j�| �\}}d|||f S )zU Make a new filename by inserting `purpose` before the file's extension. z%s-%s%s)�os�path�splitext)�fnameZpurpose�baseZext� r �</usr/lib/python3/dist-packages/matplotlib/testing/compare.py�make_test_filename s r z3.0c C s� |dkr|dkrt d��d}|dk r^t| | �}||k r^dddddg}|d�d d � |D ��7 }|dk r�t| | �}| r�|t| � }||k r�dddddg}|d�d d � |D ��7 }|p�dS )z� Fail if the floating point values are not close enough, with the given message. You can specify a relative tolerance, absolute tolerance, or both. Nz}You haven't specified a 'relTol' relative tolerance or a 'absTol' absolute tolerance function argument. You must specify one.� zExpected: {expected}zActual: {actual}zAbs diff: {absDiff}zAbs tol: {absTol}� c S s g | ]}|j f t� ��qS r ��format�locals��.0�liner r r � <listcomp>9 s z!compare_float.<locals>.<listcomp>zRel diff: {relDiff}zRel tol: {relTol}c S s g | ]}|j f t� ��qS r r r r r r r I s )� ValueError�abs�join)�expected�actualZrelTolZabsTol�msgZabsDiff�templateZrelDiffr r r r "