File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/ma/__pycache__/testutils.cpython-311.pyc
�
F ������ � � d Z ddlZddlZddlmZmZ ddlmc mZ ddl Zddl m
Z
mZmZm
Z
mZ ddlmZmZmZmZmZmZ g d�ZddlmZ g d �Zeez Zdd
�Zdd�Zd d�Zd� Zd d�Zd d�ZeZ d!d�Z!e!Z" d"d�Z#d#d�Z$d#d�Z%d$d�Z&d$d�Z'd#d�Z(d d�Z)dS )%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 $
� N)�ndarray�float_)�assert_�assert_allclose�assert_array_almost_equal_nulp�
assert_raises�
build_err_msg� )�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_equal)�TestCase)r r r r r T��h㈵��>�:�0�yE>c � � t t | � � t |� � � � }t | � � }t |� � }|j j dk s|j j dk r't j ||� � � � � S t t |d|�� � |� � � t � � }t t |d|�� � d� � � t � � } t j t j
|| z
� � ||t j
| � � z z � � }
|
� � � 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�rtol�atol�m�d1�d2�x�y�ds �e/builddir/build/BUILD/cloudlinux-venv-1.0.8/venv/lib64/python3.11/site-packages/numpy/ma/testutils.pyr r ) s � � ���
�
�G�A�J�J�'�'�A� ����B� ����B� �x�}����r�x�}��3�3��x��B���%�%�'�'�'��|�B�U��3�3�3�Z�@�@�G�G��O�O�A��|�B�U��3�3�3�Q�7�7�>�>�v�F�F�A�
�
�e�n�Q��U�+�+�T�D�5�>�!�;L�;L�4L�-L�M�M�A��7�7�9�9�� � c � � t t | � � t |� � � � }t | � � }t |� � }|j j dk s|j j dk r't j ||� � � � � S t t |d|�� � |� � � t � � }t t |d|�� � d� � � t � � }t j t j ||z
� � |� � d| z 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# Fr$ r
� $@)
r r r r'