zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
U
O±d_¶ã    @s2dZddlZddlZddlZddlZddlZddlZddlZddlZ    ddl
m Z m Z m Z mZmZmZmZddlmZzddlZdZWnek
rœdZYnXGdd„dƒZGd    d
„d
eƒZGd d „d eƒZGd d„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„dƒZGdd„deƒZGdd„deƒZ Gdd„deƒZ!Gdd„deƒZ"Gdd „d eƒZ#Gd!d"„d"eƒZ$Gd#d$„d$eƒZ%Gd%d&„d&eƒZ&Gd'd(„d(eƒZ'Gd)d*„d*eƒZ(Gd+d,„d,eƒZ)Gd-d.„d.eƒZ*Gd/d0„d0eƒZ+Gd1d2„d2eƒZ,Gd3d4„d4eƒZ-Gd5d6„d6eƒZ.Gd7d8„d8eƒZ/Gd9d:„d:eƒZ0Gd;d<„d<eƒZ1Gd=d>„d>eƒZ2Gd?d@„d@eƒZ3GdAdB„dBeƒZ4GdCdD„dDeƒZ5GdEdF„dFeƒZ6z*e 7¡e 8dG¡ddl9Z9W5QRXWnek
rÞdZ:YnXdZ:ej;j<e: dHdIGdJdK„dKeƒƒZ=GdLdM„dMeƒZ>GdNdO„dOeƒZ?e     @dP¡jAe     @dP¡jBdQdR„dSdR„dTœZCej;jDdUeC E¡eCdVGdWdX„dXeƒƒZFGdYdZ„dZeƒZGGd[d\„d\eƒZHGd]d^„d^eƒZIGd_d`„d`eƒZJGdadb„dbeƒZKGdcdd„ddeƒZLGdedf„dfeƒZMGdgdh„dheƒZNej; Ddidjdkdldmdndog¡dpdq„ƒZOej; Pdr¡Gdsdt„dtƒƒZQdS)uz‡
Tests related to deprecation warnings. Also a convenient place
to document how deprecations should eventually be turned into errors.
 
éN)Ú assert_raisesÚ assert_warnsÚassert_Úassert_array_equalÚSkipTestÚKnownFailureExceptionÚ break_cycles©Úfromstring_null_term_c_apiTFc@sJeZdZdZeZdd„Zdd„Zdddej    difd    d
„Z
difd d „Z d S)Ú_DeprecationTestCaseÚcCsBtjdd|_|j ¡|_tjd|jdtjd|j|jddS)NT©ÚrecordÚalways)Úcategory©Úmessager)ÚwarningsÚcatch_warningsÚwarn_ctxÚ    __enter__ÚlogÚfilterwarningsÚ warning_clsr©Úself©rúYd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/core/tests/test_deprecations.pyÚ setup_method#s  
ÿz!_DeprecationTestCase.setup_methodcCs|j ¡dS©N)rÚ__exit__rrrrÚteardown_method1sz$_DeprecationTestCase.teardown_methodéFrc     CsRd}g|jdd…<|tjkr$|jf}z|||ŽWn|r>tntƒk
rPYnXd}    |jD]4}
|
j|jkrv|    d7}    q\|s\td|jj|
jfƒ‚q\|dk    rØ|    |krØdt    |jƒ|f} dd„|jDƒ} td     
| g| ¡ƒ‚t   ¡ht j d
|j|jd z"|||Ž|tƒkrtd ƒ‚Wn*|k
rB|tƒkr>td ƒ‚YnXW5QRXdS)aýTest if DeprecationWarnings are given and raised.
 
        This first checks if the function when called gives `num`
        DeprecationWarnings, after that it tries to raise these
        DeprecationWarnings and compares them with `exceptions`.
        The exceptions can be different for cases where this code path
        is simply not anticipated and the exception is replaced.
 
        Parameters
        ----------
        function : callable
            The function to test
        num : int
            Number of DeprecationWarnings to expect. This should normally be 1.
        ignore_others : bool
            Whether warnings of the wrong type should be ignored (note that
            the message is not checked)
        function_fails : bool
            If the function would normally fail, setting this will check for
            warnings inside a try/except block.
        exceptions : Exception or tuple of Exceptions
            Exception to expect when turning the warnings into an error.
            The default checks for DeprecationWarnings. If exceptions is
            empty the function is expected to run successfully.
        args : tuple
            Arguments for `function`
        kwargs : dict
            Keyword arguments for `function`
        TNrr"zexpected %s but got: %sz"%i warnings found but %i expected.cSsg|] }t|ƒ‘qSr)Ústr)Ú.0ÚwrrrÚ
<listcomp>msz:_DeprecationTestCase.assert_deprecated.<locals>.<listcomp>Ú
Úerrorrz$No error raised during function callz!Error raised during function call)rÚnpÚ_NoValuerÚ    ExceptionÚtuplerÚAssertionErrorÚ__name__ÚlenÚjoinrrrr) rÚfunctionÚnumÚ ignore_othersZfunction_failsÚ
exceptionsÚargsÚkwargsZ__tracebackhide__Z    num_foundÚwarningÚmsgÚlstrrrÚassert_deprecated4sJ!
 
 
 ÿÿ
 
ÿ
 ÿ ÿz&_DeprecationTestCase.assert_deprecatedcCs|j|ddtƒ||ddS)zÝTest that warnings are not raised.
 
        This is just a shorthand for:
 
        self.assert_deprecated(function, num=0, ignore_others=True,
                        exceptions=tuple(), args=args, kwargs=kwargs)
        rT)r2r3r4r5r6N)r:r,)rr1r5r6rrrÚassert_not_deprecated}s
 
ÿz*_DeprecationTestCase.assert_not_deprecatedN) r.Ú
__module__Ú __qualname__rÚDeprecationWarningrrr!r)r*r:r;rrrrr sý
Ir c@seZdZejZdS)Ú_VisibleDeprecationTestCaseN)r.r<r=r)ZVisibleDeprecationWarningrrrrrr?‰sr?c@s4eZdZdZdZdd„Zdd„Zdd„Zd    d
„Zd S) ÚTestComparisonDeprecationsaPThis tests the deprecation, for non-element-wise comparison logic.
    This used to mean that when an error occurred during element-wise comparison
    (i.e. broadcasting) NotImplemented was returned, but also in the comparison
    itself, False was given instead of the error.
 
    Also test FutureWarning for the None comparison.
    z#elementwise.* comparison failed; .*cCs¨tjtjfD]–}|j|t d¡gfdtjddd}|j|||dd…fddtjdt dddg¡gtd}tjdt dddg¡gtd}|j|||fddq dS)    Né©r5zi,i©Údtypeéÿÿÿÿ©r5r2r"é)ÚoperatorÚeqÚner:r)ÚzerosÚarrayÚobject)rÚopÚaÚbrrrÚtest_normal_types˜sz,TestComparisonDeprecations.test_normal_typescsFt ddg¡‰t dddg¡}ttdd„ˆ|ƒtt‡fdd„ƒdS)NrOrPÚccSs||kSrr)ÚxÚyrrrÚ<lambda>©óz8TestComparisonDeprecations.test_string.<locals>.<lambda>csˆgkSrrr©rOrrrU®rV)r)rLrÚ FutureWarning)rrPrrWrÚ test_string¥sz&TestComparisonDeprecations.test_stringcs6Gdd„dƒ‰| ‡fdd„¡| ‡fdd„¡dS)Nc@seZdZdd„Zdd„ZdS)zNTestComparisonDeprecations.test_void_dtype_equality_failures.<locals>.NotArraycSst‚dSr)Ú    TypeErrorrrrrÚ    __array__²szXTestComparisonDeprecations.test_void_dtype_equality_failures.<locals>.NotArray.__array__cSstSr)ÚNotImplemented)rÚotherrrrÚ__ne__¶szUTestComparisonDeprecations.test_void_dtype_equality_failures.<locals>.NotArray.__ne__N)r.r<r=r[r^rrrrÚNotArray±sr_cst d¡ˆƒkS©NrG©r)Úaranger©r_rrrU¹rVzNTestComparisonDeprecations.test_void_dtype_equality_failures.<locals>.<lambda>cst d¡ˆƒkSr`rarrcrrrUºrV©r:rrrcrÚ!test_void_dtype_equality_failures°sz<TestComparisonDeprecations.test_void_dtype_equality_failuresc Csttdd„ƒttdd„ƒt ¡\t d¡tt d¡dk ƒtt d¡dkƒtt d¡dk ƒtt d¡dkƒW5QRXt     d¡t d¡fD]p}tj
ddd    }|dfD]T}t j t j t jt jfD]:}t ¡(}t d
¡tt|||ƒt| ƒW5QRXqÌq´qšdS) NcSst d¡dkS©NrGrOrarrrrrUÃrVzTTestComparisonDeprecations.test_array_richcompare_legacy_weirdness.<locals>.<lambda>cSst d¡dkSrfrarrrrrUÄrVr(rrOrGzi4,i4rCr)rrXrrrrr)rLÚint16ZasarrayrKrHÚltÚleÚgtÚgerrZ)rZarg1ÚstructZarg2ÚfÚlrrrÚ'test_array_richcompare_legacy_weirdness¼s 
 
 
 
zBTestComparisonDeprecations.test_array_richcompare_legacy_weirdnessN)    r.r<r=Ú__doc__rrQrYrerorrrrr@s    r@c@s2eZdZdZdd„Zejje dddd„ƒZ    dS)    ÚTestDatetime64Timezonea{Parsing of datetime64 with timezones deprecated in 1.11.0, because
    datetime64 is now timezone naive rather than UTC only.
 
    It will be quite a while before we can remove this, because, at the very
    least, a lot of existing code uses the 'Z' modifier to avoid conversion
    from local time to UTC, even if otherwise it handles time in a timezone
    naive fashion.
    cCs$|jtjdd|jtjdddS)N)z2000-01-01T00+01rB)z2000-01-01T00Z)r:r)Ú
datetime64rrrrrYàsz"TestDatetime64Timezone.test_stringz!The pytz module is not available.©ÚreasoncCs6t d¡}tjddddd|d}|jtj|fddS)Nz
US/EasterniÐr"r)ÚtzinforB)ÚpytzÚtimezoneÚdatetimer:r)rr)rÚtzÚdtrrrÚ test_datetimeäs
z$TestDatetime64Timezone.test_datetimeN)
r.r<r=rprYÚpytestÚmarkÚskipifÚ    _has_pytzr{rrrrrq×s 
ÿrqc@seZdZdZdd„ZdS)Ú+TestArrayDataAttributeAssignmentDeprecationaSAssigning the 'data' attribute of an ndarray is unsafe as pointed
     out in gh-7093. Eventually, such assignment should NOT be allowed, but
     in the interests of maintaining backwards compatibility, only a Deprecation-
     Warning will be raised instead for the time being to give developers time to
     refactor relevant code.
    cCs8t d¡}t ddd¡}d|_|j|jd|jfddS)Né
rr"zcAssigning the 'data' attribute is an inherently unsafe operation and will be removed in the future.ÚdatarB)r)rbZlinspacerr:Ú __setattr__r‚)rrOrPrrrÚtest_data_attr_assignmentôs
zETestArrayDataAttributeAssignmentDeprecation.test_data_attr_assignmentN)r.r<r=rpr„rrrrr€ìsr€c@s eZdZdZdd„Zdd„ZdS)Ú9TestBinaryReprInsufficientWidthParameterForRepresentationa«
    If a 'width' parameter is passed into ``binary_repr`` that is insufficient to
    represent the number in base 2 (positive) or 2's complement (negative) form,
    the function used to silently ignore the parameter and return a representation
    using the minimal number of bits needed for the form in question. Such behavior
    is now considered unsafe from a user perspective and will raise an error in the future.
    cCs(d}ddi}d|_|jtj||ddS)N)rÚwidthrGúQInsufficient bit width provided. This behavior will raise an error in the future.©r5r6©rr:r)Z binary_repr©rr5r6rrrÚ test_insufficient_width_positiveszZTestBinaryReprInsufficientWidthParameterForRepresentation.test_insufficient_width_positivecCs(d}ddi}d|_|jtj||ddS)N)éûÿÿÿr†rGr‡rˆr‰rŠrrrÚ test_insufficient_width_negativeszZTestBinaryReprInsufficientWidthParameterForRepresentation.test_insufficient_width_negativeN)r.r<r=rpr‹rrrrrr…þsr…c@seZdZdZdd„ZdS)Ú$TestDTypeAttributeIsDTypeDeprecationz.*`.dtype` attributecslGdd„dƒ‰Gdd„dtjƒ‰| ‡fdd„¡| ‡fdd„¡| ‡fdd„¡| ‡fd    d„¡dS)
Nc@seZdZdZdS)zZTestDTypeAttributeIsDTypeDeprecation.test_deprecation_dtype_attribute_is_dtype.<locals>.dtZf8N©r.r<r=rDrrrrrzsrzc@seZdZdZdS)z[TestDTypeAttributeIsDTypeDeprecation.test_deprecation_dtype_attribute_is_dtype.<locals>.vdtzf,fNrrrrrÚvdt srcs
t ˆ¡Sr©r)rDr©rzrrrU#rVz`TestDTypeAttributeIsDTypeDeprecation.test_deprecation_dtype_attribute_is_dtype.<locals>.<lambda>cs t ˆƒ¡Srr‘rr’rrrU$rVcs
t ˆ¡Srr‘r©rrrrU%rVcst ˆdƒ¡S©Nr"r‘rr“rrrU&rV)r)Zvoidr:rr)rzrrÚ)test_deprecation_dtype_attribute_is_dtypes zNTestDTypeAttributeIsDTypeDeprecation.test_deprecation_dtype_attribute_is_dtypeN)r.r<r=rr•rrrrrŽsrŽc@seZdZdd„ZdS)ÚTestTestDeprecatedcCs>tƒ}| ¡tt|jdd„ƒdd„}| |¡| ¡dS)NcSsdSrrrrrrrU/rVz;TestTestDeprecated.test_assert_deprecated.<locals>.<lambda>cSstjdtdddS)NÚfoorG)rÚ
stacklevel©rÚwarnr>rrrrr—1sz6TestTestDeprecated.test_assert_deprecated.<locals>.foo)r rrr-r:r!)rZtest_case_instancer—rrrÚtest_assert_deprecated*sþ
z)TestTestDeprecated.test_assert_deprecatedN)r.r<r=r›rrrrr–)sr–c@seZdZdZdd„ZdS)ÚTestNonNumericConjugatez‹
    Deprecate no-op behavior of ndarray.conjugate on non-numeric dtypes,
    which conflicts with the error behavior of np.conjugate.
    cCsht d¡t d¡fD]}| |j¡qt d¡t dd¡t ddtfdtfg¡fD]}| |j¡qRdS)    Néy@ÚsZ2016ÚM)r"rGrOrP)r)rLr;Ú    conjugateÚintr:)rrOrrrÚtest_conjugate=s ÿz&TestNonNumericConjugate.test_conjugateN)r.r<r=rpr¢rrrrrœ8srœc@seZdZdd„ZdS)Ú TestNPY_CHARcCs(ddlm}| |¡t|ƒdkƒdS)Nr)Únpy_char_deprecationZS1)Únumpy.core._multiarray_testsr¤r:r)rr¤rrrÚtest_npy_char_deprecationGs 
z&TestNPY_CHAR.test_npy_char_deprecationN)r.r<r=r¦rrrrr£Esr£c@seZdZdd„ZdS)ÚTestPyArray_AS1DcCsddlm}tt|ƒdS)Nr)Únpy_pyarrayas1d_deprecation)r¥r¨rÚNotImplementedError)rr¨rrrÚ test_npy_pyarrayas1d_deprecationNs z1TestPyArray_AS1D.test_npy_pyarrayas1d_deprecationN)r.r<r=rªrrrrr§Msr§c@seZdZdd„ZdS)ÚTestPyArray_AS2DcCsddlm}tt|ƒdS)Nr)Únpy_pyarrayas2d_deprecation)r¥r¬rr©)rr¬rrrÚ test_npy_pyarrayas2d_deprecationTs z1TestPyArray_AS2D.test_npy_pyarrayas2d_deprecationN)r.r<r=r­rrrrr«Ssr«c@seZdZdd„ZdS)ÚTestDatetimeEventcCsjtjtjfD]X}|j|dd|j|dd|j|dd|j|dd|j|dd|j|ddq dS)N)r")ÚmsrGrB)r")r¯rGr"N)r")r¯rGÚevent)r")r¯rGé?)r")r¯rGr"r°)r")r¯rGr"r±)r)rrZ timedelta64r;r:)rÚclsrrrÚ test_3_tuple[szTestDatetimeEvent.test_3_tupleN)r.r<r=r³rrrrr®Ysr®c@s eZdZdZdd„Zdd„ZdS)ÚTestTruthTestingEmptyArraysz..*truth value of an empty array is ambiguous.*cCs|jtt g¡fddS©NrB)r:Úboolr)rLrrrrÚtest_1dmsz#TestTruthTestingEmptyArrays.test_1dcCsF|jtt d¡fd|jtt d¡fd|jtt d¡fddS)N)r"rrB)rr"©rr)r:r¶r)rKrrrrÚtest_2dpsz#TestTruthTestingEmptyArrays.test_2dN)r.r<r=rr·r¹rrrrr´isr´c@seZdZdd„ZdS)Ú TestBincountcCs| dd„¡dS)NcSstjdddgddS)Nr"rGrA)Z    minlength)r)ZbincountrrrrrUyrVz6TestBincount.test_bincount_minlength.<locals>.<lambda>rdrrrrÚtest_bincount_minlengthxsz$TestBincount.test_bincount_minlengthN)r.r<r=r»rrrrrºvsrºc@seZdZdd„ZdS)ÚTestGeneratorSumcCs$|jtjdd„tdƒDƒfddS)Ncss|]
}|VqdSrr)r$ÚirrrÚ    <genexpr>€sz6TestGeneratorSum.test_generator_sum.<locals>.<genexpr>rrB)r:r)ÚsumÚrangerrrrÚtest_generator_sumsz#TestGeneratorSum.test_generator_sumN)r.r<r=rÁrrrrr¼}sr¼c@seZdZdd„ZdS)ÚTestPositiveOnNonNumericalcCs|jtjt d¡fddS)Nr—rB)r:rHÚposr)rLrrrrÚtest_positive_on_non_number…sz6TestPositiveOnNonNumerical.test_positive_on_non_numberN)r.r<r=rÄrrrrrƒsrÂc@seZdZdd„ZdS)ÚTestFromstringcCs|jtjdddS)N)zPrB)r:r)Ú
fromstringrrrrÚtest_fromstring‹szTestFromstring.test_fromstringN)r.r<r=rÇrrrrrʼnsrÅc@sDeZdZdZej dddg¡dd„ƒZej dddg¡dd„ƒZd    S)
Ú TestFromStringAndFileInvalidDataz+string or file could not be read to its endÚ invalid_strz ,invalid_dataZ invalid_sepc
sÈtjddddgtd}tjddœ‰|jˆdd    d
ˆ |¡ˆ d ¡| ‡fd d „¡ˆ d ¡| ‡fdd „¡t     
¡6t      dt ¡ˆ d ¡tj ˆddd}t||ƒW5QRXW5QRXdS)Nç)\Âõ(ø?rGç®Gáz @érCr%©Úmodeú,z%.2f)ÚsepÚformatrcstjˆddS©NrÏ)rЩr)Úfromfiler©rmrrrUrVzVTestFromStringAndFileInvalidData.test_deprecate_unparsable_data_file.<locals>.<lambda>cstjˆdddS©NrÏr©rÐÚcountrÓrrÕrrrUŸrVr(r×)r)rLÚfloatÚtempfileÚ TemporaryFileZtofileÚwriteÚseekr:rrÚ simplefilterr>rÔr©rrÉrSÚresrrÕrÚ#test_deprecate_unparsable_data_file”s
 
 
 
 
zDTestFromStringAndFileInvalidData.test_deprecate_unparsable_data_filec    sÔtjddddgtd}d |¡‰| ‡fdd„¡| ‡fd    d„¡ˆ d
¡‰| ‡fd d„¡ttƒ(tjˆd d d}t    |dd…|ƒW5QRXt
  ¡,t
  dt¡tjˆd dd}t    ||ƒW5QRXdS)NrÊrGrËrÌrCz1.51,2,3.51,4{}cstjˆddSrÒ©r)rÆr©Úx_strrrrU¬rVzSTestFromStringAndFileInvalidData.test_deprecate_unparsable_string.<locals>.<lambda>cstjˆdddSrÖrârrãrrrU­rVÚasciicstˆƒSrr    r)ÚbytestrrrrU²rVrÏrr×rEr() r)rLrÙrÑr:Úencoderr>rÆrrrrÞrßr)rærärÚ test_deprecate_unparsable_string§s
 
 
 
 zATestFromStringAndFileInvalidData.test_deprecate_unparsable_stringN)    r.r<r=rr|r}Ú parametrizerárèrrrrrȏs
 
rÈc@seZdZdd„ZdS)ÚTest_GetSet_NumericOpscCs>ddlm}|j|dd|jtjidtttjdddS)Nr)Úgetset_numericopsrG©r2)r6Úabc)Úadd)r¥rër:r)Zset_numeric_opsrÚ
ValueError)rrërrrÚtest_get_numeric_opsÅs z+Test_GetSet_NumericOps.test_get_numeric_opsN)r.r<r=rðrrrrrêÃsrêc@seZdZeZdd„ZdS)ÚTestShape1FieldscCs|jtjdtdfgfddS)NrOr"rB)r:r)rDr¡rrrrÚtest_shape_1_fieldsÓsz$TestShape1Fields.test_shape_1_fieldsN)r.r<r=rXrròrrrrrñÏsrñc@seZdZdd„ZdS)Ú TestNonZerocCs | dd„¡| dd„¡dS)NcSst t d¡¡S)Nr©r)ZnonzerorLrrrrrUÚrVz(TestNonZero.test_zerod.<locals>.<lambda>cSst t d¡¡Sr”rôrrrrrUÛrVrdrrrrÚ
test_zerodÙszTestNonZero.test_zerodN)r.r<r=rõrrrrró×sróc@s&eZdZe d¡Zdd„Zdd„ZdS)Ú TestToStringz0tostring() is deprecated. Use tobytes() instead.cCs$tjtdƒtjd}| |j¡dS©NstestÿrC)r)rLÚlistÚuint8r:Útostring)rÚarrrrrÚ test_tostringâszTestToString.test_tostringc    CsHtjtdƒtjd}| ¡}ttƒ| ¡}W5QRX||ksDt‚dSr÷)    r)rLrørùÚtobytesrr>rúr-)rrûrPržrrrÚtest_tostring_matches_tobytesæs
 
z*TestToString.test_tostring_matches_tobytesN)r.r<r=ÚreÚescaperrürþrrrrröÞs
röc
@sTeZdZdZejejejejej    ej
ej ej ej ejg
Zdd„Zdd„Zdd„ZdS)    ÚTestDTypeCoercionz(Converting .* to a dtype .*is deprecatedcCs"|jD]}|jtj|fdqdSrµ)Údeprecated_typesr:r)rD©rÚ scalar_typerrrÚtest_dtype_coercionús
z%TestDTypeCoercion.test_dtype_coercioncCs$|jD]}|jtjg|fdqdSrµ)rr:r)rLrrrrÚtest_array_constructionþs
z)TestDTypeCoercion.test_array_constructioncCsTtj ¡D] }|D]}|jtj|fdqq
ttttfD]}|jtj|fdq8dSrµ)    r)ZsctypesÚvaluesr;rDÚtypeÚdictrør,)rÚgrouprrrrÚtest_not_deprecateds
z%TestDTypeCoercion.test_not_deprecatedN)r.r<r=rr)ZgenericZflexibleÚnumberZinexactZfloatingZcomplexfloatingÚintegerZunsignedintegerZ signedintegerÚ    characterrrrr rrrrrîsú    rc @s\eZdZejejejgZejej    ej
ej ej ej ejejejejejg Zdd„Zdd„ZdS)ÚBuiltInRoundComplexDTypecCsP|jD]D}|dƒ}|jt|fd|jt|dfd|jt|fddidqdS©NrrBÚndigitsrˆ)rr:Úround©rrÚscalarrrrÚtest_deprecateds
 
z(BuiltInRoundComplexDType.test_deprecatedcCsP|jD]D}|dƒ}|jt|fd|jt|dfd|jt|fddidqdSr)Únot_deprecated_typesr;rrrrrr s
 
z,BuiltInRoundComplexDType.test_not_deprecatedN)r.r<r=r)ZcsingleZcdoubleZ clongdoublerZint8rgÚint32Úint64rùZuint16Zuint32Zuint64Úfloat16Úfloat32Úfloat64rrr rrrrr sýrc@sDeZdZdZej dddgfddgddgfg¡dd„ƒZdd„Zd    S)
Ú)TestIncorrectAdvancedIndexWithEmptyResultz7Out of bound index found. This was previously ignored.*ÚindexrArcCstt d¡}|j|j|fd|j|j|dfdt d¡}tddƒf|}|j|j|fd|j|j|dfddS)N)rGrGrrBç)rGrGr"r)r)Úonesr:Ú __getitem__Ú __setitem__Úslice)rrrûZarr2Úindex2rrrÚtest_empty_subspace)s
 
z=TestIncorrectAdvancedIndexWithEmptyResult.test_empty_subspacecCsJt d¡}dgdgggf}|j|j|fd|j|j|t d¡fddS)N)rGrGrGrArGrB)rGrrG)r)rr;r r!Úempty)rrûrrrrÚ)test_empty_index_broadcast_not_deprecated7s 
 ÿzSTestIncorrectAdvancedIndexWithEmptyResult.test_empty_index_broadcast_not_deprecatedN)    r.r<r=rr|r}rér$r&rrrrr%s"
rc@seZdZdd„ZdS)ÚTestNonExactMatchDeprecationcsBt dddgdddgg¡‰| ‡fdd„¡| ‡fdd„¡dS)    NrAérÌrr"cstjˆdddS)N)ér(ZCilprÍ)r)Zravel_multi_indexr©rûrrrUErVzCTestNonExactMatchDeprecation.test_non_exact_match.<locals>.<lambda>cstjˆddddS)NrrÌÚRandom)Zside)r)Z searchsortedrr*rrrUGrV)r)rLr:rrr*rÚtest_non_exact_matchBsz1TestNonExactMatchDeprecation.test_non_exact_matchN)r.r<r=r,rrrrr'@sr'c@seZdZdZdd„ZdS)ÚTestMatrixInOuterzCadd.outer\(\) was passed a numpy matrix as (first|second) argument.cCs†t dddg¡}t dddg¡ tj¡}|jtjj||fdd|jtjj||fd|jtjj||fd|jtjj||fddS)Nr"rGrArFrB)r)rLÚviewZmatrixr:rîÚouterr;)rrûÚmrrrrOs z!TestMatrixInOuter.test_deprecatedN©r.r<r=rrrrrrr-Jsr-c@s eZdZdZdd„Zdd„ZdS)ÚFlatteningConcatenateUnsafeCastz7concatenate with `axis=None` will use same-kind castingc    Cs4|jtjdgdgfftdtjdtjddddS)Nrçð?rGrC)ÚaxisÚoutrˆ)r:r)Ú concatenater    r%rrrrrr\s þz/FlatteningConcatenateUnsafeCast.test_deprecatedc    Csl|jtjdgdgffdtjdtjdddœdttƒ*tjdgdgftjdtjddd    W5QRXdS)
Nrr3rGrCÚunsafe)r4r5ÚcastingrˆZ    same_kind)r5r8)r;r)r6r%rrrZrrrrr as ÿþ
ÿz3FlatteningConcatenateUnsafeCast.test_not_deprecatedN)r.r<r=rrr rrrrr2Xsr2c@s$eZdZeZdZdd„Zdd„ZdS)Ú-TestDeprecateSubarrayDTypeDuringArrayCoercionz6(creating|casting) an array (with|to) a subarray dtypec    søt ddg¡‰| ‡fdd„¡t t¡ˆ d¡}W5QRXt|ddgddggƒ| ‡fdd„¡t t¡tjˆdd}W5QRXt|ddgddggƒt t¡tjdd    gˆgdd}W5QRXt|ddgddggddgddgggƒdS)
Nr"rGcs
ˆ d¡S)Nú(2)i,)Úastyperr*rrrUurVzUTestDeprecateSubarrayDTypeDuringArrayCoercion.test_deprecated_array.<locals>.<lambda>r:cstjˆddS)Nr:rC©r)rLrr*rrrU{rVrC)r")rG)r)rLr:r|ÚwarnsrXr;r)rràrr*rÚtest_deprecated_arrayqs    zCTestDeprecateSubarrayDTypeDuringArrayCoercion.test_deprecated_arraycsBt d¡ dd¡‰‡fdd„}| |¡‡fdd„}| |¡dS)NrrrGc    s$t t¡ˆ d¡W5QRXdS)Nú(2,2)f)r|Úraisesrïr;rr*rrÚcheckŠs zVTestDeprecateSubarrayDTypeDuringArrayCoercion.test_deprecated_and_error.<locals>.checkc    s(t t¡tjˆddW5QRXdS)Nr?rC)r|r@rïr)rLrr*rrrAs )r)rbZreshaper:)rrArr*rÚtest_deprecated_and_error†s
 
 zGTestDeprecateSubarrayDTypeDuringArrayCoercion.test_deprecated_and_errorN)r.r<r=rXrrr>rBrrrrr9msr9c@s eZdZeZdZej ddddg¡dd„ƒZ    ej ddddg¡dd    „ƒZ
ej ddddg¡d
d „ƒZ ej ddddg¡d d „ƒZ ej ddddg¡dd„ƒZ dS)Ú%TestFutureWarningArrayLikeNotIterablez,The input object of type.*but not a sequenceÚprotocolr[Z__array_interface__Z__array_struct__cs6t d¡}tdd|t||ƒiƒ‰| ‡fdd„¡dS)a…Test that these objects give a warning since they are not 0-D,
        not coerced at the top level `np.array(obj)`, but nested, and do
        *not* define the sequence protocol.
 
        NOTE: Tests for the versions including __len__ and __getitem__ exist
              in `test_array_coercion.py` and they can be modified or amended
              when this deprecation expired.
        rÚMyArrrcstjˆƒgtdS©NrC©r)rLrMr©rErrrU©rVzGTestFutureWarningArrayLikeNotIterable.test_deprecated.<locals>.<lambda>N)r)rbrÚgetattrr:)rrDÚ    blueprintrrHrrœs
z5TestFutureWarningArrayLikeNotIterable.test_deprecatedcslt d¡}tdd|t||ƒiƒ}|ƒ‰| ‡fdd„¡tjˆgtd}tjdtd}ˆ|d<t||ƒdS)    Nr3rErcstjˆgtdSrFrGr©ÚmyarrrrrU´rVzNTestFutureWarningArrayLikeNotIterable.test_0d_not_deprecated.<locals>.<lambda>rCr"r)r)rLrrIr;rMr%r)rrDrJrEràÚexpectedrrKrÚtest_0d_not_deprecated«s
z<TestFutureWarningArrayLikeNotIterable.test_0d_not_deprecatedcsPt d¡}tdd|t||ƒiƒ}|ƒ‰| ‡fdd„¡t ˆ¡}t||ƒdS)NrrErcs
t ˆ¡Srr<rrKrrrUÁrVzTTestFutureWarningArrayLikeNotIterable.test_unnested_not_deprecated.<locals>.<lambda>)r)rbrrIr;rLr)rrDrJrEràrrKrÚtest_unnested_not_deprecatedºs 
 
zBTestFutureWarningArrayLikeNotIterable.test_unnested_not_deprecatedc    CsŽt d¡ d¡}tdd|t||ƒddd„iƒ}|ƒ}tjt|jdt     |gg¡}W5QRX|j
d    kslt ‚|j dkszt ‚|d
d ksŠt ‚d S) zˆThe old code would actually use the dtype from the array, but
        then end up not using the array (for dimension discovery)
        rÚf4rErÚ    __float__cSsdS©Nçà?r©Ú_rrrrUÍrVzSTestFutureWarningArrayLikeNotIterable.test_strange_dtype_handling.<locals>.<lambda>©Úmatch)r"r"r¸rSN) r)rbr;rrIr|r=rXrrLÚshaper-rD)rrDrJrErLràrrrÚtest_strange_dtype_handlingÅsÿzATestFutureWarningArrayLikeNotIterable.test_strange_dtype_handlingcsŽt d¡ d¡}tdd|t||ƒddd„iƒ}|ƒ‰tjdtd    ‰‡‡fd
d „}| |¡ˆd ˆksjt‚ˆd ˆkszt‚ˆdˆksŠt‚dS)NrrPrErrQcSsdSrRrrTrrrrUárVzVTestFutureWarningArrayLikeNotIterable.test_assignment_not_deprecated.<locals>.<lambda>rArCcsˆˆˆgˆdd…<dSrrr©rLràrrÚsetåszQTestFutureWarningArrayLikeNotIterable.test_assignment_not_deprecated.<locals>.setrr"rG)    r)rbr;rrIr%rMr;r-)rrDrJrEr[rrZrÚtest_assignment_not_deprecatedØsÿ
zDTestFutureWarningArrayLikeNotIterable.test_assignment_not_deprecatedN)r.r<r=rXrrr|r}rérrNrOrYr\rrrrrC—s,ÿ
ÿ
ÿ
    ÿ
ÿrCc@seZdZdZdZdd„ZdS)Ú"TestDeprecatedUnpickleObjectScalarzÇ
    Technically, it should be impossible to create numpy object scalars,
    but there was an unpickle path that would in theory allow it. That
    path is invalid and must lead to the warning.
    z4Unpickling a scalar with object dtype is deprecated.cs tjjj‰| ‡fdd„¡dS)Ncsˆt d¡dƒS)NÚOr"r‘r©ZctorrrrUørVzDTestDeprecatedUnpickleObjectScalar.test_deprecated.<locals>.<lambda>)r)ÚcoreZ
multiarrayrr:rrr_rrös
z2TestDeprecatedUnpickleObjectScalar.test_deprecatedN)r.r<r=rprrrrrrr]ísr]rz
Needs nosersc@s\eZdZGdd„deƒZdd„Zdd„Zdd„Zd    d
„Zd d „Z    d d„Z
dd„Z dd„Z dS)ÚTestNoseDecoratorsDeprecatedc@s eZdZdS)z/TestNoseDecoratorsDeprecated.DidntSkipExceptionN)r.r<r=rrrrÚDidntSkipExceptionsrbcCsdd„}| |¡dS)NcSs tjjjdd„ƒ}t|jƒdS)NcSsdSrr)rSrTÚzrrrÚ    slow_func szMTestNoseDecoratorsDeprecated.test_slow.<locals>._test_slow.<locals>.slow_func)r)ÚtestingÚdecZslowr)rdrrrÚ
_test_slow
s
z:TestNoseDecoratorsDeprecated.test_slow.<locals>._test_slowrd)rrgrrrÚ    test_slow    sz&TestNoseDecoratorsDeprecated.test_slowcCsdd„}|j|dddS)NcSsdtjj ¡dd„ƒ}tjj d¡dd„ƒ}tjj d¡dd„ƒ}t|jƒt|jƒt|j ƒdS)    NcSsdSrrrWrrrÚ    f_defaultszWTestNoseDecoratorsDeprecated.test_setastest.<locals>._test_setastest.<locals>.f_defaultTcSsdSrrrWrrrÚf_istestszVTestNoseDecoratorsDeprecated.test_setastest.<locals>._test_setastest.<locals>.f_istestFcSsdSrrrWrrrÚ f_isnottestszYTestNoseDecoratorsDeprecated.test_setastest.<locals>._test_setastest.<locals>.f_isnottest)r)rerfZ    setastestrZ__test__)rirjrkrrrÚ_test_setastests
 
 
 
 
 
zDTestNoseDecoratorsDeprecated.test_setastest.<locals>._test_setastestrArìrd)rrlrrrÚtest_setastestsz+TestNoseDecoratorsDeprecated.test_setastestcs‡fdd„}ˆj|dddS)Ncs¼tjj d¡‡fdd„ƒ}z |dƒWn4ˆjk
rDtdƒ‚Yntƒjk
rZYnXtjj d¡‡fdd„ƒ}z |dƒWn4ˆjk
r˜Yn tƒjk
r¶td    ƒ‚YnXdS)
NTcs
ˆj‚dSr©rb©rSrrrÚf1'sznTestNoseDecoratorsDeprecated.test_skip_functions_hardcoded.<locals>._test_skip_functions_hardcoded.<locals>.f1rOúFailed to skipFcs
ˆj‚dSrrnrorrrÚf22sznTestNoseDecoratorsDeprecated.test_skip_functions_hardcoded.<locals>._test_skip_functions_hardcoded.<locals>.f2úSkipped when not expected to©r)rerfr~rbr+rÚ    __class__)rprrrrrÚ_test_skip_functions_hardcoded&s      zbTestNoseDecoratorsDeprecated.test_skip_functions_hardcoded.<locals>._test_skip_functions_hardcodedrGrìrd)rrvrrrÚtest_skip_functions_hardcoded%s z:TestNoseDecoratorsDeprecated.test_skip_functions_hardcodedcs‡fdd„}ˆj|dddS)NcsЇfdd„}tjj |¡‡fdd„ƒ}zd‰|dƒWn4ˆjk
rTtdƒ‚Yntƒjk
rjYnXtjj |¡‡fdd    „ƒ}zd
‰|dƒWn4ˆjk
r¬Yn tƒjk
rÊtd ƒ‚YnXdS) NcsˆdkS©Núskip me!rr©Z    skip_flagrrÚ skip_tester@szuTestNoseDecoratorsDeprecated.test_skip_functions_callable.<locals>._test_skip_functions_callable.<locals>.skip_testercs
ˆj‚dSrrnrorrrrpCszlTestNoseDecoratorsDeprecated.test_skip_functions_callable.<locals>._test_skip_functions_callable.<locals>.f1ryrOrqcs
ˆj‚dSrrnrorrrrrOszlTestNoseDecoratorsDeprecated.test_skip_functions_callable.<locals>._test_skip_functions_callable.<locals>.f2zfive is right out!rsrt)r{rprrrrzrÚ_test_skip_functions_callable?s&      z`TestNoseDecoratorsDeprecated.test_skip_functions_callable.<locals>._test_skip_functions_callablerGrìrd)rr|rrrÚtest_skip_functions_callable>s z9TestNoseDecoratorsDeprecated.test_skip_functions_callablecs‡fdd„}ˆj|dddS)Ncs´tjj dd¡dd„ƒ}z|dƒD]}q"Wntƒjk
rBYn
Xtdƒ‚tjj dd¡‡fd    d
„ƒ}z|dƒD]}qrWn4tƒjk
rštd ƒ‚Ynˆjk
r®YnXdS) NTúThis test is known to failcsst|ƒEdHdSr©rÀrorrrÚg1^szpTestNoseDecoratorsDeprecated.test_skip_generators_hardcoded.<locals>._test_skip_generators_hardcoded.<locals>.g1rúFailed to mark as known failureFúThis test is NOT known to failc3st|ƒEdHˆ d¡‚dS©NÚFAIL©rÀrbrorrrÚg2jszpTestNoseDecoratorsDeprecated.test_skip_generators_hardcoded.<locals>._test_skip_generators_hardcoded.<locals>.g2ú#Marked incorrectly as known failure©r)rerfZknownfailureifrrur+rb)r€Újr†rrrÚ_test_skip_generators_hardcoded]s"
   zdTestNoseDecoratorsDeprecated.test_skip_generators_hardcoded.<locals>._test_skip_generators_hardcodedrGrìrd)rrŠrrrÚtest_skip_generators_hardcoded\s z;TestNoseDecoratorsDeprecated.test_skip_generators_hardcodedcs‡fdd„}ˆj|dddS)Ncsȇfdd„}tjj |d¡dd„ƒ}zd‰|dƒD]}q2Wntƒjk
rRYn
Xtdƒ‚tjj |d    ¡‡fd
d „ƒ}zd ‰|dƒD]}q†Wn4tƒjk
r®td ƒ‚Ynˆjk
rÂYnXdS)NcsˆdkSrxrrrzrrr{zszwTestNoseDecoratorsDeprecated.test_skip_generators_callable.<locals>._test_skip_generators_callable.<locals>.skip_testerr~csst|ƒEdHdSrrrorrrr€}sznTestNoseDecoratorsDeprecated.test_skip_generators_callable.<locals>._test_skip_generators_callable.<locals>.g1ryrrr‚c3st|ƒEdHˆ d¡‚dSrƒr…rorrrr†ŠsznTestNoseDecoratorsDeprecated.test_skip_generators_callable.<locals>._test_skip_generators_callable.<locals>.g2z do not skipr‡rˆ)r{r€r‰r†rrzrÚ_test_skip_generators_callableys( 
   zbTestNoseDecoratorsDeprecated.test_skip_generators_callable.<locals>._test_skip_generators_callablerGrìrd)rrŒrrrÚtest_skip_generators_callablexs z:TestNoseDecoratorsDeprecated.test_skip_generators_callablecCsdd„}|j|dddS)Nc    Ssœtjj d¡dd„ƒ}tjj ¡dd„ƒ}tjj ¡dd„ƒ}tjj ¡dd    „ƒ}tt|ƒ|ƒtjdd
$t d ¡tt    |ƒtt|ƒW5QRXdS) NTcSsdSrrrrrrÚnon_deprecated_func›szcTestNoseDecoratorsDeprecated.test_deprecated.<locals>._test_deprecated.<locals>.non_deprecated_funccSsddl}|jdtdddS)NrzTEST: deprecated funcr"©r˜r™©rrrrÚdeprecated_funcŸsz_TestNoseDecoratorsDeprecated.test_deprecated.<locals>._test_deprecated.<locals>.deprecated_funccSsddl}|jdddt‚dS©NrZAHHHHr"r)rršrïrrrrÚdeprecated_func2¤sz`TestNoseDecoratorsDeprecated.test_deprecated.<locals>._test_deprecated.<locals>.deprecated_func2cSsddl}|jddddSr’)rršrrrrÚdeprecated_func3ªsz`TestNoseDecoratorsDeprecated.test_deprecated.<locals>._test_deprecated.<locals>.deprecated_func3r r)
r)rerfÚ
deprecatedrr-rrrÞrï)rŽr‘r“r”rrrÚ_test_deprecatedšs 
 
 
 
 
 
 
 
 
 
zFTestNoseDecoratorsDeprecated.test_deprecated.<locals>._test_deprecatedrÌrìrd)rr–rrrr™sz,TestNoseDecoratorsDeprecated.test_deprecatedcCsdd„}| |¡dS)NcSsZtjj ddddg¡dd„ƒ}d}|ƒD] }|d|dd…Ž|d7}q(t|d    kƒdS)
Nzbase, power, expected)r"r"r")rGr"rG)rGrGrÌcSst|||kƒdSr)r)ÚbaseÚpowerrMrrrÚcheck_parametrizeÀszcTestNoseDecoratorsDeprecated.test_parametrize.<locals>._test_parametrize.<locals>.check_parametrizerr"rA)r)rerfrér)r™rØÚtestrrrÚ_test_parametrize¼s
þÿ
 
 
zHTestNoseDecoratorsDeprecated.test_parametrize.<locals>._test_parametrizerd)rr›rrrÚtest_parametrize»sz-TestNoseDecoratorsDeprecated.test_parametrizeN) r.r<r=r+rbrhrmrwr}r‹rrrœrrrrras    !"rac@seZdZdZdd„ZdS)ÚTestSingleElementSignaturezThe use of a length 1cCs | dd„¡| dd„¡dS)NcSstjddddS)Nr"rGÚd)Ú    signature)r)rîrrrrrUÔrVz<TestSingleElementSignature.test_deprecated.<locals>.<lambda>cSstjddt d¡fdS)Nr"rGrn)Úsig)r)rîrDrrrrrUÕrVrdrrrrrÓsz*TestSingleElementSignature.test_deprecatedNr1rrrrrÏsrc@sjeZdZeZe dg¡jZej     
dddddg¡e ddœd    d
„ƒZ ej     
dd d d dg¡e ddœdd„ƒZ dS)ÚTestCtypesGetterr"ÚnameÚget_dataZ    get_shapeZ get_stridesZget_as_parameterN)r¢Úreturncs"t|j|ƒ‰| ‡fdd„¡dS)NcsˆƒSrrr©ÚfuncrrrUârVz2TestCtypesGetter.test_deprecated.<locals>.<lambda>)rIÚctypesr:©rr¢rr¥rrÝs z TestCtypesGetter.test_deprecatedr‚rXÚstridesZ_as_parameter_csˆ ‡‡fdd„¡dS)Ncs tˆjˆƒSr)rIr§r©r¢rrrrUèrVz6TestCtypesGetter.test_not_deprecated.<locals>.<lambda>©r;r¨rrªrr äsz$TestCtypesGetter.test_not_deprecated)r.r<r=r>rr)rLr§r|r}rér#rr rrrrr¡Øs
ÿ
ÿr¡rcCst t d¡|¡S©Nr)r)Ú    partitionrb©ZkthrrrrUîrVrUcCst t d¡|¡Sr¬)r)Ú argpartitionrbr®rrrrUïrV)zpartition methodzargpartition methodzpartition functionzargpartition functionr¦)Úidsc@s$eZdZeZdZdd„Zdd„ZdS)ÚTestPartitionBoolIndexz1Passing booleans as partition index is deprecatedcs(| ‡fdd„¡| ‡fdd„¡dS)NcsˆdƒS)NTrrr¥rrrUúrVz8TestPartitionBoolIndex.test_deprecated.<locals>.<lambda>cs ˆddgƒS)NFTrrr¥rrrUûrVrd©rr¦rr¥rrùsz&TestPartitionBoolIndex.test_deprecatedcs(| ‡fdd„¡| ‡fdd„¡dS)NcsˆdƒSr”rrr¥rrrUþrVz<TestPartitionBoolIndex.test_not_deprecated.<locals>.<lambda>cs ˆddgƒS)Nrr"rrr¥rrrUÿrVr«r²rr¥rr ýsz*TestPartitionBoolIndex.test_not_deprecatedN)r.r<r=r>rrrr rrrrr±ósr±c@s eZdZeZdd„Zdd„ZdS)Ú
TestMachArcCs| dd„¡dS)NcSs ttjdƒS©NZmachar)rIr)r`rrrrrUrVz3TestMachAr.test_deprecated_module.<locals>.<lambda>rdrrrrÚtest_deprecated_modulesz!TestMachAr.test_deprecated_modulecs t t¡‰| ‡fdd„¡dS)Ncs
tˆdƒSr´)rIr©ÚfinforrrU rVz1TestMachAr.test_deprecated_attr.<locals>.<lambda>)r)r·rÙr:rrr¶rÚtest_deprecated_attr    s
zTestMachAr.test_deprecated_attrN)r.r<r=r>rrµr¸rrrrr³sr³c@sXeZdZej dejejej    ej
g¡dd„ƒZ ej dejejej    ej
g¡dd„ƒZ dS)Ú$TestQuantileInterpolationDeprecationr¦cs(| ‡fdd„¡| ‡fdd„¡dS)NcsˆddgdddS)Nrr3Zlinear©Ú interpolationrrr¥rrrUrVzFTestQuantileInterpolationDeprecation.test_deprecated.<locals>.<lambda>csˆddgdddS)Nrr3Únearestrºrrr¥rrrUrVrdr²rr¥rrs 
ÿ
ÿz4TestQuantileInterpolationDeprecation.test_deprecatedc
CsNt ¡<t dt¡t t¡|ddgddddW5QRXW5QRXdS)Nrrr3r¼)r»Úmethod)rrrÞr>r|r@rZr²rrrÚtest_both_passeds
  z5TestQuantileInterpolationDeprecation.test_both_passedN) r.r<r=r|r}rér)Z
percentileZquantileZ nanpercentileZ nanquantilerr¾rrrrr¹sÿ
ÿr¹c@seZdZdd„ZdS)ÚTestMemEventHookc    Cslddlmm}tjtdd| ¡W5QRXt d¡}~t    ƒtjtdd| 
¡W5QRXdS)Nrz$PyDataMem_SetEventHook is deprecatedrViè) r¥r`Z_multiarray_testsr|r=r>Z!test_pydatamem_seteventhook_startr)rKrZtest_pydatamem_seteventhook_end)rZma_testsrOrrrÚtest_mem_seteventhook$sÿ
ÿz&TestMemEventHook.test_mem_seteventhookN)r.r<r=rÀrrrrr¿"sr¿c@seZdZdZdd„ZdS)ÚTestArrayFinalizeNonez!Setting __array_finalize__ = Nonecs(Gdd„dtjƒ‰| ‡fdd„¡dS)Nc@seZdZdZdS)zETestArrayFinalizeNone.test_use_none_is_deprecated.<locals>.NoFinalizeN)r.r<r=Z__array_finalize__rrrrÚ
NoFinalize:srÂcst d¡ ˆ¡Sr”)r)rLr.r©rÂrrrU=rVzCTestArrayFinalizeNone.test_use_none_is_deprecated.<locals>.<lambda>)r)Zndarrayr:rrrÃrÚtest_use_none_is_deprecated8sz1TestArrayFinalizeNone.test_use_none_is_deprecatedN)r.r<r=rrÄrrrrrÁ5srÁc@seZdZdZdd„ZdS)ÚTestAxisNotMAXDIMSz)Using `axis=32` \(MAXDIMS\) is deprecatedcs t d¡‰| ‡fdd„¡dS)N) r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"r"cstjˆdtjdS)Nr")r4)r)ÚrepeatZMAXDIMSrrWrrrUErVz4TestAxisNotMAXDIMS.test_deprecated.<locals>.<lambda>)r)rKr:rrrWrrCs
z"TestAxisNotMAXDIMS.test_deprecatedNr1rrrrrÅ?srÅc@sHeZdZdZej dejd¡dd„ƒZ    ej dejd¡dd„ƒZ
dS)    ÚTestLoadtxtParseIntsViaFloatz;loadtxt\(\): Parsing an integer via a float is deprecated.*rDÚ
AllIntegerc    Cs0tjt|jdtjdg|dW5QRXdS)NrVú10.5rC)r|r=r>rr)Úloadtxt)rrDrrrÚtest_deprecated_warningQsz4TestLoadtxtParseIntsViaFloat.test_deprecated_warningc Cslt ¡Zt dt¡ztjdg|dWn2tk
r\}zt|jtƒsLt    ‚W5d}~XYnXW5QRXdS)Nr(rÉrC)
rrrÞr>r)rÊrïÚ
isinstanceÚ    __cause__r-)rrDÚerrrÚtest_deprecated_raisedVs 
 z3TestLoadtxtParseIntsViaFloat.test_deprecated_raisedN) r.r<r=rr|r}rér)Ú    typecodesrËrÏrrrrrÇHs
 
rÇc@s,eZdZdZej dejd¡dd„ƒZ    dS)ÚTestPyIntConversionz,.*stop allowing conversion of out-of-bound.*rDrÈc    s t ˆ¡‰t ˆ¡‰dd„}dd„}dd„}|||fD]d‰z| ‡‡‡fdd„¡Wntk
rhYnXz| ‡‡‡fd    d„¡Wq6tk
r˜Yq6Xq6dS)
NcSs| |¡dSr)r©ÚvaluerDrrrrksz:TestPyIntConversion.test_deprecated_scalar.<locals>.scalarcSs tjdddg|d}||d<dS)NrrCrGr<)rÓrDrûrrrÚassignnsz:TestPyIntConversion.test_deprecated_scalar.<locals>.assigncSstj|g|ddSrFr<rÒrrrÚcreatersz:TestPyIntConversion.test_deprecated_scalar.<locals>.createcsˆˆjdˆƒSr”)Úminr©Z creation_funcrDÚinforrrUxrVz<TestPyIntConversion.test_deprecated_scalar.<locals>.<lambda>csˆˆjdˆƒSr”)Úmaxrr×rrrU~rV)r)rDZiinfor:Ú OverflowError)rrDrrÔrÕrr×rÚtest_deprecated_scalards$
 
ÿÿz*TestPyIntConversion.test_deprecated_scalarN)
r.r<r=rr|r}rér)rÐrÛrrrrrÑasrÑc@seZdZdd„ZdS)ÚTestDeprecatedGlobalscCsX| dd„¡| dd„¡| dd„¡| dd„¡| dd„¡| dd„¡dS)NcSstjSr)r)Zbool8rrrrrU‡rVz9TestDeprecatedGlobals.test_type_aliases.<locals>.<lambda>cSstjSr)r)Zint0rrrrrUˆrVcSstjSr)r)Zuint0rrrrrU‰rVcSstjSr)r)Zbytes0rrrrrUŠrVcSstjSr)r)Zstr0rrrrrU‹rVcSstjSr)r)Zobject0rrrrrUŒrVrdrrrrÚtest_type_aliases…s z'TestDeprecatedGlobals.test_type_aliasesN)r.r<r=rÝrrrrr܃srÜr¢r¶ÚlongZulongr#ÚbytesrMc    CsV|ttƒkst‚tjtd|›dtt|ƒr4t‚W5QRXt |¡|tjkdS)NzIn the future .*rV)    Údirr)r-r|r=rXÚhasattrrDZ
sctypeDict)r¢rrrÚtest_future_scalar_attributessÿ
râz"ignore:In the future:FutureWarningc    @s.eZdZej dddddddg¡dd    „ƒZd
S) ÚTestRemovedGlobalsr¢rMr¶rÙÚcomplexr#r¡c    Cs4d|›d}tjt|dtt|ƒW5QRXdS)Nz.*
`np.z(` was a deprecated alias for the builtinrV)r|r@ÚAttributeErrorrIr))rr¢r8rrrÚ!test_attributeerror_includes_info¤s z4TestRemovedGlobals.test_attributeerror_includes_infoN)r.r<r=r|r}rérærrrrrãžsÿrã)RrprxrHrr|rÚrÿÚsysÚnumpyr)Z numpy.testingrrrrrrrr¥r
rvrÚ ImportErrorr r?r@rqr€r…rŽr–rœr£r§r«r®r´rºr¼rÂrÅrÈrêrñrórörrrr'r-r2r9rCr]rrÞZnoseZ    HAVE_NOSEr}r~rarr¡rbr­r¯ZPARTITION_DICTrérr±r³r¹r¿rÁrÅrÇrÑrÜrârrãrrrrÚ<module>s $ 
lJ  4 
*V 
 
 
K    
 
ü 
    " ÿ