관리-도구
편집 파일: testutils.cpython-37.pyc
B ��Fd�( � @ sn d Z ddlmZmZmZ ddlZddlZddlmZm Z ddl m mZ ddl mZmZmZmZmZmZmZ ddlm mZ ddlmZmZmZmZmZmZ dd d ddd ddddddddgZddddddgZee Z d2dd �Z!d3d!d�Z"d4d#d$�Z#d%d� Z$d5d&d�Z%d6d'd(�Z&e&Z'd7d*d �Z(e(Z)d8d+d �Z*d9d,d�Z+d:d-d�Z,d;d.d�Z-d<d/d�Z.d=d0d�Z/d>d1d�Z0dS )?z�Miscellaneous functions for testing masked arrays and subclasses :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: testutils.py 3529 2007-11-13 08:01:14Z jarrod.millman $ � )�division�absolute_import�print_functionN)�ndarray�float_)�TestCase�assert_�assert_allclose�assert_array_almost_equal_nulp� assert_raises� build_err_msg�run_module_suite� )�mask_or�getmask�masked_array�nomask�masked�filled�almost�approx�assert_almost_equal�assert_array_almost_equal�assert_array_approx_equal�assert_array_compare�assert_array_equal�assert_array_less�assert_close�assert_equal�assert_equal_records�assert_mask_equal�assert_not_equal�fail_if_array_equalr r r r r r T��h㈵��>�:�0�yE>c C s� t t| �t|��}t| �}t|�}|jjdks:|jjdkrJt�||��� S tt|d|d�|�� t �}tt|d|d�d�� t �} t�t� || �||t� | � �} | �� S )a� Returns true if all components of a and b are equal to given tolerances. If fill_value is True, masked values considered equal. Otherwise, masked values are considered unequal. The relative error rtol should be positive and << 1.0 The absolute error atol comes into play for those elements of b that are very small or zero; it says how small a must be also. �OF)�copy�maskr )r r r �dtype�char�np�equal�ravelr �astyper � less_equal�umath�absolute)�a�b� fill_value�rtolZatol�m�d1�d2�x�y�d� r; �E/opt/alt/python37/lib64/python3.7/site-packages/numpy/ma/testutils.pyr * s $� c C s� t t| �t|��}t| �}t|�}|jjdks:|jjdkrJt�||��� S tt|d|d�|�� t �}tt|d|d�d�� t �}t�t�|| �|�d| k} | �� S )z� Returns True if a and b are equal up to decimal places. If fill_value is True, masked values considered equal. Otherwise, masked values are considered unequal. r% F)r&