403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.148.217.26
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib64/python3.7/site-packages/numpy/ma/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib64/python3.7/site-packages/numpy/ma/__pycache__/testutils.cpython-37.pyc
B

��Fd�(�@sndZddlmZmZmZddlZddlZddlmZm	Z	ddl
mmZddl
mZmZmZmZmZmZmZddlmmZddlmZmZmZmZmZmZdd	d
ddd
ddddddddgZddddddgZeeZ 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_equalrrr	r
rr
T��h㈵��>�:�0�yE>cCs�tt|�t|��}t|�}t|�}|jjdks:|jjdkrJt�||���Stt|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)rrr�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
Cs�tt|�t|��}t|�}t|�}|jjdks:|jjdkrJt�||���Stt|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&r'rg$@)
rrrr(r)r*r+r,rr-rZaround�abs)
r1r2�decimalr3r5r6r7r8r9r:r;r;r<r@s �cCsJtt|�t|�|�x0tt|��D] }t||||d||f�q"WdS)z;
    Asserts the equality of two non-array sequences.

    z
item=%r
%sN)r�len�range)�actual�desired�err_msg�kr;r;r<�_assert_equal_on_sequencesSs rGcCsht|j|j�xT|jjD]H}t�||�t�||�}}|tk	r|tk	rtt�||�t�||��qWdS)zI
    Asserts that two records are equal.

    Pretty crude for now.

    N)rr(�names�operator�getitemr)r1r2�f�afZbfr;r;r<r^scCs�t|t�r�t|t�s$ttt|����tt|�t|�|�xH|��D]<\}}||krbtd||f��t||||d||f�qBWdSt|tt	f�r�t|tt	f�r�t
||dd�St|t�s�t|t�s�t||g|�}||ks�t|��dS|t
kr�|t
k	�s|t
k�r(|t
k	�r(t||g|ddd�}t|��tj|dd	d
�}tj|dd	d
�}|j|j}}|jdk�r�|jdk�r�t
|��|��dd�St|||�S)z,
    Asserts that two items are equal.

    z%s not in %sz	key=%r
%sNr@)rE)r8r9)�headerrHFT)r&�subok�S)�
isinstance�dict�AssertionError�repr�typerrA�items�list�tuplerGrrr�
ValueErrorr*�arrayr(r)�tolistr)rCrDrErF�i�msgZactual_dtypeZ
desired_dtyper;r;r<rms:

 cCs4t|t�r�t|t�s$ttt|����tt|�t|�|�xD|��D]8\}}||kr^tt|���t||||d||f�qBWdSt|tt	f�r�t|tt	f�r�tt|�t|�|�x0t
t|��D] }t||||d||f�q�WdSt|tj��st|tj��rt
|||�St||g|�}||k�s0t|��dS)z<
    Raises an assertion error if two items are equal.

    z	key=%r
%sNz
item=%r
%s)rPrQrRrSrT�
fail_if_equalrArUrVrWrBr*rr"r)rCrDrErFr[r\r;r;r<r]�s&

  
r]�cCs^t|tj�st|tj�r*t|||||d�St||g||d�}tt||�|�dksZt|��dS)z~
    Asserts that two items are almost equal.

    The test is equivalent to abs(desired-actual) < 0.5 * 10**(-decimal).

    )r?rE�verbose)rEr_rN)rPr*rrr�roundr>rR)rCrDr?rEr_r\r;r;r<r�s

c	Cs�tt|�t|��}t|d|ddd�}t|d|ddd�}|tkrF|tk	sV|tkrt|tk	rtt||g|||dd�}t|��tj||�|�|�|�|||d�S)zn
    Asserts that comparison between two masked arrays is satisfied.

    The comparison is elementwise.

    F)r&r'Z	keep_maskrN)r8r9)rEr_rMrH)rEr_rM)	rrrrrrX�utilsrr)	Z
comparisonr8r9rEr_rMr3r5r\r;r;r<r�s	
cCsttj||||dd�dS)z@
    Checks the elementwise equality of two masked arrays.

    zArrays are not equal)rEr_rMN)rrI�__eq__)r8r9rEr_r;r;r<r�s
cCs dd�}t|||||dd�dS)zT
    Raises an assertion error if two masked arrays are not equal elementwise.

    cSst�t||��S)N)r*Zalltruer)r8r9r;r;r<�compare�sz$fail_if_array_equal.<locals>.comparezArrays are not equal)rEr_rMN)r)r8r9rEr_rcr;r;r<r"�scs$�fdd�}t|||||dd�dS)z|
    Checks the equality of two masked arrays, up to given number odecimals.

    The equality is checked elementwise.

    cst||d�d�S)z<Returns the result of the loose comparison between x and y).g$@)r4)r)r8r9)r?r;r<rc�sz*assert_array_approx_equal.<locals>.comparezArrays are not almost equal)rEr_rMN)r)r8r9r?rEr_rcr;)r?r<r�scs$�fdd�}t|||||dd�dS)z|
    Checks the equality of two masked arrays, up to given number odecimals.

    The equality is checked elementwise.

    cst||��S)z<Returns the result of the loose comparison between x and y).)r)r8r9)r?r;r<rcsz*assert_array_almost_equal.<locals>.comparezArrays are not almost equal)rEr_rMN)r)r8r9r?rEr_rcr;)r?r<rscCsttj||||dd�dS)z7
    Checks that x is smaller than y elementwise.

    zArrays are not less-ordered)rEr_rMN)rrI�__lt__)r8r9rEr_r;r;r<rs
cCs:|tkrt|tk�|tkr(t|tk�t|||d�dS)z-
    Asserts the equality of two masks.

    )rEN)rrr)�m1�m2rEr;r;r<r s
)Tr#r$)r=T)r@)r@)r@)r^r@T)r@Tr@T)r@T)r@T)r=r@T)r=r@T)r@T)r@)1�__doc__�
__future__rrrrI�numpyr*rrZnumpy.core.umath�corer/Z
numpy.testingrrr	r
rrr
Znumpy.testing.utils�testingrarrrrrrZ
__all__maskedZ__some__from_testing�__all__rrrGrrr]r!rrrrr"rrrr r;r;r;r<�<module>sB$ 




'










Youez - 2016 - github.com/yon3zu
LinuXploit