F d Z ddlZddlZddlmZmZ ddlmc mZ ddl Zddl m Z mZmZm Z mZ ddlmZmZmZmZmZmZ g dZddlmZ g d Zeez Zdd ZddZd dZd Zd dZd dZeZ d!dZ!e!Z" d"dZ#d#dZ$d#dZ%d$dZ&d$dZ'd#dZ(d dZ)dS )%zMiscellaneous 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)ndarrayfloat_)assert_assert_allcloseassert_array_almost_equal_nulp assert_raises build_err_msg )mask_orgetmaskmasked_arraynomaskmaskedfilled)almostapproxassert_almost_equalassert_array_almost_equalassert_array_approx_equalassert_array_compareassert_array_equalassert_array_lessassert_closeassert_equalassert_equal_recordsassert_mask_equalassert_not_equalfail_if_array_equal)TestCase)r r r r r Th㈵>:0yE>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. OFcopymaskr )r r r dtypecharnpequalravelr astyper less_equalumathabsolute)ab fill_valuertolatolmd1d2xyds f/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib64/python3.11/site-packages/numpy/ma/testutils.pyr r ) s GAJJ''A B B x}rx}33xB%%'''|BU333Z@@GGOOA|BU333Q77>>vFFA enQU++TD5>!;L;L4L-LMMA7799 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' r( r) r* r+ r r, r aroundabs) r0 r1 decimalr2 r5 r6 r7 r8 r9 r: s r; r r ? s GAJJ''A B B x}rx}33xB%%'''|BU333Z@@GGOOA|BU333Q77>>vFFA "&Q--))Twh-??A7799r<