403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Python312/Lib/site-packages/numpy/ma/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python312/Lib/site-packages/numpy/ma/__pycache__/testutils.cpython-312.pyc
�

	�gD)���dZddlZddlZddlmZddlmcmZddlZddlm	Z	m
Z
mZmZm
Z
ddlmZmZmZmZmZmZgd�ZddlmZgd	�ZeezZdd
�Zdd�Zdd�Zd
�Zdd�Zdd�ZeZ dd�Z!e!Z"		dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'dd�Z(dd�Z)y)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)�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)rrrrrc��tt|�t|��}t|�}t|�}|jjdk(s|jjdk(r$tj||�j�Stt|d|��|�jt
j�}tt|d|��d�jt
j�}	tjtj||	z
�||tj|	�zz�}
|
j�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
rr�dtype�char�np�equal�ravelr�astype�float64�
less_equal�umath�absolute)�a�b�
fill_value�rtol�atol�m�d1�d2�x�y�ds           �4C:\Python312\Lib\site-packages\numpy/ma/testutils.pyrr)s���	���
�G�A�J�'�A�	���B�	���B�	�x�x�}�}���r�x�x�}�}��3��x�x��B��%�%�'�'���R�e�!�,�j�	��f�R�Z�Z���	�|�B�U��3�Q�7�>�>�r�z�z�J�A�
�
�
�e�n�n�Q��U�+�T�D�5�>�>�!�;L�4L�-L�M�A��7�7�9��c�p�tt|�t|��}t|�}t|�}|jjdk(s|jjdk(r$tj||�j�Stt|d|��|�jt
j�}tt|d|��d�jt
j�}tjtj||z
�|�d|zk}	|	j�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
rrr$r%r&r'r(rr)r*�around�abs)
r.r/�decimalr0r3r4r5r6r7r8s
          r9rrAs���	���
�G�A�J�'�A�	���B�	���B�	�x�x�}�}���r�x�x�}�}��3��x�x��B��%�%�'�'���R�e�!�,�j�	��f�R�Z�Z���	�|�B�U��3�Q�7�>�>�r�z�z�J�A�
�	�	�"�&�&��Q��-��)�T�w�h�-?�?�A��7�7�9�r:c	��tt|�t|�|�tt|��D]}t||||d|�d|����y)z;
    Asserts the equality of two non-array sequences.

    �item=�
N)r�len�range)�actual�desired�err_msg�ks    r9�_assert_equal_on_sequencesrIVsV��
��V��c�'�l�G�4�
�3�w�<�
 �F���V�A�Y���
�e�A�5��7�)�,D�E�F�
r:c�^�t|j|j�|jjD]t}tj||�tj||�}}|t
us�8|t
us�Attj||�tj||���vy)zI
    Asserts that two records are equal.

    Pretty crude for now.

    N)rr$�names�operator�getitemr)r.r/�f�af�bfs     r9rras�������!�'�'�"�
�W�W�]�]�I���$�$�Q��*�H�,<�,<�Q��,B�R���f��r�V�|���)�)�!�Q�/��1A�1A�!�Q�1G�H�I�r:c	���t|t�r�t|t�sttt	|����tt
|�t
|�|�|j�D]2\}}||vrt|�d|����t||||d|�d|����4yt|ttf�r$t|ttf�rt||d��St|t�s/t|t�st||g|�}||k(st|��y|tur|tus|tur$|turt||g|dd��}t|��tj |�}tj |�}|j"|j"}}|j$d	k(r9|j$d	k(r*t|j'�|j'�d��St)|||�S)
z,
    Asserts that two items are equal.

    z not in �key=rBN��rG�r6r7)�headerrK�S)�
isinstance�dict�AssertionError�repr�typerrC�items�list�tuplerIrrr�
ValueErrorr&�
asanyarrayr$r%�tolistr)rErFrGrH�i�msg�actual_dtype�
desired_dtypes        r9rrps����'�4� ��&�$�'� ��d�6�l�!3�4�4��S��[�#�g�,��8��M�M�O�	I�D�A�q����$��s�(�6�(�%;�<�<�����G�A�J�$�q�e�2�g�Y�0G�H�	I�	��'�D�%�=�)�j��$���.O�)�&�'�2�F�F��v�w�'�:�g�w�+G��V�W�-�w�8���&� � ��%�%��	�6�	�G�v�$5����&�F�*:��V�W�-�#�B�j�B����o��
�]�]�6�
"�F��m�m�G�$�G�%+�\�\�7�=�=�=�\����C��M�$6�$6�#�$=�)�&�-�-�/�*1�.�.�*:�24�6�	6��f�g�w�7�7r:c	�
�t|t�r�t|t�sttt	|����tt
|�t
|�|�|j�D]6\}}||vrtt|���t||||d|�d|����8yt|ttf�rht|ttf�rRtt
|�t
|�|�tt
|��D]}t||||d|�d|����yt|tj�st|tj�r
t|||�St||g|�}||k7st|��y)z<
    Raises an assertion error if two items are equal.

    rRrBNrA)rXrYrZr[r\�
fail_if_equalrCr]r^r_rDr&rrr)rErFrGrHrcrds      r9rhrh�sW��
�'�4� ��&�$�'� ��d�6�l�!3�4�4��c�&�k�3�w�<��9��M�M�O�	J�D�A�q����$�T�!�W�-�-��&��)�W�Q�Z�4��u�B�w�i�1H�I�	J�	��'�D�%�=�)�j��$���.O��c�&�k�3�w�<��9��s�7�|�$�	K�A��&��)�W�Q�Z�5���R��y�1I�J�	K���&�"�*�*�%��G�R�Z�Z�)H�"�6�7�G�<�<�
���)�7�
3�C��f���S�!�!�r:c��t|tj�st|tj�rt|||||��St	||g||��}tt
||z
�|�dk(st|��y)z~
    Asserts that two items are almost equal.

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

    )r?rG�verbose)rGrjrN)rXr&rrr�roundr>rZ)rErFr?rGrjrds      r9rr�sx���&�"�*�*�%��G�R�Z�Z�)H�(���'�18�'�K�	K�
���)� '��:�C���W�v�%�&��0�A�5��S�!�!�6r:c�~�tt|�t|��}t|d|dd��}t|d|dd��}|tur|tus|tur%|turt	||g|||d��}t|��tjj||j|�|j|�|||��S)zn
    Asserts that comparison between two masked arrays is satisfied.

    The comparison is elementwise.

    F)r"r#�	keep_mask�subokrU)rGrjrVrK�rGrjrV)
r
rrrrr`r&�testingrr)	�
comparisonr6r7rGrjrVr0r3rds	         r9rr�s���	���
�G�A�J�'�A��Q�U��e�5�I�A��Q�U��e�5�I�A�	
�f��q�F�{��6�k�A��K��Q��F�G�W�#)��=����o��
�:�:�*�*�:�+,�8�8�J�+?�+,�8�8�J�+?�3:�3:�6�	+�K�Kr:c�B�ttj||||d��y)z@
    Checks the elementwise equality of two masked arrays.

    �Arrays are not equalroN)rrL�__eq__�r6r7rGrjs    r9rr�s��
����!�Q�!(�'� 6�8r:c�,�d�}t|||||d��y)zT
    Raises an assertion error if two masked arrays are not equal elementwise.

    c�B�tjt||��S)N)r&�allrrUs  r9�comparez$fail_if_array_equal.<locals>.compare�s���F�F�6�!�Q�<�(�(�)r:rsroN�r)r6r7rGrjrys     r9rr�s��
*���!�Q��� 6�8r:c�2���fd�}t|||||d��y)�|
    Checks the equality of two masked arrays, up to given number odecimals.

    The equality is checked elementwise.

    c�(��t||d�z��S)�<Returns the result of the loose comparison between x and y).r<)r1)r�r6r7r?s  �r9ryz*assert_array_approx_equal.<locals>.compare�s����a������1�1r:�Arrays are not almost equalroNrz�r6r7r?rGrjrys  `   r9rr�s���2���!�Q��� =�?r:c�2���fd�}t|||||d��y)r|c���t||��S)r~)rrs  �r9ryz*assert_array_almost_equal.<locals>.compare
s����a��G�$�$r:r�roNrzr�s  `   r9rrs���%���!�Q��� =�?r:c�B�ttj||||d��y)z7
    Checks that x is smaller than y elementwise.

    zArrays are not less-orderedroN)rrL�__lt__rus    r9rrs��
����!�Q�!(�'� =�?r:c��|turt|tu�|turt|tu�t|||��y)z-
    Asserts the equality of two masks.

    rTN)r
rr)�m1�m2rGs   r9rrs6��

�V�|���f���	�V�|���f����r�2�w�/r:)Tg�h㈵��>g:�0�yE>)�T)rS)�rST)rSTrST)rST)r�rST)*�__doc__rL�numpyr&r�numpy._core.umath�_corer,�
numpy.testingrrrrr�corer
rrr
rr�
__all__masked�unittestr�__some__from_testing�__all__rrrIrrrhrrrrrrrrrr�r:r9�<module>r�s�������!�!����I�H��
����
�.�
.���0�*��$8�N"�4!��
"� #��MO�$(�K�28�8�?�?�?�	0r:

Youez - 2016 - github.com/yon3zu
LinuXploit