+
    i'                     :   R t ^ RIt^ RIt^ RIHu Ht ^ RIt^ RIHt ^ RIH	t	H
t
HtHtHt ^RIHtHtHtHtHtHt . ROt^ RIHt . ROt]],           tRR ltRR ltRR ltR	 tRR
 ltRR lt]t RR lt!]!t"RR lt#RR lt$RR lt%RR lt&RR lt'RR lt(RR lt)R# )zMiscellaneous functions for testing masked arrays and subclasses

:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu

N)ndarray)assert_assert_allcloseassert_array_almost_equal_nulpassert_raisesbuild_err_msg)filledgetmaskmask_ormaskedmasked_arraynomask)TestCasec                   \        \        V 4      \        V4      4      p\        V 4      p\        V4      pVP                  P                  R8X  g   VP                  P                  R8X  d%   \
        P                  ! Wg4      P                  4       # \        \        VRVR7      V4      P                  \
        P                  4      p\        \        VRVR7      ^4      P                  \
        P                  4      p	\
        P                  ! \        P                  ! W,
          4      WC\        P                  ! V	4      ,          ,           4      p
V
P                  4       # )aj  
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mask)r
   r	   r   dtypecharnpequalravelr   astypefloat64
less_equalumathabsolute)ab
fill_valuertolatolmd1d2xyds   &&&&&      4/usr/lib/python3/dist-packages/numpy/ma/testutils.pyapproxr*   -   s     	
GAJ'A	B	B	xx}}rxx}}3xx%%''Re!,j	fRZZ  	|BU3Q7>>rzzJA
ennQU+T5>>!;L4L-LMA779    c                   \        \        V 4      \        V4      4      p\        V 4      p\        V4      pVP                  P                  R8X  g   VP                  P                  R8X  d%   \
        P                  ! WV4      P                  4       # \        \        VRVR7      V4      P                  \
        P                  4      p\        \        VRVR7      ^4      P                  \
        P                  4      p\
        P                  ! \
        P                  ! Wx,
          4      V4      RV) ,          8*  p	V	P                  4       # )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   aroundabs)
r   r   decimalr    r#   r$   r%   r&   r'   r(   s
   &&&&      r)   almostr1   E   s     	
GAJ'A	B	B	xx}}rxx}}3xx%%''Re!,j	fRZZ  	|BU3Q7>>rzzJA
		"&&-)Twh-??A779r+   c           	         \        \        V 4      \        V4      V4       \        \        V4      4       F#  p\        W,          W,          RV: RV 24       K%  	  R# )z3
Asserts the equality of two non-array sequences.

item=
N)assert_equallenrange)actualdesirederr_msgks   &&& r)   _assert_equal_on_sequencesr<   Z   sH    
 Vc'lG43w< VY
eA57),DE !r+   c                n   \        V P                  VP                  4       V P                  P                   Fz  p\        P                  ! W4      \        P                  ! W4      rCV\
        J d   K:  V\
        J d   KF  \        \        P                  ! W4      \        P                  ! W4      4       K|  	  R# )z=
Asserts that two records are equal.

Pretty crude for now.

N)r5   r   namesoperatorgetitemr   )r   r   fafbfs   &&   r)   assert_equal_recordsrD   d   sr     !''"WW]]$$Q*H,<,<Q,BRfrV|))!/1A1A!1GH r+   c           	     R   \        V\        4      '       d   \        V \        4      '       g   \        \        \	        V 4      4      4      h\        \        V 4      \        V4      V4       VP                  4        F;  w  r4W09  d   \        V RV  24      h\        W,          W,          RV: RV 24       K=  	  R# \        V\        \        34      '       d*   \        V \        \        34      '       d   \        WRR7      # \        V \        4      '       g7   \        V\        4      '       g!   \        W.V4      pW8X  g   \        V4      hR# V \        J d   V\        J d   V\        J d&   V \        J g   \        W.VRR	R7      p\        V4      h\        P                   ! V 4      p \        P                   ! V4      pV P"                  VP"                  rvVP$                  R8X  d<   VP$                  R8X  d+   \        V P'                  4       VP'                  4       RR7      # \)        WV4      # )
z$
Asserts that two items are equal.

z not in key=r4   N r:   )headerr>   Sr&   r'   )
isinstancedictAssertionErrorreprtyper5   r6   itemslisttupler<   r   r   r   
ValueErrorr   
asanyarrayr   r   tolistassert_array_equal)r8   r9   r:   r;   imsgactual_dtypedesired_dtypes   &&&     r)   r5   r5   r   s    '4  &$'' d6l!344S[#g,8MMODA$s(6(%;<<GJ$qe2gY0GH $ 	'D%=))j$.O.O)&2FFvw'':gw+G+GV-w8  %%	6	Gv$5&F*:V-#BjBo]]6"FmmG$G%+\\7===CM$6$6#$=)&--/*1..*:246 	6 fw77r+   c           	     |   \        V\        4      '       d   \        V \        4      '       g   \        \        \	        V 4      4      4      h\        \        V 4      \        V4      V4       VP                  4        F?  w  r4W09  d   \        \        V4      4      h\        W,          W,          RV: RV 24       KA  	  R# \        V\        \        34      '       dy   \        V \        \        34      '       d]   \        \        V 4      \        V4      V4       \        \        V4      4       F#  p\        W,          W,          RV: RV 24       K%  	  R# \        V \        P                  4      '       g!   \        V\        P                  4      '       d   \        WV4      # \        W.V4      pW8w  g   \        V4      hR# )z4
Raises an assertion error if two items are equal.

rF   r4   Nr3   )rL   rM   rN   rO   rP   fail_if_equalr6   rQ   rR   rS   r7   r   r   fail_if_array_equalr   )r8   r9   r:   r;   rX   rY   s   &&&   r)   r]   r]      sI   
 '4  &$'' d6l!344c&k3w<9MMODA$T!W--&)WZ4uBwi1HI $ 	'D%=))j$.O.Oc&k3w<9s7|$A&)WZ5Ry1IJ %&"**%%GRZZ)H)H"6G<<
)7
3CS!! r+   c                   \        V \        P                  4      '       g!   \        V\        P                  4      '       d   \        WVW4R7      # \	        W.W4R7      p\        \        W,
          4      V4      ^ 8X  g   \        V4      hR# )zr
Asserts that two items are almost equal.

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

)r0   r:   verbose)r:   r`   N)rL   r   r   assert_array_almost_equalr   roundr/   rN   )r8   r9   r0   r:   r`   rY   s   &&&&& r)   assert_almost_equalrc      st     &"**%%GRZZ)H)H('18K 	K
) ':CW%&0A5S!! 6r+   c           	        \        \        V4      \        V4      4      p\        VRVRRR7      p\        VRVRRR7      pV\        J d   V\        J d   V\        J d&   V\        J g   \	        W.W4VRR7      p\        V4      h\        P                  P                  V VP                  V4      VP                  V4      VWER7      # )zb
Asserts that comparison between two masked arrays is satisfied.

The comparison is elementwise.

F)r   r   	keep_masksubok)r:   r`   rI   r>   r:   r`   rI   rK   )
r
   r	   r   r   r   rT   r   testingassert_array_comparer   )	
comparisonr&   r'   r:   r`   rI   r    r#   rY   s	   &&&&&&&  r)   ri   ri      s     	
GAJ'AQUe5IAQUe5IA	
fqF{6kAKQFG#)=o::**:+,88J+?+,88J+?3:3:	 + K Kr+   c           	     @    \        \        P                  WW#RR7       R# )z8
Checks the elementwise equality of two masked arrays.

Arrays are not equalrg   N)ri   r?   __eq__r&   r'   r:   r`   s   &&&&r)   rW   rW      s    
 !!( 68r+   c           	     *    R p\        W@WVRR7       R# )zL
Raises an assertion error if two masked arrays are not equal elementwise.

c                 J    \         P                  ! \        W4      4      '       * # )N)r   allr*   rK   s   &&r)   compare$fail_if_array_equal.<locals>.compare   s    FF6!<(()r+   rl   rg   Nri   )r&   r'   r:   r`   rr   s   &&&& r)   r^   r^      s    
*Q 68r+   c           	     2   a V3R lp\        WPWVRR7       R# )p
Checks the equality of two masked arrays, up to given number odecimals.

The equality is checked elementwise.

c                .   < \        WRS) ,          R7      # )<Returns the result of the loose comparison between x and y).r-   )r!   )r*   r&   r'   r0   s   &&r)   rr   *assert_array_approx_equal.<locals>.compare   s    a11r+   Arrays are not almost equalrg   Nrt   r&   r'   r0   r:   r`   rr   s   &&f&& r)   assert_array_approx_equalr}      s    2 Q =?r+   c           	     2   a V3R lp\        WPWVRR7       R# )rv   c                   < \        WS4      # )rx   )r1   ry   s   &&r)   rr   *assert_array_almost_equal.<locals>.compare  s    aG$$r+   r{   rg   Nrt   r|   s   &&f&& r)   ra   ra     s    % Q =?r+   c           	     @    \        \        P                  WW#RR7       R# )z/
Checks that x is smaller than y elementwise.

zArrays are not less-orderedrg   N)ri   r?   __lt__rn   s   &&&&r)   assert_array_lessr     s    
 !!( =?r+   c                    V \         J d   \        V\         J 4       V\         J d   \        V \         J 4       \        WVR7       R# )z%
Asserts the equality of two masks.

rH   N)r   r   rW   )m1m2r:   s   &&&r)   assert_mask_equalr     s4    
 
V|f	V|frw/r+   )r1   r*   rc   ra   r}   ri   rW   r   assert_closer5   rD   r   assert_not_equalr^   )r   r   r   r   r   )Tgh㈵>g:0yE>)   T)rG   )   rG   T)rG   TrG   T)rG   T)r   rG   T)*__doc__r?   numpyr   numpy._core.umath_corer   numpy.testingr   r   r   r   r   r   corer   r	   r
   r   r   r   __all__maskedunittestr   __some__from_testing__all__r*   r1   r<   rD   r5   r]   r   rc   r   ri   rW   r^   r}   ra   r   r    r+   r)   <module>r      s      ! !    I H  
 .
.0*FI$8N"4 ! "  #K288???	0r+   