ó É9Zc@`s{dZddlmZmZmZddlZddlZddlZddlZddl Z ddl m Z m Z mZmZmZmZmZyddlZeZWnek rÁeZnXdefd„ƒYZdefd„ƒYZd efd „ƒYZd efd „ƒYZd efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ defd„ƒYZ!defd„ƒYZ"defd„ƒYZ#defd„ƒYZ$defd„ƒYZ%dd,d „ƒYZ&d!efd"„ƒYZ'd#efd$„ƒYZ(d%efd&„ƒYZ)d'efd(„ƒYZ*d)efd*„ƒYZ+e,d+krwe ƒndS(-s‡ Tests related to deprecation warnings. Also a convenient place to document how deprecations should eventually be turned into errors. i(tdivisiontabsolute_importtprint_functionN(trun_module_suitet assert_raisest assert_warnstassert_no_warningstassert_array_equaltassert_tdect_VisibleDeprecationTestCasecB`sPeZdZd„Zd„Zdeeejfdid„Zdid„Z RS(tcC`s`tjdtƒ|_|jjƒ|_tjddtjƒtjdd|j dtjƒdS(Ntrecordtalwaystcategorytmessage( twarningstcatch_warningstTruetwarn_ctxt __enter__tlogtfilterwarningstnptVisibleDeprecationWarningR(tself((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pytsetUps cC`s|jjƒdS(N(Rt__exit__(R((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttearDown,sic C`sœg|j(y|||ŽWn |r+tntƒk r=nXd}xO|jD]D} | jtjkrs|d7}qN|sNtd| jfƒ‚qNqNW|d k r||krdt|jƒ|f} g|jD]} | j^qÑ} tdj | g| ƒƒ‚nt j ƒ…t j dd|j dtjƒy/|||Ž|tƒkr_td ƒ‚nWn/|k r‘|tƒkr’td ƒ‚q’nXWd QXd S( sTest if VisibleDeprecationWarnings are given and raised. This first checks if the function when called gives `num` VisibleDeprecationWarnings, after that it tries to raise these VisibleDeprecationWarnings 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 ---------- f : callable The function to test num : int Number of VisibleDeprecationWarnings to expect. This should normally be 1. ignore_other : 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 successfull. args : tuple Arguments for `f` kwargs : dict Keyword arguments for `f` iis'expected DeprecationWarning but got: %ss"%i warnings found but %i expected.s terrorRRs$No error raised during function calls!Error raised during function callN(Rt ExceptionttupleRRRtAssertionErrortNonetlentjoinRRRR( Rtfunctiontnumt ignore_otherstfunction_failst exceptionstargstkwargst num_foundtwarningtmsgtwtlst((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pytassert_deprecated/s:#      c C`s2|j|dddtdtƒd|d|ƒdS(sóTest if VisibleDeprecationWarnings are given and raised. This is just a shorthand for: self.assert_deprecated(function, num=0, ignore_others=True, exceptions=tuple(), args=args, kwargs=kwargs) R%iR&R(R)R*N(R0RR(RR$R)R*((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pytassert_not_deprecatedts((( t__name__t __module__RRRtFalseRRR0R1(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR s   Bt_DeprecationTestCasecB`sMeZdZd„Zd„Zdeeefdid„Zdid„ZRS(R cC`sZtjdtƒ|_|jjƒ|_tjddtƒtjdd|jdtƒdS(NR R RR( RRRRRRRtDeprecationWarningR(R((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR…s cC`s|jjƒdS(N(RR(R((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR“sic C`s–g|j(y|||ŽWn |r+tntƒk r=nXd}xL|jD]A} | jtkrp|d7}qN|sNtd| jfƒ‚qNqNW|d k r||krdt|jƒ|f} g|jD]} | j^qÎ} tdj| g| ƒƒ‚nt j ƒ‚t j dd|j dtƒy/|||Ž|tƒkrYtd ƒ‚nWn/|k r‹|tƒkrŒtd ƒ‚qŒnXWd QXd S( sæ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 ---------- f : callable The function to test num : int Number of DeprecationWarnings to expect. This should normally be 1. ignore_other : 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 successfull. args : tuple Arguments for `f` kwargs : dict Keyword arguments for `f` iis'expected DeprecationWarning but got: %ss"%i warnings found but %i expected.s RRRs$No error raised during function calls!Error raised during function callN( RRRRR6R R!R"R#RRRR( RR$R%R&R'R(R)R*R+R,R-R.R/((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR0–s:!     c C`s2|j|dddtdtƒd|d|ƒdS(sìTest if DeprecationWarnings are given and raised. This is just a shorthand for: self.assert_deprecated(function, num=0, ignore_others=True, exceptions=tuple(), args=args, kwargs=kwargs) R%iR&R(R)R*N(R0RR(RR$R)R*((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR1Ùs((( R2R3RRRR4R6R0R1(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR5€s  At&TestFloatNonIntegerArgumentDeprecationcB`sSeZdZdZd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( sÉ These test that ``DeprecationWarning`` is given when you try to use non-integers as arguments to for indexing and slicing e.g. ``a[0.0:5]`` and ``a[0.5]``, or other functions like ``array.reshape(1., -1)``. After deprecation, changes need to be done inside conversion_utils.c in PyArray_PyIntAsIntp and possibly PyArray_IntpConverter. In iterators.c the function slice_GetIndices could be removed in favor of its python equivalent and in mapping.c the function _tuple_of_integers can be simplified (if ``np.array([1]).__index__()`` is also deprecated). As for the deprecation time-frame: via Ralf Gommers, "Hard to put that as a version number, since we don't know if the version after 1.8 will be 6 months or 2 years after. I'd say 2 years is reasonable." I interpret this to mean 2 years after the 1.8 release. Possibly giving a PendingDeprecationWarning before that (which is visible by default) sVusing a non-integer number instead of an integer will result in an error in the futurec`sÙtjdgggƒ‰‡fd†}|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd †ƒ|‡fd †ƒ|‡fd †ƒ|‡fd †ƒ|‡fd †ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ddƒ|‡fd†ddƒdS(Nic`sˆjdtf||ŽdS(NR((R0t IndexError(R)R*(R(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR0sc`sˆdS(Ng(((ta(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pytsc`sˆdS(Nig(ig(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdS(Ngi(gi(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆddd…fS(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdd…dfS(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR: sc`sˆdd…ddd…fS(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR: sc`sˆddd…dd…fS(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR: sc`sˆdS(Nig(iig(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR: sc`sˆdS(Ngi(gii(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR: sc`sˆdS(Nig(igi(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdS(Ngffffffö¿(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdS(Nigffffffö¿(igffffffö¿(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdS(Ngffffffö¿i(gffffffö¿i(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆddd…fS(Ngffffffö¿(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdd…dfS(Ngffffffö¿(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdd…ddd…fS(Ngffffffö¿(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆddd…dd…fS(Ngffffffö¿(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdS(Nigffffffö¿(iigffffffö¿(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdS(Ngffffffö¿i(gffffffö¿ii(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdS(Nigffffffö¿(igffffffö¿i(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sc`sˆdd…dfS(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:sR%ic`sˆdd…ddd…fS(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:s(Rtarray(RR0((R9RsU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt test_indexingÿs0c`s„tjdgggƒ‰|j}|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒdS(Nic`sˆtjdgƒS(Ni(RR;((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:#sc`sˆddgS(Ni(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:$sc`sˆdd…ddgfS(Ni(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:%sc`sˆdd…ddd…fS(Ni(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:&sc`s#ˆdd…dd…dd…fS(N(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:'s(RR;R1(RR1((R9sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_valid_indexings c`sôtjdggƒ‰‡fd†}|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd †ƒ|‡fd †ƒ|‡fd †ƒ|‡fd †ƒ|‡fd †ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ddƒ|‡fd†ddƒ|‡fd†ddƒ|‡fd†ddƒ|‡fd†ddƒ|‡fd†ddƒ|‡fd†dtƒdS(Nic`sˆjdtf||ŽdS(NR((R0R8(R)R*(R(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR0,sc`sˆdS(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:0sc`sˆdd…dd…fS(Nigi(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:1sc`sˆddd…dd…fS(Ngii(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:2sc`sˆddd…dd…fS(Ngii(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:3sc`sˆdd…dd…fS(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:4sc`sˆd S(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:6sc`sˆdd…dd…fS(Niig@(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:7sc`sˆddd…dd…fS(Ngii(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:8sc`sˆdd…dd…fS(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:9sc`sˆdd…ddd…fS(Nig@i(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR::sc`sˆddd…S(Ngð?(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:<sc`sˆdd…ddd…fS(Niig@(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:=sc`sˆddd…dd…fS(Nig@i(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:>sc`sˆddd…dd…fS(Ng@(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:?sc`sˆdd…ddd…fS(Niig@(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:@sc`sˆddd…S(Ngð?ig@(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:BsR%ic`sˆddd…S(Ngð?g@(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Csc`sˆdd…ddd…fS(Nig@(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Dsc`sˆddd…dd…fS(Ngð?ig@i(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Esc`sˆddd…dd…fS(Ngð?g@(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Fsic`sˆdd…ddd…fS(Ngš™™™™™Ù?g@g@(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Gsc`sˆddd…S(Ng(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:IsR'(RR;R(RR0((R9RsU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt test_slicing)s0c`s½tjdgggƒ‰|j}|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd†ƒ|‡fd †ƒdS( Nic`sˆddd…S(N(R!((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Osc`sˆdS(Ni(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Psc`sˆd S(Ni(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Qsc`s ˆdd!S(Nii(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Rsc`sˆddd…S(Ni(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Ssc`sˆddd…S(Nii(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Tsc`sˆddd…S(Ni(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Usc`sˆddd…S(Nii(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Vs(RR;R1(RR1((R9sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_valid_slicingKs cC`s³tjdggƒ}|jtjd|dfddƒ|jtjd|tjdƒdffƒ|jtjd|dgdfƒ|jtjd|dgtjdƒfƒdS( NiR)gð?iÿÿÿÿR%ii(gð?gð?iÿÿÿÿ(RR;R0treshapettaketfloat64(RR9((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt&test_non_integer_argument_deprecationsXs "+"cC`sWd„}|j|ddgtjdƒfƒ|j|ddgtjdƒfƒdS(NcS`s||S(N((R9tb((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pytmultbsR)ii(R0Rtfloat_R1tint_(RRE((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt(test_non_integer_sequence_multiplication`s %cC`s•tjd ƒ}|jtjd|dfƒ|jtjddd|d fƒ|jtjddd|d fƒ|jtjddd|d fƒdS(NiR)gà?R%igš™™™™™@igš™™™™™É?g333333ó?(iii(gà?i(igš™™™™™@(gš™™™™™É?g333333ó?(RtzerosR0tmin(Rtd((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_reduce_axis_float_indexhs ""( R2R3t__doc__RR<R=R>R?RCRHRL(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR7ås "  tTestBooleanArgumentDeprecationcB`seZdZdZd„ZRS(sÔThis tests that using a boolean as integer argument/indexing is deprecated. This should be kept in sync with TestFloatNonIntegerArgumentDeprecation and like it is handled in PyArray_PyIntAsIntp. sKusing a boolean instead of an integer will result in an error in the futurec`stjdgggƒ‰|jtjdˆtdffƒ|jtjdˆtjtƒdffƒtttj tjtƒƒ|jtj dˆdgt fƒ|j‡fd†dt ddƒ|j‡fd †dt ƒ|j‡fd †dt ƒdS( NiR)iÿÿÿÿic`sˆttt…S(N(R4R((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:ƒsR(R%ic`sˆtdfS(Ni(R4((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:„sc`sˆtddfS(Ni(R4((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:…s( RR;R0R@Rtbool_Rt TypeErrortoperatortindexRAR4R8(R((R9sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_bool_as_int_argumentzs"+""(R2R3RMRRS(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRNpstTestArrayToIndexDeprecationcB`seZdZdZd„ZRS(s+This tests that creating an an index from an array is deprecated if the array is not 0d. This can probably be deprecated somewhat faster then the integer deprecations. The deprecation period started with NumPy 1.8. For deprecation this needs changing of array_index in number.c sTconverting an array with ndim \> 0 to an index will result in an error in the futurec`s³tjdgggƒ‰|jtjdtjdgƒfƒ|jtjdˆˆdffdd ƒ|jtjdˆdgˆfdd ƒ|j‡fd†dd ddƒdS( NiR)iÿÿÿÿR(ic`sˆˆˆˆ…S(N(((R9(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:œsR%i((((RR;R0RQRRR@RA(R((R9sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_array_to_index_deprecation“s %(((R2R3RMRRU(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRTˆstTestNonIntegerArrayLikecB`s&eZdZdZd„Zd„ZRS(suTests that array likes, i.e. lists give a deprecation warning when they cannot be safely cast to an integer. sYnon integer \(and non boolean\) array-likes will not be accepted as indices in the futurecC`svtjdƒ}|j|jdddgfdtƒ|j|jdddgffdtƒ|j|jgfƒdS(Ni R)gà?gø?R(t1t2(RtarangeR0t __getitem__R8R1(RR9((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt test_basic¥s !c C`stjdƒ}tjƒ(tjdƒtt|jtgƒWdQXtjƒ(tjdƒt t|jtgƒWdQXdS(Ni R R( RRYRRRRt FutureWarningRZRR(RR9((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_boolean_futurewarning®s    (R2R3RMRR[R](((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRVžs tTestMultipleEllipsisDeprecationcB`seZdZd„ZRS(s\an index can only have a single Ellipsis \(`...`\); replace all but one with slices \(`:`\).c C`stjdƒ}|j|jdttffƒtjƒOtjddtjƒ|d}t ||ƒt t |jtfdfƒWdQXdS(Ni R)tignoreR .i(..( RRYR0RZtEllipsisRRRRRRR8(RR9RD((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR[Às   (R2R3RR[(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR^¼st TestBooleanUnaryMinusDeprecationcB`seZdZdZd„ZRS(sÏTest deprecation of unary boolean `-`. While + and * are well defined, unary - is not and even a corrected form seems to have no real uses. The deprecation process was started in NumPy 1.9. s,numpy boolean negative, the `-` operator, .*cC`sWtjtgƒ}tjtƒ}|jtjd|fƒ|jtjd|fƒdS(NR)(RR;RROR0RQtneg(RR;tgeneric((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt%test_unary_minus_operator_deprecationÕs(R2R3RMRRd(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRaÌst!TestBooleanBinaryMinusDeprecationcB`seZdZdZd„ZRS(sÒTest deprecation of binary boolean `-`. While + and * are well defined, binary - is not and even a corrected form seems to have no real uses. The deprecation process was started in NumPy 1.9. s,numpy boolean subtract, the `-` operator, .*cC`s]tjtgƒ}tjtƒ}|jtjd||fƒ|jtjd||fƒdS(NR)(RR;RROR0RQtsub(RR;Rc((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_operator_deprecationçs(R2R3RMRRg(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyReÞstTestRankDeprecationcB`seZdZd„ZRS(s†Test that np.rank is deprecated. The function should simply be removed. The VisibleDeprecationWarning may become unnecessary. cC`s)tjdƒ}ttjtj|ƒdS(Ni (RRYRRtrank(RR9((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttestõs(R2R3RMRj(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRhðstTestComparisonDeprecationscB`sJeZdZdZd„Zd„Zd„Zd„Zd„Zd„Z RS(sPThis 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. s#elementwise.* comparison failed; .*cC`sôxítjtjfD]Ù}|j|dtjdƒgfƒtjdddƒ}|j|d||d fddƒtjdtjdddgƒgdtƒ}tjdtjdddgƒgdtƒ}|j|d||fddƒqWdS( NR)itdtypesi,iiÿÿÿÿR%ii( RQteqtneR0RRIR!R;tobject(RtopR9RD((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_normal_typess"#--cC`sQtjddgƒ}tjdddgƒ}ttd„||ƒ|gkdS(NR9RDtccS`s ||kS(N((txty((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:s(RR;Rt ValueError(RR9RD((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt test_stringsc C`sÌtjƒVtjddtƒtttjtjdƒdƒtttj tjdƒdƒWdQXtjƒVtjddtƒt ttjtjdƒdƒt ttj tjdƒdƒWdQXdS(NR R iR( RRRR\RRQRmRRYR!RnR(R((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_none_comparisons % cC`stjdtƒ³}tjddtƒttjdƒdk ƒttj dƒdk ƒttj dƒdk ƒttjdƒdkƒttj dƒdkƒttj dƒdkƒWdQXtt |ƒdkƒttj tj dƒdƒƒdS(NR R R iRjtNaTi( RRRRR\RRtfloat32R!tstr_t datetime64R"tequal(RR.((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_scalar_none_comparison*sc`sÎdtfd„ƒY‰|j‡fd†ƒ|j‡fd†ƒtjdddƒ‰tjdddƒ‰tt‡fd †ƒtt‡‡fd †ƒtt‡fd †ƒtt‡‡fd †ƒdS( NtNotArraycB`seZd„Zd„ZRS(cS`s t‚dS(N(RP(R((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt __array__AscS`stS(N(tNotImplemented(Rtother((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt__ne__Es(R2R3RR‚(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR~@s c`stjdƒˆƒkS(Ni(RRY((R~(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Hsc`stjdƒˆƒkS(Ni(RRY((R~(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:IsiRlsi4,i4si4,i4,i4c`s ˆdkS(Ni(((tstruct1(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Nsc`s ˆˆkS(N(((Rƒtstruct2(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Osc`s ˆdkS(Ni(((Rƒ(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Psc`s ˆˆkS(N(((RƒR„(sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:Qs(RoR0RRIRR\(R((R~RƒR„sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt!test_void_dtype_equality_failures?sc C`s‘ttd„ƒttd„ƒtjƒxtjdƒttjdƒdk ƒttjdƒdkƒttjdƒdk ƒttjdƒdkƒWdQXxätj dƒtjdƒgD]Ä}tj dddƒ}x¦|dgD]˜}xt j t j t jt jgD]o}tjdd krntjƒ2}tjd ƒtt|||ƒt| ƒWdQXqtt|||ƒqWqíWqÅWdS( NcS`stjdƒdkS(NiR9(RRY(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:ZscS`stjdƒdkS(NiR9(RRY(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:[sRiR9iRlsi4,i4iR (RR\RRRRRR;tint16tasarrayRIRQtlttletgttgetsyst version_infoRRPR6(Rtarg1tstructtarg2tftl((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt'test_array_richcompare_legacy_weirdnessSs$  %% ( R2R3RMRRqRvRwR}R…R“(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRkús  t"TestIdentityComparisonDeprecationscB`s/eZdZdZd„Zd„Zd„ZRS(sThis tests the equal and not_equal object ufuncs identity check deprecation. This was due to the usage of PyObject_RichCompareBool. This tests that for example for `a = np.array([np.nan], dtype=object)` `a == a` it is warned that False and not `np.nan is np.nan` is returned. Should be kept in sync with TestComparisonDeprecations and new tests added when the deprecation is over. Requires only removing of @identity@ (and blocks) from the ufunc loops.c.src of the OBJECT comparisons. s6numpy .* will not check object identity in the future.c C`stjtjgdtƒ}tjƒDtjddtƒtttj ||ƒtttj ||ƒWdQXtjƒtjddtƒt ttj ||ƒt ttj ||ƒtj ddƒEtj ||ƒtj||ƒtj||ƒtj||ƒWdQXWdQXdS(NRlR R RtinvalidR_(RR;tnanRoRRRR\RR|t not_equalRterrstatetlesstgreatert less_equalt greater_equal(RR9((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_identity_equality_mismatchs  cC`sgdtfd„ƒY}tj|ƒgƒ}|jtjd||fƒ|jtjd||fƒdS(Nt FunkyTypecB`seZd„Zd„ZRS(cS`stdƒ‚dS(NsI won't compare(RP(RR((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt__eq__–scS`stdƒ‚dS(NsI won't compare(RP(RR((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR‚™s(R2R3RŸR‚(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRž•s R)(RoRR;R0R|R—(RRžR9((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_comparison_error”scC`sitjtjdddgƒdgdtƒ}|jtjd||fƒ|jtjd||fƒdS(NiiiRlR)(RR;R!RoR0R|R—(RR9((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_bool_error s-(R2R3RMRRR R¡(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR”ss    t"TestAlterdotRestoredotDeprecationscB`seZdZd„ZRS(s‘The alterdot/restoredot functions are deprecated. These functions no longer do anything in numpy 1.10, so they should not be used. cC`s$|jtjƒ|jtjƒdS(N(R0Rtalterdott restoredot(R((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt$test_alterdot_restoredot_deprecation¯s(R2R3RMR¥(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR¢§st(TestBooleanIndexShapeMismatchDeprecationcB`seZdZdZd„ZRS(s‚Tests deprecation for boolean indexing where the boolean array does not match the input array along the given dimensions. s)boolean index did not match indexed arraycC`s´tjdƒ}tjtgƒ}ttj|j|ƒtjtgdƒ}ttj|j|ƒtjddt ƒ}ttj|j|ƒttj|jt dƒ|fƒdS(NiiiiRl(iii(ii( RtonesR;RRRRZR4RItbooltsliceR!(RtarrRR((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt test_simpleºs       (R2R3RMRR«(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR¦´stTestFullDefaultDtypecB`seZdZd„ZRS(smnp.full defaults to float when dtype is not set. In the future, it will use the fill value's dtype. cC`sFtttjddƒtttjddƒttjddtƒdS(Ni(RR\RtfullR!Rtfloat(R((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_full_default_dtypeÔs(R2R3RMR¯(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR¬ÏstTestDatetime64TimezonecB`sReZdZd„Zeje dƒejej dd!dkƒd„ƒƒZ RS(s{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. cC`s0|jtjddƒ|jtjddƒdS(NR)s2000-01-01T00+01s2000-01-01T00Z(s2000-01-01T00+01(s2000-01-01T00Z(R0RR{(R((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRvãss!The pytz module is not available.iiicC`sMtjdƒ}tjdddddd|ƒ}|jtjd|fƒdS(Ns US/EasterniÐiittzinfoR)(tpytzttimezonetdatetimeR0RR{(Rttztdt((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt test_datetimeçs!(ii( R2R3RMRvR tskipift _has_pytztknownfailureifRŒRR·(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR°Ús t!TestNonCContiguousViewDeprecationcB`seZdZd„ZRS(sIView of non-C-contiguous arrays deprecated in 1.11.0. The deprecation will not be raised for arrays that are both C and F contiguous, as C contiguous is dominant. There are more such arrays with relaxed stride checking than without so the deprecation is not as visible with relaxed stride checking in force. cC`sT|jtjdƒjjdtjfƒ|jtjdƒjjdtjfƒdS(NiR)(ii(ii(R0RR§tTtviewtcomplextint8(R((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_fortran_contiguousøs((R2R3RMRÀ(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR»ïst8TestInvalidOrderParameterInputForFlattenArrayDeprecationcB`s eZdZd„Zd„ZRS(sdInvalid arguments to the ORDER parameter in array.flatten() should not be allowed and should raise an error. However, in the interests of not breaking code that may inadvertently pass invalid arguments to this parameter, a DeprecationWarning will be issued instead for the time being to give developers time to refactor relevant code. cC`s8tjdƒ}d|_|j|jdtjfƒdS(Niis_Non-string object detected for the array ordering. Please pass in 'C', 'F', 'A', or 'K' insteadR)(ii(RRIRR0tflattentpi(RRs((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt!test_flatten_array_non_string_args cC`s2tjdƒ}d|_|j|jddƒdS(NiisdNon length-one string passed in for the array ordering. Please pass in 'C', 'F', 'A', or 'K' insteadR)tFACK(ii(RÅ(RRIRR0RÂ(RRs((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyt%test_flatten_array_invalid_string_arg s (R2R3RMRÄRÆ(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRÁýs tTestTestDeprecatedcB`seZd„ZRS(cC`sCtƒ}|jƒtt|jd„ƒd„}|j|ƒdS(NcS`sdS(N(R!(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyR:!scS`stjddtƒdS(NtfooR(RtwarnR6(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRÈ#s(R5RRR R0(Rttest_case_instanceRÈ((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyttest_assert_deprecateds    (R2R3RË(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pyRÇst__main__((-RMt __future__RRRR´RŒRQRtnumpyRt numpy.testingRRRRRRR R²RR¹t ImportErrorR4RoR R5R7RNRTRVR^RaReRhRkR”R¢R¦R¬R°R»RÁRÇR2(((sU/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_deprecations.pytsB     4    ge‹ y4