hyb
2025-11-18 7539e6f48c75dcaeb808359cccfd1c0d0d182ce8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Ë
Kñúh!)ãó—dZddlZddlZddlmcmZddlZddlmZddlm    Z    m
Z
m Z m 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
 
éN)Úndarray)Úassert_Úassert_allcloseÚassert_array_almost_equal_nulpÚ assert_raisesÚ build_err_msgé)ÚfilledÚgetmaskÚmask_orÚmaskedÚ masked_arrayÚnomask)Ú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$t j ||«j«Stt|d|¬«|«jt
j«}tt|d|¬«d«jt
j«}    t jtj||    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 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            úEH:\Change_password\venv_build\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$t j ||«j«Stt|d|¬«|«jt
j«}tt|d|¬«d«jt
j«}t jt j||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 r r
r$r%r&r'r(rr)r*ÚaroundÚabs)
r.r/Údecimalr0r3r4r5r6r7r8s
          r9rrEsæ€ô    ”˜“
œ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_sequencesrIZsS€ô
”V“œc '›l¨GÔ4Ü ”3w“<Ó  òFˆÜV˜A‘Y ¨¡
¨e°A°5¸¸7¸)Ð,DÕEñFr: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     r9rrdsƒ€ô—‘˜!Ÿ'™'Ô"Ø W‰W]‰]òIˆÜ×$Ñ$ Q¨Ó*¬H×,<Ñ,<¸QÀÓ,BˆRˆØ”f’  r¬V¢|Ü œ×)Ñ)¨!¨QÓ/´×1AÑ1AÀ!ÀQÓ1GÕ HñIr:c    óÞ—t|t«r’t|t«sttt    |«««‚t t |«t |«|«|j«D]2\}}||vrt|›d|›«‚t ||||d|›d|›«Œ4yt|ttf«r$t|ttf«rt||d¬«St|t«s/t|t«st||g|«}||k(s t|«‚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        r9rrrs¾€ô 'œ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    |«««‚t t |«t |«|«|j«D]6\}}||vrtt|««‚t ||||d|›d|›«Œ8yt|ttf«rht|ttf«rRt t |«t |«|«tt |««D]}t ||||d|›d|›«Œyt|tj«st|tj«r t|||«St||g|«}||k7s t|«‚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||¬«}t t ||z
«|«dk(s t|«‚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 r rr rr`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)rrr)Ú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&Únumpy._core.umathÚ_corer,Ú numpy.testingrrrrrrÚcorer
r r r rrÚ __all__maskedÚunittestrÚ__some__from_testingÚ__all__rrrIrrrhrrrrrrrrrr©r:r9ú<module>r–sµðñó ãß!Ð!ÛÝ÷õ÷I×Hò€ õòÐð
Ð.Ñ
.€óó0ó*Fò Ió$8óN"ð4!Ðó "ð #€ ðMOØ$(óKó28ó8ó ?ó ?ó?ô    0r: