§ y<ˆjöLãó—dZddlZddlZddlZddlZddlZddlZddlZddlm Z m Z ddl Z ddl Z ddl mZmZddlmZddlmZddlZddlZddlZddlmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"ddl#Zdd l$m%Z%gd ¢Z&Gd „d e'¦«Z(e(Z)dZ*ej+¦«d vZ,ej-j.dkZ/e0ed¦«Z1e2edd¦«duoe1 Z3ej4j5j6Z7d„Z8dZ9ej:d¦«pdZ;de;vrdZ9dad„Zn-ejdd…dkrdej?¦«›d �fd!„Z>nd"„Z>ejdd…dkrdej?¦«›d �gfd#„Z@ngfd$„Z@ ddd(„ZAded)„ZBd*„ZCejD¦«dfd,„¦«ZEejD¦« dfd-„¦«ZFejD¦« dgdd/œd0„¦«ZGdedd/œd1„ZHejD¦«dhd2„¦«ZIded3„ZJd4„ZKd5„ZLdid6„ZMd7„ZNeN¦«ZOddlPZPGd8„d9ePjQ¦«ZReRd:¦«ZSd;„ZTd<„ZUdjd=„ZVdkd?„ZWd@„ZX dldB„ZYdmdC„ZZdkdD„Z[djdE„Z\dF„Z]dG„Z^e j_djdH„¦«Z`dI„Zae j_djdJ„¦«ZbdK„ZcedLdMfdN„ZdGdO„dPe'¦«Zee j_dQ„¦«Zfe j_dR„¦«ZgGdS„dTejh¦«ZiGdU„dV¦«Zje j_djdW„¦«ZkdX„ZldY„ZmdZ„Znd[„Zod\„Zpd]„Zqd^„Zrd_„Zses¦«Ztd`„ZudS)nz* Utility function to facilitate testing. éN)ÚpartialÚwraps)ÚmkdtempÚmkstemp)ÚSkipTest)ÚWarningMessage)ÚintpÚfloat32ÚemptyÚarangeÚ array_reprÚndarrayÚisnatÚarray)ÚisfiniteÚisnanÚisinf)ÚStringIO)*Ú assert_equalÚassert_almost_equalÚassert_approx_equalÚassert_array_equalÚassert_array_lessÚassert_string_equalÚassert_array_almost_equalÚ assert_raisesÚ build_err_msgÚdecorate_methodsÚjiffiesÚmemusageÚprint_assert_equalÚrundocsÚ runstringÚverboseÚmeasureÚassert_Úassert_array_almost_equal_nulpÚassert_raises_regexÚassert_array_max_ulpÚ assert_warnsÚassert_no_warningsÚassert_allcloseÚIgnoreExceptionÚclear_and_catch_warningsrÚKnownFailureExceptionÚtemppathÚtempdirÚIS_PYPYÚ HAS_REFCOUNTÚIS_WASMÚsuppress_warningsÚassert_array_compareÚassert_no_gc_cyclesÚ break_cyclesÚ HAS_LAPACK64Ú IS_PYSTONÚ_OLD_PROMOTIONÚIS_MUSLÚ _SUPPORTS_SVEcó—eZdZdZdS)r/zrP;s€�Ô0Ñ2Ô2°hÒ>€rEFÚ HOST_GNU_TYPEÚÚmuslTcóh—d}|s- |¦«}n#t$r|}YnwxYwt|¦«‚dS)aI Assert that works in release mode. Accepts callable msg to allow deferring evaluation until failure. The Python built-in ``assert`` does not work when executing code in optimized mode (the ``-O`` flag) - no byte-code is generated for it. For documentation on usage, refer to the Python documentation. TN)Ú TypeErrorÚAssertionError)ÚvalÚmsgÚ__tracebackhide__Úsmsgs rFr&r&Gs`€ðÐØ ð#ð Ø�3‘5”5ˆDˆDøÝð ð ð ØˆDˆDˆDð øøøå˜TÑ"Ô"Ð"ð #ð#s † ‘ Ÿ ÚntéÿÿÿÿcóÆ—ddl}|€|j}| |||d||f¦«}| ¦«} | ||¦«} | |¦«| | |¦«\} } | | | ¦«| |¦«S#| | ¦«wxYw#| |¦«wxYw)Nr) Úwin32pdhÚ PDH_FMT_LONGÚMakeCounterPathÚ OpenQueryÚ AddCounterÚCollectQueryDataÚGetFormattedCounterValueÚ RemoveCounterÚ CloseQuery) ÚobjectÚcounterÚinstanceÚinumÚformatÚmachiner^ÚpathÚhqÚhcÚtyperWs rFÚGetPerformanceAttributesrq]s€ð ˆˆˆØ ˆ>ØÔ*ˆFØ×'Ò'¨'°6¸8ÀTØ*.°ð*9ñ:ô:ˆà × Ò Ñ !Ô !ˆð $Ø×$Ò$ R¨Ñ.Ô.ˆBð +Ø×)Ò)¨"Ñ-Ô-Ð-Ø$×=Ò=¸bÀ&ÑIÔI‘ ��cØà×&Ò& rÑ*Ô*Ð*à × Ò  Ñ #Ô #Ð #Ð #øð×&Ò& rÑ*Ô*Ð*Ð*øøøøà × Ò  Ñ #Ô #Ð #Ð #øøøs#¾C Á/B/ÂC Â/CÃC à C Úpythoncó<—ddl}tdd|||jd¦«S)NrÚProcessz Virtual Bytes)r^rqr_)Ú processNamerir^s rFr r xs1€àˆˆˆÝ'¨ °?Ø(3°XØ(0Ô(=¸tñEôEð ErEéÚlinuxz/proc/z/statcóì— t|¦«5}| ¦« d¦«}ddd¦«n #1swxYwYt|d¦«S#t$rYdSwxYw)zM Return virtual memory size in bytes of the running python. ú Né)ÚopenÚreadlineÚsplitÚintÚ Exception)Ú_proc_pid_statÚfÚls rFr r €s´€ð  Ý�nÑ%Ô%ð ,¨Ø—J’J‘L”L×&Ò& sÑ+Ô+�ð ,ð ,ð ,ñ ,ô ,ð ,ð ,ð ,ð ,ð ,ð ,øøøð ,ð ,ð ,ð ,å�q˜”u‘:”:Ð øÝð ð ð Ø ˆFˆFð øøøs3‚A%‘(A¹ A%ÁA Á A%Á A Á A%Á% A3Á2A3có—t‚)zK Return memory usage of running python. [Not implemented] )ÚNotImplementedErrorrDrErFr r Œs €õ "Ð!rEcóž—ddl}|s'| | ¦«¦« t|¦«5}| ¦« d¦«}ddd¦«n #1swxYwYt |d¦«S#t $r0t d| ¦«|dz z¦«cYSwxYw)ú¸ Return number of jiffies elapsed. Return number of jiffies (1/100ths of a second) that this process has been scheduled in user mode. See man 5 proc. rNryé éd)ÚtimeÚappendr{r|r}r~r)r€Ú _load_timer‰r�r‚s rFrr•s€ð ˆ ˆ ˆ Øð +Ø × Ò ˜dŸiši™kœkÑ *Ô *Ð *ð 8Ý�nÑ%Ô%ð ,¨Ø—J’J‘L”L×&Ò& sÑ+Ô+�ð ,ð ,ð ,ñ ,ô ,ð ,ð ,ð ,ð ,ð ,ð ,øøøð ,ð ,ð ,ð ,å�q˜”u‘:”:Ð øÝð 8ð 8ð 8Ý�s˜DŸIšI™KœK¨ °1¬ Ñ5Ñ6Ñ7Ô7Ð 7Ð 7Ð 7ð 8øøøs4¯B¾(A2Á& BÁ2A6Á6BÁ9A6Á:BÂ7C à C có¶—ddl}|s'| | ¦«¦«td| ¦«|dz z¦«S)r†rNrˆ)r‰rŠr~)r‹r‰s rFrrªsU€ð ˆ ˆ ˆ Øð +Ø × Ò ˜dŸiši™kœkÑ *Ô *Ð *Ý�3˜Ÿ š ™ œ  J¨q¤MÑ1Ñ2Ñ3Ô3Ð3rEúItems are not equal:©ÚACTUALÚDESIREDécóì—d|zg}|ra| d¦«dkr3t|¦«dt|¦«z kr|ddz|zg}n| |¦«|rõt|¦«D]å\}}t |t ¦«rt t|¬¦«} nt} | |¦«} n2#t$r%} dt|¦«j ›d| ›d �} Yd} ~ nd} ~ wwxYw|   d¦«d kr4d  |  ¦«dd …¦«} | d z } | d||›d | ›�¦«Œæd  |¦«S) Nú r\éOrry)Ú precisionz[repr failed for : ú]éz...ú: )ÚfindÚlenrŠÚ enumerateÚ isinstancerrr Úreprrrpr@ÚcountÚjoinÚ splitlines) ÚarraysÚerr_msgÚheaderr$Únamesr•rXÚiÚaÚr_funcÚrÚexcs rFrr¸sš€à �&‰=ˆ/€CØð Ø �<Š<˜Ñ Ô  Ò #Ð #­¨G© ¬ °r½#¸f¹+¼+±~Ò(EÐ(EØ�q”6˜C‘< 'Ñ)Ð*ˆCˆCà �JŠJ�wÑ Ô Ð Øð,ݘfÑ%Ô%ð ,ð ,‰DˆAˆqå˜!�WÑ%Ô%ð å ¥°yÐAÑAÔA��å�ð EØ�F˜1‘I”I��øÝð Eð Eð EØD­¨a©¬Ô)9ÐDÐD¸cÐDÐDÐD������øøøøð Eøøøà�wŠw�t‰}Œ}˜qÒ Ð Ø—I’I˜aŸlšl™nœn¨R¨a¨RÔ0Ñ1Ô1�Ø�U‘ �Ø �JŠJÐ*˜5 œ8Ð*Ð* qÐ*Ð*Ñ +Ô +Ð +Ð +Ø �9Š9�S‰>Œ>ÐsÂ4 Cà C/à C*Ã*C/c óê—d}t|t¦«rÊt|t¦«s)ttt |¦«¦«¦«‚t t |¦«t |¦«||¦«| ¦«D]I\}}||vrtt|¦«¦«‚t ||||d|›d|›�|¦«ŒJdSt|ttf¦«r�t|ttf¦«rqt t |¦«t |¦«||¦«tt |¦«¦«D]&}t ||||d|›d|›�|¦«Œ'dSddl m }m }m} ddlm} m} m} t||¦«st||¦«rt'||||¦«St)||g||¬ ¦«} | |¦«p | |¦«}n#t*t,f$rd }YnwxYw|r‹| |¦«r| |¦«}| |¦«}n|}d}| |¦«r| |¦«}| |¦«}n|}d} t ||¦«t ||¦«n#t$rt| ¦«‚wxYw||¦«||¦«krt| ¦«‚ t/|¦«}t/|¦«}t1j|¦«jjt1j|¦«jjk}|r|r|rdSt| ¦«‚n#t,t*t6f$rYnwxYw t9|¦«}t9|¦«}|r|rdSt1j|¦«}t1j|¦«}|jjd vs|jjd vrt7d ¦«‚|dkr-|dkr'| |¦«| |¦«kst| ¦«‚n#t,t*t6f$rYnwxYw ||kst| ¦«‚dS#t<t>f$r$}d |j dvrt| ¦«‚‚d}~wwxYw)a Raises an AssertionError if two objects are not equal. Given two objects (scalars, lists, tuples, dictionaries or numpy arrays), check that all elements of these objects are equal. An exception is raised at the first conflicting values. When one of `actual` and `desired` is a scalar and the other is array_like, the function checks that each element of the array_like object is equal to the scalar. This function handles NaN comparisons as if NaN was a "normal" number. That is, AssertionError is not raised if both objects have NaNs in the same positions. This is in contrast to the IEEE standard on NaNs, which says that NaN compared to anything must return False. Parameters ---------- actual : array_like The object to check. desired : array_like The expected object. err_msg : str, optional The error message to be printed in case of failure. verbose : bool, optional If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired are not equal. Examples -------- >>> np.testing.assert_equal([4,5], [4,6]) Traceback (most recent call last): ... AssertionError: Items are not equal: item=1 ACTUAL: 5 DESIRED: 6 The following comparison does not raise an exception. There are NaNs in the inputs, but they are in the same positions. >>> np.testing.assert_equal(np.array([1.0, 2.0, np.nan]), [1, 2, np.nan]) Tzkey=r“Nzitem=r)rÚisscalarÚsignbit©Ú iscomplexobjÚrealÚimag©r$FÚMmz0cannot compare to a scalar with a different typezelementwise == comparison)!rœÚdictrVr�rprršÚitemsÚlistÚtupleÚrangeÚ numpy.corerr«r¬Ú numpy.libr®r¯r°rrÚ ValueErrorrUrrNÚasarrayÚdtyper„rÚcharÚDeprecationWarningÚ FutureWarningÚargs)ÚactualÚdesiredr¢r$rYÚkr¥rr«r¬r®r¯r°rXÚ usecomplexÚactualrÚactualiÚdesiredrÚdesirediÚisdesnatÚisactnatÚ dtypes_matchÚisdesnanÚisactnanÚ array_actualÚ array_desiredÚes rFrrÔsY€ðdÐÝ�'�4Ñ Ô ð ݘ&¥$Ñ'Ô'ð 5Ý ¥¥d¨6¡l¤lÑ!3Ô!3Ñ4Ô4Ð 4Ý•S˜‘[”[¥# g¡,¤,°¸ÑAÔAÐAØ—M’M‘O”Oð "ð "‰DˆAˆqؘˆˆÝ$¥T¨!¡W¤WÑ-Ô-Ð-Ý ˜ œ G¨A¤JÐ0G°qÐ0GÐ0G¸gÐ0GÐ0GØ ñ "ô "ð "ð "àˆÝ�'�D¥%˜=Ñ)Ô)ð­j¸Å$ÍÀÑ.OÔ.OðÝ•S˜‘[”[¥# g¡,¤,°¸ÑAÔAÐAÝ•s˜7‘|”|Ñ$Ô$ð "ð "ˆAÝ ˜ œ G¨A¤JÐ0H¸Ð0HÐ0H¸wÐ0HÐ0HØ ñ "ô "ð "ð "àˆØ5Ð5Ð5Ð5Ð5Ð5Ð5Ð5Ð5Ð5Ø2Ð2Ð2Ð2Ð2Ð2Ð2Ð2Ð2Ð2Ý�&˜'Ñ"Ô"ðE¥j°¸'Ñ&BÔ&BðEÝ! &¨'°7¸GÑDÔDÐDÝ ˜ Ð)¨7¸GÐ DÑ DÔ D€Cð Ø!�\ &Ñ)Ô)ÐB¨\¨\¸'Ñ-BÔ-Bˆ ˆ øÝ � Ð "ðððØˆ ˆ ˆ ðøøøðð&Ø ˆ<˜Ñ Ô ð Ø�d˜6‘l”lˆGØ�d˜6‘l”lˆGˆGàˆG؈GØ ˆ<˜Ñ Ô ð Ø�t˜G‘}”}ˆHØ�t˜G‘}”}ˆHˆHàˆH؈Hð &Ý ˜ (Ñ +Ô +Ð +Ý ˜ (Ñ +Ô +Ð +Ð +øÝð &ð &ð &Ý  Ñ%Ô%Ð %ð &øøøð€x�ÑÔ˜H˜H VÑ,Ô,Ò,Ð,ݘSÑ!Ô!Ð!ð ݘ‘>”>ˆÝ˜‘=”=ˆÝœ  7Ñ+Ô+Ô1Ô6Ýœ  6Ñ*Ô*Ô0Ô5ò6ˆ à ð *˜ð *ðð *Ø�å$ SÑ)Ô)Ð)øøå •zÕ#6Ð 7ð ð ð Ø ˆð øøøð ݘ‘>”>ˆÝ˜‘=”=ˆØ ð ˜ð Ø ˆFõ”z &Ñ)Ô)ˆ Ýœ  7Ñ+Ô+ˆ Ø Ô Ô # tÐ +Ð +ØÔ#Ô(¨DÐ0Ð0õ &ð'>ñ?ô?ð ?ð �aŠ<ˆ<˜F ašK˜KØ�7˜7Ñ#Ô# w w¨v¡¤Ò6Ð6Ý$ SÑ)Ô)Ð)øøå •zÕ#6Ð 7ð ð ð Ø ˆð øøøð à˜6Ò!Ð!Ý  Ñ%Ô%Ð %ð"Ð!øõ ¥ Ð .ðððà &¨!¬&°¬)Ð 3Ð 3Ý  Ñ%Ô%Ð %à øøøøð øøøshÇ&G=Ç=HÈHÉ% JÊJ Ë A"L?Ì/L?Ì?MÍMÍ"PÎBPÐP"Ð!P"Ð&P=Ð=Q2ÑQ-Ñ-Q2có>—d}ddl}||ks�t¦«}| |¦«| d¦«|j||¦«| d¦«|j||¦«t| ¦«¦«‚dS)aµ Test if two objects are equal, and print an error message if test fails. The test is performed with ``actual == desired``. Parameters ---------- test_string : str The message supplied to AssertionError. actual : object The object to test for equality against `desired`. desired : object The expected result. Examples -------- >>> np.testing.print_assert_equal('Test XYZ of func xyz', [0, 1], [0, 1]) >>> np.testing.print_assert_equal('Test XYZ of func xyz', [0, 1], [0, 2]) Traceback (most recent call last): ... AssertionError: Test XYZ of func xyz failed ACTUAL: [0, 1] DESIRED: [0, 2] TrNz failed ACTUAL: z DESIRED: )ÚpprintrÚwriterVÚgetvalue)Ú test_stringrÁrÂrYrÒrXs rFr!r!ts¤€ð8ÐØ€M€M€Mà �gÒ Ð Ý‰jŒjˆØ � Š �+ÑÔÐØ � Š Ð'Ñ(Ô(Ð(؈Œ �f˜cÑ"Ô"Ð"Ø � Š �-Ñ Ô Ð ØˆŒ �g˜sÑ#Ô#Ð#ݘSŸ\š\™^œ^Ñ,Ô,Ð,ð Ð rEécóD‡‡‡‡‡—d}ddlm}ddlm}m}m}  |‰¦«p |‰¦«} n#t $rd} YnwxYwˆˆˆˆˆfd„} | r—|‰¦«r|‰¦«} | ‰¦«} n‰} d} |‰¦«r|‰¦«}| ‰¦«}n‰}d} t| |‰¬¦«t| |‰¬¦«n%#t$rt| ¦«¦«‚wxYwt‰|ttf¦«st‰|ttf¦«rt‰‰‰‰¦«S t‰¦«rt‰¦«sst‰¦«st‰¦«r6t‰¦«rt‰¦«st| ¦«¦«‚n‰‰kst| ¦«¦«‚dSn#tt f$rYnwxYwt#‰‰z ¦«t%jd d ‰ zz¦«krt| ¦«¦«‚dS) a$ Raises an AssertionError if two items are not equal up to desired precision. .. note:: It is recommended to use one of `assert_allclose`, `assert_array_almost_equal_nulp` or `assert_array_max_ulp` instead of this function for more consistent floating point comparisons. The test verifies that the elements of `actual` and `desired` satisfy. ``abs(desired-actual) < float64(1.5 * 10**(-decimal))`` That is a looser test than originally documented, but agrees with what the actual implementation in `assert_array_almost_equal` did up to rounding vagaries. An exception is raised at conflicting values. For ndarrays this delegates to assert_array_almost_equal Parameters ---------- actual : array_like The object to check. desired : array_like The expected object. decimal : int, optional Desired precision, default is 7. err_msg : str, optional The error message to be printed in case of failure. verbose : bool, optional If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired are not equal up to specified precision. See Also -------- assert_allclose: Compare two array_like objects for equality with desired relative and/or absolute precision. assert_array_almost_equal_nulp, assert_array_max_ulp, assert_equal Examples -------- >>> from numpy.testing import assert_almost_equal >>> assert_almost_equal(2.3333333333333, 2.33333334) >>> assert_almost_equal(2.3333333333333, 2.33333334, decimal=10) Traceback (most recent call last): ... AssertionError: Arrays are not almost equal to 10 decimals ACTUAL: 2.3333333333333 DESIRED: 2.33333334 >>> assert_almost_equal(np.array([1.0,2.3333333333333]), ... np.array([1.0,2.33333334]), decimal=9) Traceback (most recent call last): ... AssertionError: Arrays are not almost equal to 9 decimals Mismatched elements: 1 / 2 (50%) Max absolute difference: 6.66669964e-09 Max relative difference: 2.85715698e-09 x: array([1. , 2.333333333]) y: array([1. , 2.33333334]) Tr)rr­Fcó8•—d‰z}t‰‰g‰‰|¬¦«S)Nú*Arrays are not almost equal to %d decimals)r$r£)r)r£rÁÚdecimalrÂr¢r$s €€€€€rFÚ_build_err_msgz+assert_almost_equal.._build_err_msgïs2ø€Ø>ÀÑHˆÝ˜f gÐ.°ÀØ$*ð,ñ,ô,ð ,rE)rÚNçø?ç$@)r¸rr¹r®r¯r°rºrrVrœr¶rµrrrr„rUÚabsrNÚfloat64)rÁrÂrÚr¢r$rYrr®r¯r°rÄrÛrÅrÆrÇrÈs````` rFrr�sõøøøøø€ðLÐØ"Ð"Ð"Ð"Ð"Ð"Ø2Ð2Ð2Ð2Ð2Ð2Ð2Ð2Ð2Ð2ð Ø!�\ &Ñ)Ô)ÐB¨\¨\¸'Ñ-BÔ-Bˆ ˆ øÝ ðððØˆ ˆ ˆ ðøøøð,ð,ð,ð,ð,ð,ð,ð,ð,ð ð3Ø ˆ<˜Ñ Ô ð Ø�d˜6‘l”lˆGØ�d˜6‘l”lˆGˆGàˆG؈GØ ˆ<˜Ñ Ô ð Ø�t˜G‘}”}ˆHØ�t˜G‘}”}ˆHˆHàˆH؈Hð 3Ý  ¨¸7Ð CÑ CÔ CÐ CÝ  ¨¸7Ð CÑ CÔ CÐ CÐ CøÝð 3ð 3ð 3Ý   Ñ!1Ô!1Ñ2Ô2Ð 2ð 3øøøõ�&˜7¥E­4Ð0Ñ1Ô1ðLݘ' G­UµDÐ#9Ñ:Ô:ðLå(¨°¸'À7ÑKÔKÐKð  õ˜Ñ!Ô!ð ¥h¨vÑ&6Ô&6ð Ý�W‰~Œ~ð ;¥ v¡¤ð ;ݘg™œð;­5°©=¬=ð;Ý(¨¨Ñ)9Ô)9Ñ:Ô:Ð:ð;ð &Ò(Ð(Ý(¨¨Ñ)9Ô)9Ñ:Ô:Ð:Ø ˆFð øõ ¥Ð +ð ð ð Ø ˆð øøøå ˆ7�VÑ ÑÔ¥¤ ¨3°¸¸Ñ1AÑ+AÑ BÔ BÒBÐBݘ^˜^Ñ-Ô-Ñ.Ô.Ð.ðCÐBs+™0° ?¾?Â$B?Â?"C!Ä1BGÇGÇGc ó„—d}ddl}tt||f¦«\}}||krdS|jd¬¦«5d|j|¦«|j|¦«zz}|jd|j|j|¦«¦«¦«}ddd¦«n #1swxYwY ||z }n#t$rd}YnwxYw ||z } n#t$rd} YnwxYwt||g|d |z|¬ ¦«} t|¦«rt|¦«sct|¦«st|¦«r.t|¦«rt|¦«st| ¦«‚n||kst| ¦«‚dSn#ttf$rYnwxYw|j|| z ¦«|jd |d z ¦«krt| ¦«‚dS) aa Raises an AssertionError if two items are not equal up to significant digits. .. note:: It is recommended to use one of `assert_allclose`, `assert_array_almost_equal_nulp` or `assert_array_max_ulp` instead of this function for more consistent floating point comparisons. Given two numbers, check that they are approximately equal. Approximately equal is defined as the number of significant digits that agree. Parameters ---------- actual : scalar The object to check. desired : scalar The expected object. significant : int, optional Desired precision, default is 7. err_msg : str, optional The error message to be printed in case of failure. verbose : bool, optional If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired are not equal up to specified precision. See Also -------- assert_allclose: Compare two array_like objects for equality with desired relative and/or absolute precision. assert_array_almost_equal_nulp, assert_array_max_ulp, assert_equal Examples -------- >>> np.testing.assert_approx_equal(0.12345677777777e-20, 0.1234567e-20) >>> np.testing.assert_approx_equal(0.12345670e-20, 0.12345671e-20, ... significant=8) >>> np.testing.assert_approx_equal(0.12345670e-20, 0.12345672e-20, ... significant=8) Traceback (most recent call last): ... AssertionError: Items are not equal to 8 significant digits: ACTUAL: 1.234567e-21 DESIRED: 1.2345672e-21 the evaluated condition that raises the exception is >>> abs(0.12345670e-20/1e-21 - 0.12345672e-20/1e-21) >= 10**-(8-1) True TrNÚignore)Úinvalidgà?é gz-Items are not equal to %d significant digits:)r£r$rÝé)ÚnumpyÚmapÚfloatÚerrstaterÞÚpowerÚfloorÚlog10ÚZeroDivisionErrorrrrrVrUr„) rÁrÂÚ significantr¢r$rYrNÚscaleÚ sc_desiredÚ sc_actualrXs rFrrs�€ðxÐØÐÐÐå�E F¨GÐ#4Ñ5Ô5Ñ€VˆWØ�&ÒÐØˆð ˆŒ˜XÐ &Ñ &Ô &ð8ð8Ø�V�R”V˜G‘_”_ v r¤v¨f¡~¤~Ñ5Ñ6ˆØ�”˜˜X˜RœX h b¤h¨u¡o¤oÑ6Ô6Ñ7Ô7ˆð8ð8ð8ñ8ô8ð8ð8ð8ð8ð8ð8øøøð8ð8ð8ð8ðؘU‘]ˆ ˆ øÝ ðððØˆ ˆ ˆ ðøøøðؘ5‘Lˆ ˆ øÝ ðððØˆ ˆ ˆ ðøøøå Ø �И7Ø>ÀÑLØð ñ ô €Cð  õ˜Ñ!Ô!ð ¥h¨vÑ&6Ô&6ð Ý�W‰~Œ~ð .¥ v¡¤ð .ݘg™œð.­5°©=¬=ð.Ý(¨Ñ-Ô-Ð-ð.ð &Ò(Ð(Ý(¨Ñ-Ô-Ð-Ø ˆFð øõ Õ*Ð +ð ð ð Ø ˆð øøøà €r„vˆj˜9Ñ$Ñ%Ô%¨¨¬°#¸ÀQ¹Ð7GÑ)HÔ)HÒHÐHݘSÑ!Ô!Ð!ðIÐHsIºABÂBÂBÂ$B*Â* B9Â8B9Â=Cà CÃCÃ.A?E0Å0FÆFé)Ústrictc  óô ‡‡‡‡‡'‡(—d} ddlm} m} mŠ(mŠ'm} m}m}m}tj |¦«}tj |¦«}||}}d„}d„}| dfˆ'ˆˆˆˆfd„ } | r!|j |j ko|j |j k}n&|j dkp|j dkp|j |j k}|s`|j |j krd |j ›d |j ›d �}nd |j ›d |j ›d �}t||g‰|z‰‰d ‰¬¦«}t|¦«‚‰'d¦«}||¦«rI||¦«r>|r|||| d¬¦«}|r*||||ˆ(fd„d¬¦«z}||||ˆ(fd„d¬¦«z}nF||¦«r;||¦«r0|r.|j j|j jkr|||t d¬¦«}|jdkr ||||}}|jdkrdSn|rdS|||¦«}t'|t(¦«r|}t+|g¦«}n(| ¦«}| ¦«}|dk�rf|j| t0¬¦«z }|jdkr|jn|j}d|z|z }d |||¦«g}| d¬¦«5t5jt8¦«5t;||z ¦«} tj|j tj¦«r)t;||z ¦«}!tj | |!| ¬¦«|| ¦«}"tC| d|¦«|kr&| "dtG|"¦«z¦«n!| "d| |"¦«z¦«‰'|dk¦«}#||#¦«rt+‰(¦«}$n'|| |#t;||#¦«z ¦«}$tC| d|¦«|kr&| "dtG|$¦«z¦«n!| "d| |$¦«z¦«ddd¦«n #1swxYwYddd¦«n #1swxYwY‰dd $|¦«zz Št||g‰‰‰d ‰¬¦«}t|¦«‚dS#tJ$rGddl&}%|% '¦«}&d |&›d!‰›�Št||g‰‰‰d ‰¬¦«}tK|¦«‚wxYw)"NTr)Ú array2stringrÚinfÚbool_rèÚallÚmaxÚobject_có—|jjdvS)Nz?bhilqpBHILQPefdgFDG©r¼r½©Úxs rFÚisnumberz&assert_array_compare..isnumber�s€ØŒwŒ|Ð5Ð5Ð5rEcó—|jjdvS)Nr²rûrüs rFÚistimez$assert_array_compare..istime’s€ØŒwŒ|˜tÐ#Ð#rEÚnanc󆕗d}||¦«}||¦«}‰||k¦« ¦«dkr,t||g‰ d|zz‰ ‰ d‰ ¬¦«}t|¦«‚t|t¦«s |jdkr ‰|¦«St|t¦«s |jdkr ‰|¦«S|S)z‹Handling nan/inf. Combine results of running func on x and y, checking that they are True at the same locations. Tz x and y %s location mismatch:©rýÚy©r$r£r¤r•r)r÷rrVrœÚboolÚndim) rýrÚfuncÚhasvalrYÚx_idÚy_idrXrör¢r£r•r$s €€€€€rFÚfunc_assert_same_posz2assert_array_compare..func_assert_same_pos•sñø€ð!Ðàˆt�A‰wŒwˆØˆt�A‰wŒwˆð ˆ5�˜’Ñ Ô × "Ò "Ñ $Ô $¨Ò ,Ð ,Ý  A Ø 'Ð*KØ#)ñ++ñ!+Ø4;ÀFØ&0¸IðGñGôGˆCõ! Ñ%Ô%Ð %õ �d�DÑ !Ô !ð  T¤Y°!¢^ ^Ø�5˜‘;”;Ð Ý ˜�dÑ #Ô #ð  t¤y°A¢~ ~Ø�5˜‘;”;Ð àˆKrErDz (shapes z, z mismatch)z (dtypes rrF)rr có•—|‰ kS©NrD©Úxyrõs €rFrPz&assert_array_compare..Òó ø€ÀÀsÀd €rEz+infcó•—|‰ kSrrDrs €rFrPz&assert_array_compare..ÕrrEz-infÚNaT©r¼rˆz&Mismatched elements: {} / {} ({:.3g}%)rá)r÷©Úoutr¼zMax absolute difference: zMax relative difference: r“zerror during assertion: z )(r¸rôrrõrörèr÷rørùrNÚ asanyarrayÚshaper¼rrVrprrÚsizerœrrÚravelÚsumr rkÚ contextlibÚsuppressrUrÞÚ issubdtypeÚunsignedintegerÚminimumÚgetattrrŠÚstrrŸrºÚ tracebackÚ format_exc))Ú comparisonrýrr¢r$r£r•Ú equal_nanÚ equal_infròrYrôrrèr÷rørùÚoxÚoyrþrr ÚcondÚreasonrXÚflaggedrWÚreducedÚ n_mismatchÚ n_elementsÚpercent_mismatchÚremarksÚerrorÚerror2Ú max_abs_errorÚnonzeroÚ max_rel_errorr#Úefmtrörõs) ```` @@rFr6r6�sføøøøøø€ðÐð/ð/ð/ð/ð/ð/ð/ð/ð/ð/ð/ð/ð/ð/ð/ð/ð/ð/ð/ð/õ Œ �aÑÔ€AÝ Œ �aÑÔ€Að�ˆ€Bð6ð6ð6ð$ð$ð$ð).°eð#ð#ð#ð#ð#ð#ð#ð#ð#ð#ðJkØ ð JØ”7˜aœgÒ%Ð<¨!¬'°Q´WÒ*<ˆDˆDà”G˜r’MÐ2 Q¤W°¢]ÐI°q´wÀ!Ä'Ò7IˆDØð &ØŒw˜!œ'Ò!Ð!ØD a¤gÐDÐD°´ÐDÐDÐD��àD a¤gÐDÐD°´ÐDÐDÐD�Ý  A Ø 'Ø"(ñ!)à(/¸Ø&0¸Ið GñGôGˆCõ ! Ñ%Ô%Ð %à�%˜‘,”,ˆØ ˆ8�A‰;Œ;ð O˜8˜8 A™;œ;ð OØð OØ.Ð.¨q°!¸%ÈÐNÑNÔN�àð ?ØÐ/Ð/°°1Ø5JÐ5JÐ5JÐ5JØ7=ð?ñ?ô?ñ?�ðÐ/Ð/°°1Ø5JÐ5JÐ5JÐ5JØ7=ð?ñ?ô?ñ?�øðˆV�A‰YŒYð O˜6˜6 !™9œ9ð Oàð O˜QœWœ\¨Q¬W¬\Ò9Ð9Ø.Ð.¨q°!½%ÈÐNÑNÔN�à Œ<˜!Ò Ð Ø�g�X”;  7 (¤ ˆqˆAàŒv˜Š{ˆ{Ø�ðà ð à ˆFàˆj˜˜AÑÔˆå �c�4Ñ Ô ð !؈DݘS˜E‘l”lˆGˆGà—i’i‘k”kˆGØ—;’;‘=”=ˆDð �4Š<‰<Ø œ¨¯ ª ½$¨ Ñ(?Ô(?Ñ?ˆJØ)0¬¸Ò):Ð):˜œ˜ÀÄ ˆJØ" ZÑ/°*Ñ<Ð à8×?Ò?Ø  Ð,<ñ>ô>ð?ˆGð�˜hÐ'Ñ'Ô'ð Fð FåÔ(­Ñ3Ô3ðFðFÝ  A¡™JœJ�EÝ”} Q¤W­bÔ.@ÑAÔAð=Ý!$ Q¨¡U¡¤˜Ýœ  5¨&°eÐ<Ñ<Ô<Ð<Ø$' C¨¡J¤J�Mݘu g¨wÑ7Ô7¸7ÒBÐBØŸšÐ'BÝ),¨]Ñ);Ô);ñ(<ñ=ô=ð=ð=ð ŸšÐ'BØ)5¨°mÑ)DÔ)Dñ(EñFôFðFð $˜e A¨¢F™mœm�GØ�s˜G˜8‘}”}ðNÝ(-¨c© ¬ ˜ ˜ à(+¨¨E°'¬N½SÀÀ7Ĺ_¼_Ñ,LÑ(MÔ(M˜ ݘu g¨wÑ7Ô7¸7ÒBÐBØŸšÐ'BÝ),¨]Ñ);Ô);ñ(<ñ=ô=ð=ð=ð ŸšÐ'BØ)5¨°mÑ)DÔ)Dñ(EñFôFðFð3FðFðFñFôFðFðFðFðFðFðFøøøðFðFðFðFð Fð Fð Fñ Fô Fð Fð Fð Fð Fð Fð Føøøð Fð Fð Fð Fð< �t˜dŸiši¨Ñ0Ô0Ñ0Ñ 0ˆGÝ  R ¨'Ø(/¸Ø&0¸IðGñGôGˆCõ! Ñ%Ô%Ð %ðU ˆ<øõV ðððØÐÐÐØ×#Ò#Ñ%Ô%ˆØA¨tÐAÐA¸ÐAÐAˆå˜Q ˜F G°WÀVØ",¸ ðCñCôCˆå˜‰oŒoÐðøøøseÁE8R&ÇR&ÇC R&Ê&QËE5QÐ5 QÑQ ÑQÑQ Ñ QÑ R&ÑQÑR&ÑQÑ AR&Ò&AS7c óJ—d}ttj||||d|¬¦«dS)aß Raises an AssertionError if two array_like objects are not equal. Given two array_like objects, check that the shape is equal and all elements of these objects are equal (but see the Notes for the special handling of a scalar). An exception is raised at shape mismatch or conflicting values. In contrast to the standard usage in numpy, NaNs are compared like numbers, no assertion is raised if both objects have NaNs in the same positions. The usual caution for verifying equality with floating point numbers is advised. Parameters ---------- x : array_like The actual object to check. y : array_like The desired, expected object. err_msg : str, optional The error message to be printed in case of failure. verbose : bool, optional If True, the conflicting values are appended to the error message. strict : bool, optional If True, raise an AssertionError when either the shape or the data type of the array_like objects does not match. The special handling for scalars mentioned in the Notes section is disabled. .. versionadded:: 1.24.0 Raises ------ AssertionError If actual and desired objects are not equal. See Also -------- assert_allclose: Compare two array_like objects for equality with desired relative and/or absolute precision. assert_array_almost_equal_nulp, assert_array_max_ulp, assert_equal Notes ----- When one of `x` and `y` is a scalar and the other is array_like, the function checks that each element of the array_like object is equal to the scalar. This behaviour can be disabled with the `strict` parameter. Examples -------- The first assert does not raise an exception: >>> np.testing.assert_array_equal([1.0,2.33333,np.nan], ... [np.exp(0),2.33333, np.nan]) Assert fails with numerical imprecision with floats: >>> np.testing.assert_array_equal([1.0,np.pi,np.nan], ... [1, np.sqrt(np.pi)**2, np.nan]) Traceback (most recent call last): ... AssertionError: Arrays are not equal Mismatched elements: 1 / 3 (33.3%) Max absolute difference: 4.4408921e-16 Max relative difference: 1.41357986e-16 x: array([1. , 3.141593, nan]) y: array([1. , 3.141593, nan]) Use `assert_allclose` or one of the nulp (number of floating point values) functions for these cases instead: >>> np.testing.assert_allclose([1.0,np.pi,np.nan], ... [1, np.sqrt(np.pi)**2, np.nan], ... rtol=1e-10, atol=0) As mentioned in the Notes section, `assert_array_equal` has special handling for scalars. Here the test checks that each value in `x` is 3: >>> x = np.full((2, 5), fill_value=3) >>> np.testing.assert_array_equal(x, 3) Use `strict` to raise an AssertionError when comparing a scalar with an array: >>> np.testing.assert_array_equal(x, 3, strict=True) Traceback (most recent call last): ... AssertionError: Arrays are not equal (shapes (2, 5), () mismatch) x: array([[3, 3, 3, 3, 3], [3, 3, 3, 3, 3]]) y: array(3) The `strict` parameter also ensures that the array data types match: >>> x = np.array([2, 2, 2]) >>> y = np.array([2., 2., 2.], dtype=np.float32) >>> np.testing.assert_array_equal(x, y, strict=True) Traceback (most recent call last): ... AssertionError: Arrays are not equal (dtypes int64, float32 mismatch) x: array([2, 2, 2]) y: array([2., 2., 2.], dtype=float32) TzArrays are not equal)r¢r$r£ròN)r6ÚoperatorÚ__eq__)rýrr¢r$ròrYs rFrr(s?€ð^ÐÝ�œ¨!¨Q¸Ø!(Ð1GØ &ð(ñ(ô(ð(ð(ð(rEc 󈇇‡‡ ‡ ‡ —d}ddlmŠ mŠmŠ ddlmŠddlmŠ ˆˆˆˆ ˆ ˆ fd„}t|||||d‰z‰¬¦«d S) a€ Raises an AssertionError if two objects are not equal up to desired precision. .. note:: It is recommended to use one of `assert_allclose`, `assert_array_almost_equal_nulp` or `assert_array_max_ulp` instead of this function for more consistent floating point comparisons. The test verifies identical shapes and that the elements of ``actual`` and ``desired`` satisfy. ``abs(desired-actual) < 1.5 * 10**(-decimal)`` That is a looser test than originally documented, but agrees with what the actual implementation did up to rounding vagaries. An exception is raised at shape mismatch or conflicting values. In contrast to the standard usage in numpy, NaNs are compared like numbers, no assertion is raised if both objects have NaNs in the same positions. Parameters ---------- x : array_like The actual object to check. y : array_like The desired, expected object. decimal : int, optional Desired precision, default is 6. err_msg : str, optional The error message to be printed in case of failure. verbose : bool, optional If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired are not equal up to specified precision. See Also -------- assert_allclose: Compare two array_like objects for equality with desired relative and/or absolute precision. assert_array_almost_equal_nulp, assert_array_max_ulp, assert_equal Examples -------- the first assert does not raise an exception >>> np.testing.assert_array_almost_equal([1.0,2.333,np.nan], ... [1.0,2.333,np.nan]) >>> np.testing.assert_array_almost_equal([1.0,2.33333,np.nan], ... [1.0,2.33339,np.nan], decimal=5) Traceback (most recent call last): ... AssertionError: Arrays are not almost equal to 5 decimals Mismatched elements: 1 / 3 (33.3%) Max absolute difference: 6.e-05 Max relative difference: 2.57136612e-05 x: array([1. , 2.33333, nan]) y: array([1. , 2.33339, nan]) >>> np.testing.assert_array_almost_equal([1.0,2.33333,np.nan], ... [1.0,2.33333, 5], decimal=5) Traceback (most recent call last): ... AssertionError: Arrays are not almost equal to 5 decimals x and y nan location mismatch: x: array([1. , 2.33333, nan]) y: array([1. , 2.33333, 5. ]) Tr)ÚnumberÚfloat_Ú result_type)r)Úanycó6•— ‰ t|¦«¦«s‰ t|¦«¦«rjt|¦«}t|¦«}||k ¦«sdS|j|jcxkrdkr nn||kS||}||}n#ttf$rYnwxYw‰ |d¦«}t j||¦«}t||z ¦«}‰|j‰ ¦«s|  ‰¦«}|dd‰ zzkS)NFrägð?rÜrÝ) rr÷rrUr„rNrrÞr¼Úastype) rýrÚxinfidÚyinfidr¼ÚzrÚr=rÚnpanyr<r>s €€€€€€rFÚcomparez*assert_array_almost_equal..compareðsDø€ð ؈u•U˜1‘X”X‰Œð  % %­¨a©¬¡/¤/ð ݘq™œ�ݘq™œ�Ø &Ò(×-Ò-Ñ/Ô/ð!Ø ˜5à”6˜QœVÐ(Ð(Ò(Ð( qÒ(Ð(Ð(Ð(Ð(Ø š6�MØ�v�g”J�Ø�v�g”J�øøÝÕ.Ð/ð ð ð Ø ˆDð øøøð � ˜A˜rÑ"Ô"ˆÝ ŒM˜!˜UÑ #Ô #ˆÝ ��A‘‰JŒJˆàˆz˜!œ' 6Ñ*Ô*ð !Ø—’˜Ñ Ô ˆAà�3˜  Ñ)Ñ)Ò)Ð)sƒA&BÁ+B BÂB2Â1B2rÙ)r¢r$r£r•N) r¸r<r=r>Únumpy.core.numerictypesrÚnumpy.core.fromnumericr?r6) rýrrÚr¢r$rYrFr=rrEr<r>s ` @@@@@rFrr�s½øøøøøø€ð\ÐØ6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ø2Ð2Ð2Ð2Ð2Ð2Ø3Ð3Ð3Ð3Ð3Ð3ð*ð*ð*ð*ð*ð*ð*ð*ð*ð*õ4˜ ! Q°ÀØAÀGÑKØð ñ ô ð ð ð rEc óJ—d}ttj||||dd¬¦«dS)ai Raises an AssertionError if two array_like objects are not ordered by less than. Given two array_like objects, check that the shape is equal and all elements of the first object are strictly smaller than those of the second object. An exception is raised at shape mismatch or incorrectly ordered values. Shape mismatch does not raise if an object has zero dimension. In contrast to the standard usage in numpy, NaNs are compared, no assertion is raised if both objects have NaNs in the same positions. Parameters ---------- x : array_like The smaller object to check. y : array_like The larger object to compare. err_msg : string The error message to be printed in case of failure. verbose : bool If True, the conflicting values are appended to the error message. Raises ------ AssertionError If x is not strictly smaller than y, element-wise. See Also -------- assert_array_equal: tests objects for equality assert_array_almost_equal: test objects for equality up to precision Examples -------- >>> np.testing.assert_array_less([1.0, 1.0, np.nan], [1.1, 2.0, np.nan]) >>> np.testing.assert_array_less([1.0, 1.0, np.nan], [1, 2.0, np.nan]) Traceback (most recent call last): ... AssertionError: Arrays are not less-ordered Mismatched elements: 1 / 3 (33.3%) Max absolute difference: 1. Max relative difference: 0.5 x: array([ 1., 1., nan]) y: array([ 1., 2., nan]) >>> np.testing.assert_array_less([1.0, 4.0], 3) Traceback (most recent call last): ... AssertionError: Arrays are not less-ordered Mismatched elements: 1 / 2 (50%) Max absolute difference: 2. Max relative difference: 0.66666667 x: array([1., 4.]) y: array(3) >>> np.testing.assert_array_less([1.0, 2.0, 3.0], [4]) Traceback (most recent call last): ... AssertionError: Arrays are not less-ordered (shapes (3,), (1,) mismatch) x: array([1., 2., 3.]) y: array([4]) TzArrays are not less-orderedF)r¢r$r£r'N)r6r9Ú__lt__)rýrr¢r$rYs rFrrs?€ðPÐÝ�œ¨!¨Q¸Ø!(Ø =Ø#(ð*ñ*ô*ð*ð*ð*rEcó&—t||¦«dSr)Úexec)Úastrr³s rFr#r#^s€ÝˆˆtÑÔÐÐÐrEcób—d}ddl}t|t¦«s)tt t |¦«¦«¦«‚t|t¦«s)tt t |¦«¦«¦«‚||krdSt | ¦« |  d¦«|  d¦«¦«¦«}g}|�r�|  d¦«}|  d¦«rŒ.|  d¦«�r$|g}|  d¦«}|  d¦«r*|  |¦«|  d¦«}|  d¦«stt |¦«¦«‚|  |¦«|rV|  d¦«} |   d¦«r|  | ¦«n|  d| ¦«|dd…|dd…kr�ŒQ| |¦«�Œhtt |¦«¦«‚|sdSd d  |¦« ¦«›�} ||krt| ¦«‚dS) až Test if two strings are equal. If the given strings are equal, `assert_string_equal` does nothing. If they are not equal, an AssertionError is raised, and the diff between the strings is shown. Parameters ---------- actual : str The string to test for equality against the expected string. desired : str The expected string. Examples -------- >>> np.testing.assert_string_equal('abc', 'abc') >>> np.testing.assert_string_equal('abc', 'abcd') Traceback (most recent call last): File "", line 1, in ... AssertionError: Differences in strings: - abc+ abcd? + TrNz z- z? z+ ézDifferences in strings: rR)Údifflibrœr"rVr�rprµÚDifferrFr ÚpopÚ startswithrŠÚinsertÚextendrŸÚrstrip) rÁrÂrYrPÚdiffÚ diff_listÚd1r‚Úd2Úd3rXs rFrrbs}€ð6ÐØ€N€N€Nå �f�cÑ "Ô "ð1Ý�T¥$ v¡,¤,Ñ/Ô/Ñ0Ô0Ð0Ý �g�sÑ #Ô #ð2Ý�T¥$ w¡-¤-Ñ0Ô0Ñ1Ô1Ð1Ø�&ÒÐØˆå �—’Ñ Ô ×(Ò(¨×):Ò):¸4Ñ)@Ô)@Ø×"Ò" 4Ñ(Ô(ñ*ô*ñ +ô +€Dà€IØ ñ'Ø �XŠX�a‰[Œ[ˆØ �=Š=˜Ñ Ô ð Ø Ø �=Š=˜Ñ Ô ñ Ø�ˆAØ—’˜!‘”ˆBØ�}Š}˜TÑ"Ô"ð !Ø—’˜‘ ” � Ø—X’X˜a‘[”[�Ø—=’= Ñ&Ô&ð /Ý$¥T¨"¡X¤XÑ.Ô.Ð.Ø �HŠH�R‰LŒLˆLØð 'Ø—X’X˜a‘[”[�Ø—=’= Ñ&Ô&ð'Ø—H’H˜R‘L”L�L�Là—K’K  2Ñ&Ô&Ð&Ø�!�"�"Œv˜˜A˜B˜BœÒÐÙØ × Ò ˜QÑ Ô Ð Ù Ý�T "™XœXÑ&Ô&Ð&Ø ðØˆØ C b§g¢g¨iÑ&8Ô&8×&?Ò&?Ñ&AÔ&AÐ CÐ C€CØ �ÒÐݘSÑ!Ô!Ð!ðÐrEcó0‡ —ddlm}ddl}|€!tjd¦«}|jd}t j t j  |¦«¦«d}|||¦«}|  ¦«  |¦«}|  d¬¦«}gŠ |rˆ fd„} nd} |D]} |  | | ¬ ¦«Œ|jdkr'|r'td d  ‰ ¦«z¦«‚dSdS) aV Run doctests found in the given file. By default `rundocs` raises an AssertionError on failure. Parameters ---------- filename : str The path to the file for which the doctests are run. raise_on_error : bool Whether to raise an AssertionError when a doctest fails. Default is True. Notes ----- The doctests can be run by the user/developer by adding the ``doctests`` argument to the ``test()`` call. For example, to run all tests (including doctests) for `numpy.lib`: >>> np.lib.test(doctests=True) # doctest: +SKIP r)Úexec_mod_from_locationNräÚ__file__Fr±có.•—‰ |¦«Sr)rŠ)ÚsrXs €rFrPzrundocs..Ìsø€˜Ÿ š  1™ œ €rErzSome doctests failed: %sr“)Únumpy.distutils.misc_utilr]ÚdoctestÚsysÚ _getframeÚ f_globalsÚosrmÚsplitextÚbasenameÚ DocTestFinderr™Ú DocTestRunnerÚrunÚfailuresrVrŸ) ÚfilenameÚraise_on_errorr]rbr�ÚnameÚmÚtestsÚrunnerrÚtestrXs @rFr"r"©s;ø€ð,AÐ@Ð@Ð@Ð@Ð@Ø€N€N€NØÐÝ ŒM˜!Ñ Ô ˆØ”;˜zÔ*ˆÝ Œ7× Ò �BœG×,Ò,¨XÑ6Ô6Ñ 7Ô 7¸Ô :€DØÐ˜t XÑ.Ô.€Aà × !Ò !Ñ #Ô #× (Ò (¨Ñ +Ô +€EØ × "Ò "¨5Ð "Ñ 1Ô 1€Fà €CØðØ%Ð%Ð%Ð%ˆˆàˆàð"ð"ˆØ� Š �4˜Sˆ Ñ!Ô!Ð!Ð!à „˜ÒИ~ÐÝÐ8¸4¿9º9ÀS¹>¼>ÑIÑJÔJÐJðÐÐÐrEcót—ddl}d} | |dd¬¦«}d|jvS#t$rYdSwxYw)z gh-22982 rNÚlscpuT)Úcapture_outputÚtextÚsveF)Ú subprocessrkÚstdoutÚOSError)ryÚcmdÚoutputs rFÚcheck_support_sver~×s`€ð ÐÐÐØ €CðØ—’ °D¸t�ÑDÔDˆØ˜œ Ð%Ð%øÝ ððð؈uˆuðøøøs ˆ )© 7¶7có—eZdZd„ZdS)Ú_Dummycó—dSrrD)Úselfs rFÚnopz _Dummy.nopîs€Ø ˆrEN)r@rArBrƒrDrErFr€r€ís#€€€€€ð ð ð ð ð rEr€rƒcó(—d}tj|i|¤ŽS)aá assert_raises(exception_class, callable, *args, **kwargs) assert_raises(exception_class) Fail unless an exception of class exception_class is thrown by callable when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception. Alternatively, `assert_raises` can be used as a context manager: >>> from numpy.testing import assert_raises >>> with assert_raises(ZeroDivisionError): ... 1 / 0 is equivalent to >>> def div(x, y): ... return x / y >>> assert_raises(ZeroDivisionError, div, 1, 0) T)Ú_dÚ assertRaises)rÀÚkwargsrYs rFrrõs€ð2ÐÝ Œ?˜DÐ + FÐ +Ð +Ð+rEcó2—d}tj||g|¢Ri|¤ŽS)aë assert_raises_regex(exception_class, expected_regexp, callable, *args, **kwargs) assert_raises_regex(exception_class, expected_regexp) Fail unless an exception of class exception_class and with message that matches expected_regexp is thrown by callable when invoked with arguments args and keyword arguments kwargs. Alternatively, can be used as a context manager like `assert_raises`. Notes ----- .. versionadded:: 1.9.0 T)r…ÚassertRaisesRegex)Úexception_classÚexpected_regexprÀr‡rYs rFr(r(s-€ð"ÐÝ Ô  °Ð RÀ4Ð RÐ RÐ RÈ6Ð RÐ RÐRrEc󯇗|€"tjdtjz¦«}ntj|¦«}|j}ddlmŠˆfd„| ¦«D¦«}|D]w} t|d¦«r|j }n|j }n#t$rYŒ/wxYw|  |¦«r/|  d¦«st||||¦«¦«ŒxdS)a  Apply a decorator to all methods in a class matching a regular expression. The given decorator is applied to all public methods of `cls` that are matched by the regular expression `testmatch` (``testmatch.search(methodname)``). Methods that are private, i.e. start with an underscore, are ignored. Parameters ---------- cls : class Class whose methods to decorate. decorator : function Decorator to apply to methods testmatch : compiled regexp or str, optional The regular expression. Default value is None, in which case the nose default (``re.compile(r'(?:^|[\b_\.%s-])[Tt]est' % os.sep)``) is used. If `testmatch` is a string, it is compiled to a regular expression first. Nz(?:^|[\\b_\\.%s-])[Tt]estr)Ú isfunctioncó*•—g|]}‰|¦«¯ |‘ŒSrDrD)Ú.0Ú_mr�s €rFú z$decorate_methods..Gs&ø€Ð@Ð@Ð@�b°°¸B±´Ð@ˆrÐ@Ð@Ð@rEÚcompat_func_nameÚ_)ÚreÚcompilerfÚsepÚ__dict__Úinspectr�ÚvaluesÚhasattrr’r@ÚAttributeErrorÚsearchrSÚsetattr)ÚclsÚ decoratorÚ testmatchÚcls_attrÚmethodsÚfunctionÚfuncnamer�s @rFrr'sø€ð.ÐÝ”JÐ;½b¼fÑDÑEÔEˆ ˆ å”J˜yÑ)Ô)ˆ ØŒ|€Hð#Ð"Ð"Ð"Ð"Ð"à@Ð@Ð@Ð@˜HŸOšOÑ-Ô-Ð@Ñ@Ô@€GØð 8ð 8ˆð Ý�xÐ!3Ñ4Ô4ð -Ø#Ô4��à#Ô,�øøÝð ð ð à ˆHð øøøð × Ò ˜HÑ %Ô %ð 8¨h×.AÒ.AÀ#Ñ.FÔ.Fð 8Ý �C˜ 9 9¨XÑ#6Ô#6Ñ 7Ô 7Ð 7øØ €FsÁ,B  BÂBräcó—tjd¦«}|j|j}}t |d|›d�d¦«}d}t ¦«}||kr|dz }t |||¦«||k°t ¦«|z }d|zS)aG Return elapsed time for executing code in the namespace of the caller. The supplied code string is compiled with the Python builtin ``compile``. The precision of the timing is 10 milli-seconds. If the code will execute fast on this timescale, it can be executed many times to get reasonable timing accuracy. Parameters ---------- code_str : str The code to be timed. times : int, optional The number of times the code is executed. Default is 1. The code is only compiled once. label : str, optional A label to identify `code_str` with. This is passed into ``compile`` as the second argument (for run-time error messages). Returns ------- elapsed : float Total elapsed time in seconds for executing `code_str` `times` times. Examples -------- >>> times = 10 >>> etime = np.testing.measure('for i in range(1000): np.sqrt(i**2)', times=times) >>> print("Time for a single execution : ", etime / times, "s") # doctest: +SKIP Time for a single execution : 0.005 s räz Test name: ryrLrg{®Gáz„?)rcrdÚf_localsrer•rrL) Úcode_strÚtimesÚlabelÚframeÚlocsÚglobsÚcoder¥Úelapseds rFr%r%Vs•€õB ŒM˜!Ñ Ô €EØ”. %¤/ˆ%€Då �8Ð3¨5Ð3Ð3Ð3°VÑ <Ô <€DØ €A݉iŒi€GØ ˆeŠ)ˆ)Ø ˆQ‰ˆÝ ˆT�5˜$ÑÔÐð ˆeŠ)ˆ)õ‰iŒi˜'Ñ!€GØ �‰<ÐrEcó�—tsdSddl}ddl}|jd¦« dd¦«}|}d}|j¦« t j|¦«}td¦«D]}|||¦«}Œtt j|¦«|k¦«|j ¦«n#|j ¦«wxYw~dS)zg Check that ufuncs don't mishandle refcount of object `1`. Used in a few regression tests. TrNi'rˆräé) r3Úgcrår ÚreshapeÚdisablercrKr·r&Úenable) Úopr±rNÚbÚcr¥ÚrcÚjÚds rFÚ_assert_valid_refcountr»„sÝ€õ ð؈tà €I€I€IØÐÐÐàˆŒ �'ÑÔ×"Ò" 3¨Ñ,Ô,€AØ €AØ €Aà€B„J�L„L€LðÝ Œ_˜QÑ Ô ˆÝ�r‘”ð ð ˆAØ��1�a‘”ˆAˆAÝ•” Ñ"Ô" bÒ(Ñ)Ô)Ð)àˆŒ ‰ Œ ˆ ˆ øˆ ˆŒ ‰ Œ ˆ ˆ øøøØ ˆˆs Á AB1Â1CçH¯¼šò×z>c ó懇‡ —d}ddlŠ ˆˆˆ ˆfd„}‰ j|¦«‰ j|¦«}}d‰d›d‰d›�} t|||t|¦«|| ‰¬¦«dS) að Raises an AssertionError if two objects are not equal up to desired tolerance. Given two array_like objects, check that their shapes and all elements are equal (but see the Notes for the special handling of a scalar). An exception is raised if the shapes mismatch or any values conflict. In contrast to the standard usage in numpy, NaNs are compared like numbers, no assertion is raised if both objects have NaNs in the same positions. The test is equivalent to ``allclose(actual, desired, rtol, atol)`` (note that ``allclose`` has different default values). It compares the difference between `actual` and `desired` to ``atol + rtol * abs(desired)``. .. versionadded:: 1.5.0 Parameters ---------- actual : array_like Array obtained. desired : array_like Array desired. rtol : float, optional Relative tolerance. atol : float, optional Absolute tolerance. equal_nan : bool, optional. If True, NaNs will compare equal. err_msg : str, optional The error message to be printed in case of failure. verbose : bool, optional If True, the conflicting values are appended to the error message. Raises ------ AssertionError If actual and desired are not equal up to specified precision. See Also -------- assert_array_almost_equal_nulp, assert_array_max_ulp Notes ----- When one of `actual` and `desired` is a scalar and the other is array_like, the function checks that each element of the array_like object is equal to the scalar. Examples -------- >>> x = [1e-5, 1e-3, 1e-1] >>> y = np.arccos(np.cos(x)) >>> np.testing.assert_allclose(x, y, rtol=1e-5, atol=0) TrNcóL•—‰jj ||‰‰‰¬¦«S)N)ÚrtolÚatolr&)ÚcoreÚnumericÚisclose)rýrrÀr&rNr¿s €€€€rFrFz assert_allclose..compareÚs/ø€ØŒwŒ×&Ò& q¨!°$¸TØ1:ð'ñ<ô<ð >> x = np.array([1., 1e-10, 1e-20]) >>> eps = np.finfo(x.dtype).eps >>> np.testing.assert_array_almost_equal_nulp(x, x*eps/2 + x) >>> np.testing.assert_array_almost_equal_nulp(x, x*eps + x) Traceback (most recent call last): ... AssertionError: X and Y are not equal to 1 ULP (max is 2) TrNzX and Y are not equal to %d ULPz+X and Y are not equal to %d ULP (max is %g)) rårÞÚspacingÚwherer÷r®røÚ nulp_diffrV) rýrÚnulprYrNÚaxÚayÚrefrXÚmax_nulps rFr'r'äsû€ðbÐØÐÐÐØ ˆŒ�‰Œ€BØ ˆŒ�‰Œ€BØ ��”˜H˜BœH R¨"¢W¨b°"Ñ5Ô5Ñ6Ô6Ñ 6€CØ ˆ2Œ6�&�"”&˜˜1™‘+”+ Ò$Ñ %Ô %ð"Ø ˆ2Œ?˜1Ñ Ô ð S  ¤°Ñ!3Ô!3ð SØ3°dÑ:ˆCˆCà�r”v�i¨¨1™oœoÑ.Ô.ˆHØ?À4ÈÐBRÑRˆCݘSÑ!Ô!Ð!ð "ð"rEcó —d}ddl}t|||¦«}|j||k¦«s"td||j|¦«fz¦«‚|S)ai Check that all items of arrays differ in at most N Units in the Last Place. Parameters ---------- a, b : array_like Input arrays to be compared. maxulp : int, optional The maximum number of units in the last place that elements of `a` and `b` can differ. Default is 1. dtype : dtype, optional Data-type to convert `a` and `b` to if given. Default is None. Returns ------- ret : ndarray Array containing number of representable floating point numbers between items in `a` and `b`. Raises ------ AssertionError If one or more elements differ by more than `maxulp`. Notes ----- For computing the ULP difference, this API does not differentiate between various representations of NAN (ULP difference between 0x7fc00000 and 0xffc00000 is zero). See Also -------- assert_array_almost_equal_nulp : Compare two arrays relatively to their spacing. Examples -------- >>> a = np.linspace(0., 1., 100) >>> res = np.testing.assert_array_max_ulp(a, np.arcsin(np.sin(a))) TrNzCArrays are not almost equal up to %g ULP (max difference is %g ULP))rårÈr÷rVrø)r¦r¶Úmaxulpr¼rYrNÚrets rFr)r)#su€ðTÐØÐÐÐÝ �A�q˜%Ñ Ô €CØ ˆ2Œ6�#˜’-Ñ Ô ð4Ýð>à$ f b¤f¨S¡k¤kÐ2ñ3ñ4ô4ð 4ð €JrEc󄇗ddlŠ|r%‰j||¬¦«}‰j||¬¦«}n ‰j|¦«}‰j|¦«}‰j||¦«}‰j|¦«s‰j|¦«rt d¦«‚‰j|g|¬¦«}‰j|g|¬¦«}‰j|‰j|¦«<‰j|‰j|¦«<|j|jkstd|j›d|j›�¦«‚ˆfd„}t|¦«}t|¦«}||||¦«S)anFor each item in x and y, return the number of representable floating points between them. Parameters ---------- x : array_like first input array y : array_like second input array dtype : dtype, optional Data-type to convert `x` and `y` to if given. Default is None. Returns ------- nulp : array_like number of representable floating point numbers between each item in x and y. Notes ----- For computing the ULP difference, this API does not differentiate between various representations of NAN (ULP difference between 0x7fc00000 and 0xffc00000 is zero). Examples -------- # By definition, epsilon is the smallest number such as 1 + eps != 1, so # there should be exactly one ULP between 1 and 1 + eps >>> nulp_diff(1, 1 + np.finfo(x.dtype).eps) 1.0 rNrz'_nulp not implemented for complex arrayz$x and y do not have the same shape: z - cóN•—‰j||z |¬¦«}‰j|¦«S©Nr)r»rÞ)ÚrxÚryÚvdtrWrNs €rFÚ_diffznulp_diff.._diff�s-ø€ØˆrŒz˜"˜R™% sÐ+Ñ+Ô+ˆØˆrŒv�d‰|Œ|ÐrE) rår»Ú common_typer®r„rrrrrºÚ integer_repr)rýrr¼Útr×rÔrÕrNs @rFrÈrÈWs‡ø€ð@ÐÐÐØ ðØ ˆBŒJ�q Ð &Ñ &Ô &ˆØ ˆBŒJ�q Ð &Ñ &Ô &ˆˆà ˆBŒJ�q‰MŒMˆØ ˆBŒJ�q‰MŒMˆàˆŒ�q˜!ÑÔ€AØ€r„�qÑÔðM˜_˜Rœ_¨QÑ/Ô/ðMÝ!Ð"KÑLÔLÐLàˆŒ�!�˜AÐÑÔ€A؈Œ�!�˜AÐÑÔ€Aà”V€A€h€b„hˆq�k„k�NØ”V€A€h€b„hˆq�k„k�Nà Œ7�a”gÒ Ð ÝˆjØœ'˜'˜' 1¤7 7ð,ñ-ô-ð -ðððððõ �a‰Œ€BÝ �a‰Œ€BØ ˆ5��R˜Ñ Ô ÐrEcóŠ—| |¦«}|jdks|||dkz ||dk<n |dkr||z }|S)Nrär)Úviewr)rýrÖÚcomprÔs rFÚ _integer_reprrÞ–sQ€ð �Š�‰Œ€BØ ŒG�qŠLˆLؘB˜r AšvœJÑ&ˆˆ2�Š6‰ ˆ à �Š6ˆ6ؘ‘ˆBà €IrEcóp—ddl}|j|jkr$t||j|jd¦«¦«S|j|jkr$t||j|jd¦«¦«S|j|jkr$t||j|jd¦«¦«Std|j›�¦«‚)zQReturn the signed-magnitude interpretation of the binary representation of x.rNi€ÿÿi€lûÿÿÿzUnsupported dtype ) rår¼Úfloat16rÞÚint16r Úint32rßÚint64rº)rýrNs rFrÙrÙ¥s¶€ðÐÐÐØ„w�"”*ÒÐݘQ ¤¨(¨"¬(°6Ñ*:Ô*:Ñ;Ô;Ð;Ø Œ�B”JÒ Ð Ý˜Q ¤¨(¨"¬(°6Ñ*:Ô*:Ñ;Ô;Ð;Ø Œ�B”JÒ Ð Ý˜Q ¤¨(¨"¬(°6Ñ*:Ô*:Ñ;Ô;Ð;åÐ7¨a¬gÐ7Ð7Ñ8Ô8Ð8rEc#óìK—d}t¦«5}| |¦«}dV—t|¦«dks|�d|›�nd}td|z¦«‚ ddd¦«dS#1swxYwYdS)NTrú when calling rRzNo warning raised)r5ÚrecordršrV)Ú warning_classrorYÚsupr‚Úname_strs rFÚ_assert_warns_contextrê³sæèè€àÐÝ Ñ Ô ðA Ø �JŠJ�}Ñ %Ô %ˆØ ˆˆˆÝ�1‰vŒv˜ŠzˆzØ26Ð2BÐ.¨Ð.Ð.Ð.ȈHÝ Ð!4°xÑ!?Ñ@Ô@Ð @ððAðAðAñAôAðAðAðAðAðAðAðAøøøðAðAðAðAðAðAs“AA)Á)A-Á0A-có¸—|st|¦«S|d}|dd…}t||j¬¦«5||i|¤Žcddd¦«S#1swxYwYdS)a+ Fail unless the given callable throws the specified warning. A warning of class warning_class should be thrown by the callable when invoked with arguments args and keyword arguments kwargs. If a different type of warning is thrown, it will not be caught. If called with all arguments other than the warning class omitted, may be used as a context manager: with assert_warns(SomeWarning): do_something() The ability to be used as a context manager is new in NumPy v1.11.0. .. versionadded:: 1.4.0 Parameters ---------- warning_class : class The class defining the warning that `func` is expected to throw. func : callable, optional Callable to test *args : Arguments Arguments for `func`. **kwargs : Kwargs Keyword arguments for `func`. Returns ------- The value returned by `func`. Examples -------- >>> import warnings >>> def deprecated_func(num): ... warnings.warn("Please upgrade", DeprecationWarning) ... return num*num >>> with np.testing.assert_warns(DeprecationWarning): ... assert deprecated_func(4) == 16 >>> # or passing a func >>> ret = np.testing.assert_warns(DeprecationWarning, deprecated_func, 4) >>> assert ret == 16 rräN©ro)rêr@)rçrÀr‡rs rFr*r*¾s¼€ðZ ð4Ý$ ]Ñ3Ô3Ð3à �Œ7€DØ ���Œ8€DÝ ˜}°4´=Ð AÑ AÔ Að%ð%؈t�TÐ$˜VÐ$Ð$ð%ð%ð%ð%ñ%ô%ð%ð%ð%ð%ð%ð%øøøð%ð%ð%ð%ð%ð%sºAÁAÁAc#óþK—d}tjd¬¦«5}tjd¦«dV—t|¦«dkr|�d|›�nd}t d|›d|›�¦«‚ ddd¦«dS#1swxYwYdS) NT©ræÚalwaysrrårRz Got warningsr˜)ÚwarningsÚcatch_warningsÚ simplefilterršrV)rorYr‚rés rFÚ_assert_no_warnings_contextróôsùèè€àÐÝ Ô ¨Ð -Ñ -Ô -ðA°ÝÔ˜hÑ'Ô'Ð'Ø ˆˆˆÝ ˆq‰6Œ6�AŠ:ˆ:Ø26Ð2BÐ.¨Ð.Ð.Ð.ȈHÝ Ð!?°Ð!?Ð!?¸AÐ!?Ð!?Ñ@Ô@Ð @ð ðAðAðAñAôAðAðAðAðAðAðAðAøøøðAðAðAðAðAðAsšA A2Á2A6Á9A6có´—|st¦«S|d}|dd…}t|j¬¦«5||i|¤Žcddd¦«S#1swxYwYdS)a: Fail if the given callable produces any warnings. If called with all arguments omitted, may be used as a context manager: with assert_no_warnings(): do_something() The ability to be used as a context manager is new in NumPy v1.11.0. .. versionadded:: 1.7.0 Parameters ---------- func : callable The callable to test. \*args : Arguments Arguments passed to `func`. \*\*kwargs : Kwargs Keyword arguments passed to `func`. Returns ------- The value returned by `func`. rräNrì)rór@©rÀr‡rs rFr+r+ÿs·€ð6 ð-Ý*Ñ,Ô,Ð,à �Œ7€DØ ���Œ8€DÝ $¨$¬-Ð 8Ñ 8Ô 8ð%ð%؈t�TÐ$˜VÐ$Ð$ð%ð%ð%ð%ñ%ô%ð%ð%ð%ð%ð%ð%øøøð%ð%ð%ð%ð%ð%s¸A Á AÁAÚbinaryéc #ó‡‡ ‡ K—d}d}td¦«D�]pŠ t‰ dzt‰ dz|¦«¦«D�]GŠ |dk�rˆˆ ˆ fd„}t‰ f‰¬¦«‰ d…}||¦«|‰ ‰ ‰ ‰d fzfV—|¦«}|||‰ ‰ ‰ ‰d fzfV—|d d…|¦«dd …|‰ d z‰ ‰ d z ‰d fzfV—|dd …|¦«d d…|‰ ‰ d z‰ d z ‰d fzfV—|¦«dd …|¦«d d…|‰ ‰ d z‰ d z ‰d fzfV—|¦«d d…|¦«dd …|‰ d z‰ ‰ d z ‰d fzfV—|dk�r!ˆˆ ˆ fd„}ˆˆ ˆ fd„} t‰ f‰¬¦«‰ d…}||¦«| ¦«|‰ ‰ ‰ ‰ ‰d fzfV—|¦«}||| ¦«|‰ ‰ ‰ ‰ ‰dfzfV—| ¦«}||¦«||‰ ‰ ‰ ‰ ‰dfzfV—|d d…|¦«dd …| ¦«dd …|‰ d z‰ ‰ ‰ d z ‰d fzfV—|dd …|¦«d d…| ¦«dd …|‰ ‰ d z‰ ‰ d z ‰d fzfV—|dd …|¦«dd …| ¦«d d…|‰ ‰ ‰ d z‰ d z ‰d fzfV—|¦«d d…|¦«dd …| ¦«dd …|‰ d z‰ ‰ ‰ d z ‰d fzfV—|¦«dd …|¦«d d…| ¦«dd …|‰ ‰ d z‰ ‰ d z ‰d fzfV—|¦«dd …|¦«dd …| ¦«d d…|‰ ‰ ‰ d z‰ d z ‰d fzfV—�ŒI�ŒrdS)aÓ generator producing data with different alignment and offsets to test simd vectorization Parameters ---------- dtype : dtype data type to produce type : string 'unary': create data for unary operations, creates one input and output array 'binary': create data for unary operations, creates two input and output array max_size : integer maximum size of data to produce Returns ------- if type is 'unary' yields one output, one input array and a message containing information on the data if type is 'binary' yields one output array, two input array and a message containing information on the data z,unary offset=(%d, %d), size=%d, dtype=%r, %sz1binary offset=(%d, %d, %d), size=%d, dtype=%r, %sr—rOÚunarycó6•—t‰‰¬¦«‰d…SrÓ©r ©r¼Úor`s€€€rFrPz%_gen_alignment_data..Asø€�f Q¨eÐ4Ñ4Ô4°Q°R°RÔ8€rErNz out of placezin placerär\Úaliasedröcó6•—t‰‰¬¦«‰d…SrÓrûrüs€€€rFrPz%_gen_alignment_data..Oóø€�v a¨uÐ5Ñ5Ô5°a°b°bÔ9€rEcó6•—t‰‰¬¦«‰d…SrÓrûrüs€€€rFrPz%_gen_alignment_data..PrrEz in place1z in place2)r·rør ) r¼rpÚmax_sizeÚufmtÚbfmtÚinprrºÚinp1Úinp2rýr`s ` @@rFÚ_gen_alignment_datar#sœøøøèè€ð2 :€DØ >€DÝ �1‰XŒXð';ñ';ˆÝ�q˜1‘u�c ! a¡%¨Ñ2Ô2Ñ3Ô3ð& ;ñ& ;ˆAØ�wЉØ8Ð8Ð8Ð8Ð8Ð8�ݘQ˜D¨Ð.Ñ.Ô.¨q¨r¨rÔ2�ؘ3˜3™5œ5 $¨!¨Q°°5¸.Ð)IÑ"IÐIÐIÐIÐIØ�C‘E”E�ؘ˜D A q¨!¨U°JÐ#?Ñ?Ð?Ð?Ð?Ð?ؘ!˜"˜"”g˜s˜s™uœu S b Sœz¨4ؘ‘U˜A˜q 1™u e¨^Ð<ñ,=ð=ð=ð=ð=à˜#˜2˜#”h  ¡¤ a b b¤ ¨4ؘ˜A™˜q 1™u e¨^Ð<ñ,=ð=ð=ð=ð=à�c‘e”e˜C˜R˜C”j # #¡%¤%¨¨¨¤)¨Tؘ˜A™˜q 1™u e¨YÐ7ñ.8ð8ð8ð8ð8à�c‘e”e˜A˜B˜B”i  ¡¤ s¨ s¤¨Tؘ‘U˜A˜q 1™u e¨YÐ7ñ.8ð8ð8ð8ð8à�xÒÑØ9Ð9Ð9Ð9Ð9Ð9�Ø9Ð9Ð9Ð9Ð9Ð9�ݘQ˜D¨Ð.Ñ.Ô.¨q¨r¨rÔ2�ؘ4˜4™6œ6 4 4¡6¤6¨Dؘ˜1˜a ¨Ð7ñ-8ð8ð8ð8ð8à�D‘F”F�ؘ˜D˜D™FœF Dؘ˜1˜a ¨ Ð4ñ%5ð5ð5ð5ð5à�D‘F”F�ؘ˜™œ  Dؘ˜1˜a ¨ Ð4ñ%5ð5ð5ð5ð5à˜!˜"˜"”g˜t˜t™vœv c r cœ{¨D¨D©F¬F°3°B°3¬K¸Ø˜‘U˜A˜q ! a¡%¨°Ð?ñ:@ð@ð@ð@ð@à˜#˜2˜#”h  ¡¤ q r r¤ ¨D¨D©F¬F°3°B°3¬K¸Ø˜˜A™˜q ! a¡%¨°Ð?ñ:@ð@ð@ð@ð@à˜#˜2˜#”h  ¡¤ s¨ s¤ ¨T¨T©V¬V°A°B°B¬Z¸Ø˜˜1˜q™5 ! a¡%¨°Ð?ñ:@ð@ð@ð@ð@à�d‘f”f˜Q˜R˜R”j $ $¡&¤&¨¨"¨¤+¨t¨t©v¬v°c°r°c¬{¸Dؘ‘U˜A˜q ! a¡%¨° Ð:ñ=;ð;ð;ð;ð;à�d‘f”f˜S˜b˜S”k 4 4¡6¤6¨!¨"¨"¤:¨t¨t©v¬v°c°r°c¬{¸Dؘ˜A™˜q ! a¡%¨° Ð:ñ=;ð;ð;ð;ð;à�d‘f”f˜S˜b˜S”k 4 4¡6¤6¨#¨2¨#¤;°°±´°q°r°r´ ¸Dؘ˜1˜q™5 ! a¡%¨° Ð:ñ=;ð;ð;ð;ð;ùñK& ;ð';ð';rEcó—eZdZdZdS)r-z/Ignoring this exception due to disabled featureNr?rDrErFr-r-hs€€€€€Ø5Ð5Ø€DrEr-c/ó†K—t|i|¤Ž} |V—tj|¦«dS#tj|¦«wxYw)z�Context manager to provide a temporary test folder. All arguments are passed as this to the underlying tempfile.mkdtemp function. N)rÚshutilÚrmtree)rÀr‡Útmpdirs rFr1r1msTèè€õ�dÐ %˜fÐ %Ð %€FðØˆ ˆ ˆ åŒ �fÑÔÐÐÐø�Œ �fÑÔÐÐøøøs �*ªAc/ó´K—t|i|¤Ž\}}tj|¦« |V—tj|¦«dS#tj|¦«wxYw)açContext manager for temporary files. Context manager that returns the path to a closed temporary file. Its parameters are the same as for tempfile.mkstemp and are passed directly to that function. The underlying file is removed when the context is exited, so it should be closed at that time. Windows does not allow a temporary file to be opened if it is already open, so the underlying file must be closed after opening before it can be opened again. N)rrfÚcloseÚremove)rÀr‡Úfdrms rFr0r0|s\èè€õ˜Ð' Ð'Ð'�H€BˆÝ„HˆR�L„L€LðØˆ ˆ ˆ å Œ �$‰Œˆˆˆø�Œ �$‰Œˆˆøøøs §AÁAcó<‡—eZdZdZdZdˆfd„ Zˆfd„Zˆfd„ZˆxZS)r.a< Context manager that resets warning registry for catching warnings Warnings can be slippery, because, whenever a warning is triggered, Python adds a ``__warningregistry__`` member to the *calling* module. This makes it impossible to retrigger the warning in this module, whatever you put in the warnings filters. This context manager accepts a sequence of `modules` as a keyword argument to its constructor and: * stores and removes any ``__warningregistry__`` entries in given `modules` on entry; * resets ``__warningregistry__`` to its previous state on exit. This makes it possible to trigger any warning afresh inside the context manager without disturbing the state of warnings outside. For compatibility with Python 3.0, please consider all arguments to be keyword-only. Parameters ---------- record : bool, optional Specifies whether warnings should be captured by a custom implementation of ``warnings.showwarning()`` and be appended to a list returned by the context manager. Otherwise None is returned by the context manager. The objects appended to the list are arguments whose attributes mirror the arguments to ``showwarning()``. modules : sequence, optional Sequence of modules for which to reset warnings registry on entry and restore on exit. To work correctly, all 'ignore' filters should filter by one of these modules. Examples -------- >>> import warnings >>> with np.testing.clear_and_catch_warnings( ... modules=[np.core.fromnumeric]): ... warnings.simplefilter('always') ... warnings.filterwarnings('ignore', module='np.core.fromnumeric') ... # do something that raises a warning but ignore those in ... # np.core.fromnumeric rDFc󲕗t|¦« |j¦«|_i|_t ¦« |¬¦«dS)Nrî)ÚsetÚunionÚ class_modulesÚmodulesÚ_warnreg_copiesÚsuperÚ__init__)r‚rærÚ __class__s €rFrz!clear_and_catch_warnings.__init__¾sJø€Ý˜7‘|”|×)Ò)¨$Ô*<Ñ=Ô=ˆŒ Ø!ˆÔÝ ‰Œ×Ò ÐÑ'Ô'Ð'Ð'Ð'rEcóæ•—|jD]I}t|d¦«r7|j}| ¦«|j|<| ¦«ŒJt ¦« ¦«S©NÚ__warningregistry__)rršrÚcopyrÚclearrÚ __enter__)r‚ÚmodÚmod_regrs €rFr!z"clear_and_catch_warnings.__enter__Ãshø€Ø”<ð ð ˆCÝ�sÐ1Ñ2Ô2ð ØÔ1�Ø,3¯LªL©N¬N�Ô$ SÑ)Ø— ’ ‘”�øÝ‰wŒw× Ò Ñ"Ô"Ð"rEcóö•—t¦«j|Ž|jD]Y}t|d¦«r|j ¦«||jvr%|j |j|¦«ŒZdSr)rÚ__exit__rršrr rÚupdate)r‚Úexc_infor"rs €rFr%z!clear_and_catch_warnings.__exit__ËsŒø€Ø�‰ŒÔ˜(Ð#Ð#Ø”<ð Jð JˆCÝ�sÐ1Ñ2Ô2ð 0ØÔ'×-Ò-Ñ/Ô/Ð/Ø�dÔ*Ð*Ð*ØÔ'×.Ò.¨tÔ/CÀCÔ/HÑIÔIÐIøð  Jð JrE)FrD) r@rArBrCrrr!r%Ú __classcell__)rs@rFr.r.’sŠø€€€€€ð(ð(ðR€Mð(ð(ð(ð(ð(ð(ð #ð#ð#ð#ð#ðJðJðJðJðJðJðJðJðJrEr.cój—eZdZdZdd„Zd„Zedddfd„Zeddfd „Zeddfd „Z d „Z d „Z dd œd„Z d„Z dS)r5aÙ Context manager and decorator doing much the same as ``warnings.catch_warnings``. However, it also provides a filter mechanism to work around https://bugs.python.org/issue4180. This bug causes Python before 3.4 to not reliably show warnings again after they have been ignored once (even within catch_warnings). It means that no "ignore" filter can be used easily, since following tests might need to see the warning. Additionally it allows easier specificity for testing warnings and can be nested. Parameters ---------- forwarding_rule : str, optional One of "always", "once", "module", or "location". Analogous to the usual warnings module filter mode, it is useful to reduce noise mostly on the outmost level. Unsuppressed and unrecorded warnings will be forwarded based on this rule. Defaults to "always". "location" is equivalent to the warnings "default", match by exact location the warning warning originated from. Notes ----- Filters added inside the context manager will be discarded again when leaving it. Upon entering all filters defined outside a context will be applied automatically. When a recording filter is added, matching warnings are stored in the ``log`` attribute as well as in the list returned by ``record``. If filters are added and the ``module`` keyword is given, the warning registry of this module will additionally be cleared when applying it, entering the context, or exiting it. This could cause warnings to appear a second time after leaving the context if they were configured to be printed once (default) and were already printed before the context was entered. Nesting this context manager will work as expected when the forwarding rule is "always" (default). Unfiltered and unrecorded warnings will be passed out and be matched by the outer level. On the outmost level they will be printed (or caught by another warnings context). The forwarding rule argument can modify this behaviour. Like ``catch_warnings`` this context manager is not threadsafe. Examples -------- With a context manager:: with np.testing.suppress_warnings() as sup: sup.filter(DeprecationWarning, "Some text") sup.filter(module=np.ma.core) log = sup.record(FutureWarning, "Does this occur?") command_giving_warnings() # The FutureWarning was given once, the filtered warnings were # ignored. All other warnings abide outside settings (may be # printed/error) assert_(len(log) == 1) assert_(len(sup.log) == 1) # also stored in log attribute Or as a decorator:: sup = np.testing.suppress_warnings() sup.filter(module=np.ma.core) # module must match exactly @sup def some_function(): # do something which causes a warning in np.ma.core pass rïcóV—d|_g|_|dvrtd¦«‚||_dS)NF>ÚoncerïÚmoduleÚlocationzunsupported forwarding rule.)Ú_enteredÚ _suppressionsrºÚ_forwarding_rule)r‚Úforwarding_rules rFrzsuppress_warnings.__init__s<€ØˆŒ ð ˆÔà Ð"JÐ JÐ JÝÐ;Ñ<Ô<Ð <Ø /ˆÔÐÐrEcóÀ—ttd¦«rtj¦«dS|jD]+}t|d¦«r|j ¦«Œ,dS)NÚ_filters_mutatedr)ršrðr3Ú _tmp_modulesrr )r‚r,s rFÚ_clear_registriesz#suppress_warnings._clear_registries(sr€Ý •8Ð/Ñ 0Ô 0ð õ Ô %Ñ 'Ô 'Ð 'Ø ˆFðÔ'ð 3ð 3ˆFÝ�vÐ4Ñ5Ô5ð 3ØÔ*×0Ò0Ñ2Ô2Ð2øð 3ð 3rErRNFcó—|rg}nd}|jr»|€tjd||¬¦«nd|j dd¦«dz}tjd|||¬¦«|j |¦«| ¦«|j  ||tj |tj ¦«||f¦«n<|j   ||tj |tj ¦«||f¦«|S)Nrï©ÚcategoryÚmessageú.ú\.ú$©r8r9r,)r.rðÚfilterwarningsr@Úreplacer4Úaddr5Ú_tmp_suppressionsrŠr”r•ÚIr/)r‚r8r9r,ræÚ module_regexs rFÚ_filterzsuppress_warnings._filter4sA€Ø ð ØˆFˆFàˆFØ Œ=ð P؈~ÝÔ'Ø x¸ðBñBôBðBðBð &œ×6Ò6°s¸EÑBÔBÀSÑH� ÝÔ'Ø x¸Ø'ð)ñ)ô)ð)ðÔ!×%Ò% fÑ-Ô-Ð-Ø×&Ò&Ñ(Ô(Ð(à Ô "× )Ò )ؘ7¥B¤J¨w½¼Ñ$=Ô$=¸vÀvÐNñ Pô Pð Pð Pð Ô × %Ò %ؘ7¥B¤J¨w½¼Ñ$=Ô$=¸vÀvÐNñ Pô Pð Pðˆ rEcó8—| |||d¬¦«dS)a§ Add a new suppressing filter or apply it if the state is entered. Parameters ---------- category : class, optional Warning class to filter message : string, optional Regular expression matching the warning message. module : module, optional Module to filter for. Note that the module (and its file) must match exactly and cannot be a submodule. This may make it unreliable for external modules. Notes ----- When added within a context, filters are only added inside the context and will be forgotten when the context is exited. F©r8r9r,ræN©rD©r‚r8r9r,s rFÚfilterzsuppress_warnings.filterMs2€ð( � Š ˜h°ÀØ!ð ñ #ô #ð #ð #ð #rEcó4—| |||d¬¦«S)ai Append a new recording filter or apply it if the state is entered. All warnings matching will be appended to the ``log`` attribute. Parameters ---------- category : class, optional Warning class to filter message : string, optional Regular expression matching the warning message. module : module, optional Module to filter for. Note that the module (and its file) must match exactly and cannot be a submodule. This may make it unreliable for external modules. Returns ------- log : list A list which will be filled with all matched warnings. Notes ----- When added within a context, filters are only added inside the context and will be forgotten when the context is exited. TrFrGrHs rFræzsuppress_warnings.recordds(€ð6�|Š| X°wÀvØ#'ðñ)ô)ð )rEcój—|jrtd¦«‚tj|_tj|_|jdd…t_d|_g|_t¦«|_ t¦«|_ g|_ |j D]y\}}}}}|�|dd…=|€tj d||¬¦«Œ)|j dd¦«dz}tj d|||¬¦«|j  |¦«Œz|jt_| ¦«|S) Nz%cannot enter suppress_warnings twice.Trïr7r:r;r<r=)r.Ú RuntimeErrorrðÚ showwarningÚ _orig_showÚfiltersÚ_filtersrArr4Ú _forwardedÚlogr/r>r@r?r@Ú _showwarningr5)r‚ÚcatÚmessr“r"rRrCs rFr!zsuppress_warnings.__enter__‚sH€Ø Œ=ð HÝÐFÑGÔGÐ Gå"Ô.ˆŒÝ Ô(ˆŒ Øœ=¨¨¨Ô+�ÔàˆŒ Ø!#ˆÔÝ™EœEˆÔÝ™%œ%ˆŒàˆŒà&*Ô&8ð +ð +Ñ "ˆC��q˜#˜s؈ؘ˜˜�F؈{ÝÔ'Ø s°Dð:ñ:ô:ð:ð:ð #œ|×3Ò3°C¸Ñ?Ô?À#ÑE� ÝÔ'Ø s°DØ'ð)ñ)ô)ð)ðÔ!×%Ò% cÑ*Ô*Ð*Ð*Ø#Ô0�ÔØ ×ÒÑ Ô Ð àˆ rEcóˆ—|jt_|jt_| ¦«d|_|`|`dS)NF)rNrðrMrPrOr5r.)r‚r's rFr%zsuppress_warnings.__exit__¢s=€Ø#œ�ÔØœ=�ÔØ ×ÒÑ Ô Ð ØˆŒ Ø ˆOØ ˆMˆMˆMrE)Ú use_warnmsgcóˆ—|j|jzddd…D]Ü\}} } } } t||¦«rÄ|  |jd¦«�¤| €D| �?t ||||fi|¤Ž} |j | ¦«|  | ¦«dS| j  |¦«rD| �?t ||||fi|¤Ž} |j | ¦«|  | ¦«dSŒÝ|j dkr.|€|j ||||g|¢Ri|¤Žn|  |¦«dS|j dkr |j|f}n,|j dkr |j||f}n|j dkr |j|||f}||j vrdS|j  |¦«|€|j ||||g|¢Ri|¤ŽdS|  |¦«dS)Nr\rrïr+r,r-)r/rAÚ issubclassÚmatchrÀrrRrŠr^rSr0rNÚ _orig_showmsgrQr@)r‚r9r8rmÚlinenorWrÀr‡rTr“Úpatternr"ÚrecrXÚ signatures rFrSzsuppress_warnings._showwarningªsz€ðÔ" TÔ%;Ñ;¸T¸T¸r¸Tô*Cð ð Ñ %ˆC��G˜S #å˜8 SÑ)Ô)ð Ø—M’M '¤,¨q¤/Ñ2Ô2Ð>Ø�;à�Ý,¨W°hÀØ-3ð?ð?Ø7=ð?ð?˜àœŸš¨Ñ,Ô,Ð,ØŸ š  3™œ˜Ø�F�Fð”\×,Ò,¨XÑ6Ô6ðà�Ý,¨W°hÀØ-3ð?ð?Ø7=ð?ð?˜àœŸš¨Ñ,Ô,Ð,ØŸ š  3™œ˜Ø�F�Føð Ô  HÒ ,Ð ,ØÐ"Ø�” ¨°8¸Vð1Ø!%ð1ð1ð1Ø)/ð1ð1ð1ð1ð×"Ò" ;Ñ/Ô/Ð/Ø ˆFà Ô  FÒ *Ð *Ø œ xÐ0ˆIˆIØ Ô " hÒ .Ð .Ø œ x°Ð:ˆIˆIØ Ô " jÒ 0Ð 0Ø œ x°¸6ÐBˆIà ˜œÐ 'Ð 'Ø ˆFØ Œ×Ò˜IÑ&Ô&Ð&Ø Ð Ø ˆDŒO˜G X¨x¸ð &À$ð &ð &ð &Ø$ð &ð &ð &ð &ð &ð × Ò ˜{Ñ +Ô +Ð +Ð +Ð +rEcó@‡‡—t‰¦«ˆˆfd„¦«}|S)z_ Function decorator to apply certain suppressions to a whole function. cóL•—‰5‰|i|¤Žcddd¦«S#1swxYwYdSrrD)rÀr‡rr‚s €€rFÚnew_funcz,suppress_warnings.__call__..new_funcâsø€àð -ð -Ø�t˜TÐ, VÐ,Ð,ð -ð -ð -ð -ñ -ô -ð -ð -ð -ð -ð -ð -øøøð -ð -ð -ð -ð -ð -s „™ ©r)r‚rrbs`` rFÚ__call__zsuppress_warnings.__call__Ýs;øø€õ ˆt‰Œð -ð -ð -ð -ð -ñ Œð -ðˆrE)rï)r@rArBrCrr5ÚWarningrDrIrær!r%rSrdrDrErFr5r5Ôsꀀ€€€ðHðHðR0ð0ð0ð0ð 3ð 3ð 3ð '°¸4Èððððð2&¨r¸$ð#ð#ð#ð#ð.&¨r¸$ð)ð)ð)ð)ð<ððð@ððð)-ð1,ð1,ð1,ð1,ð1,ðf ð ð ð ð rEr5c #óTK—d}tsdV—dSttj¦«¦«tj¦«tj¦«} t d¦«D]}tj¦«dkrnŒtd¦«‚tj tj ¦«dV—tj¦«}tj dd…}tj dd…=tj |¦«tj ¦«n;#tj dd…=tj |¦«tj ¦«wxYw|rX|�d|›�nd}td ||t|¦«d d„|D¦«¦«¦«¦«‚dS) NTrˆrz]Unable to fully collect garbage - perhaps a __del__ method is creating more reference cycles?rårRzXReference cycles were found{}: {} objects were collected, of which {} are shown below:{}c 3óÎK—|]`}d t|¦«jt|¦«t j|¦« dd¦«¦«V—ŒadS)z {} object with id={}: {}r“z N)rkrpr@ÚidrÒÚpformatr?)r�rýs rFú z/_assert_no_gc_cycles_context.. szèè€ððð ð 8×>Ò>ݘQ™œÔ(ݘ1™œÝœ qÑ)Ô)×1Ò1°$¸ÑAÔAñôððððððrE)r3r&r±Ú isenabledr³Ú get_debugr·ÚcollectrLÚ set_debugÚ DEBUG_SAVEALLÚgarbager´rVrkršrŸ)rorYÚgc_debugr¥Ún_objects_in_cyclesÚobjects_in_cyclesrés rFÚ_assert_no_gc_cycles_contextrtêsÃèè€àÐõ ðØ ˆˆˆØˆå �BŒL‰NŒNÑÔÐÝ„J�L„L€LÝŒ|‰~Œ~€HðÝ�s‘”ð 6ð 6ˆAÝŒz‰|Œ|˜qÒ Ð Ø�ð!õð5ñ6ô6ð 6õ Œ •RÔ%Ñ&Ô&Ð&Ø ˆˆˆõ!œj™lœlÐÝœJ q q qœMÐå ŒJ�q�q�qˆMÝ Œ �XÑÔÐÝ Œ ‰ Œ ˆ ˆ øõ ŒJ�q�q�qˆMÝ Œ �XÑÔÐÝ Œ ‰ Œ ˆ ˆ øøøàð Ø.2Ð.>Ð* DÐ*Ð*Ð*ÀBˆÝð -ç ŠVØØ#ÝÐ%Ñ&Ô&Ø—’ððð 1ð ñôñôñ ô ñ ô ð ð ð s ÁBDÄ8E có¶—|st¦«S|d}|dd…}t|j¬¦«5||i|¤Žddd¦«dS#1swxYwYdS)a3 Fail if the given callable produces any reference cycles. If called with all arguments omitted, may be used as a context manager: with assert_no_gc_cycles(): do_something() .. versionadded:: 1.15.0 Parameters ---------- func : callable The callable to test. \*args : Arguments Arguments passed to `func`. \*\*kwargs : Kwargs Keyword arguments passed to `func`. Returns ------- Nothing. The result is deliberately discarded to ensure that all cycles are found. rräNrì)rtr@rõs rFr7r7 sº€ð4 ð.Ý+Ñ-Ô-Ð-à �Œ7€DØ ���Œ8€DÝ %¨4¬=Ð 9Ñ 9Ô 9ððØ ˆˆdÐ�fÐÐÐðððñôðððððððøøøððððððs¸ AÁAÁAcóÖ—tj¦«trNtj¦«tj¦«tj¦«tj¦«dSdS)a1 Break reference cycles by calling gc.collect Objects can call other objects' methods (for instance, another object's __del__) inside their own __del__. On PyPy, the interpreter only runs between calls to gc.collect, so multiple calls are needed to completely release all cycles. N)r±rmr2rDrErFr8r8A sQ€õ„J�L„L€LÝðå Œ ‰ Œ ˆ Ý Œ ‰ Œ ˆ Ý Œ ‰ Œ ˆ Ý Œ ‰ Œ ˆ ˆ ˆ ð ðrEc󇇗ddlŠˆˆfd„}|S)z:Decorator to skip a test if not enough memory is availablerNcóB•‡—t‰¦«ˆˆˆfd„¦«}|S)Ncó®•—t‰¦«}|�‰ |¦« ‰|i|¤ŽS#t$r‰ d¦«YdSwxYw)NzMemoryError raised)Úcheck_free_memoryÚskipÚ MemoryErrorÚxfail)r¦ÚkwrXÚ free_bytesrÚpytests €€€rFÚwrapperz3requires_memory..decorator..wrapperX suø€å# JÑ/Ô/ˆC؈ؗ ’ ˜CÑ Ô Ð ð 3Ø�t˜Q�~ "�~�~Ð%øÝð 3ð 3ð 3à— ’ Ð1Ñ2Ô2Ð2Ð2Ð2Ð2ð 3øøøs©1±AÁArc)rr�rr€s` €€rFrŸz"requires_memory..decoratorW s>øø€Ý ˆt‰Œð 3ð 3ð 3ð 3ð 3ð 3ñ Œð 3ðˆrE)r€)rrŸr€s` @rFÚrequires_memoryr‚S s3øø€à€M€M€Mð ð ð ð ð ð ð ÐrEcó*—d}tj |¦«}|�D t|¦«}n'#t$r}t d|›d|›�¦«‚d}~wwxYw|dz ›d|›d�}n#t ¦«}|€d}d }n|dz ›d |dz ›d �}||kr|ndS) zŽ Check whether `free_bytes` amount of memory is currently free. Returns: None if enough memory available, otherwise error message ÚNPY_AVAILABLE_MEMNzInvalid environment variable r˜geÍÍAz@ GB memory required, but environment variable NPY_AVAILABLE_MEM=z setzCould not determine available memory; set NPY_AVAILABLE_MEM environment variable (e.g. NPY_AVAILABLE_MEM=16GB) to run the test.r\z GB memory required, but z GB available)rfÚenvironÚgetÚ _parse_sizerºÚ_get_mem_available)rÚenv_varÚ env_valueÚmem_freer©rXs rFrzrzi s÷€ð "€GÝ” —’˜wÑ'Ô'€IØÐð OÝ" 9Ñ-Ô-ˆHˆHøÝð Oð Oð OÝÐM¸WÐMÐMÈÐMÐMÑNÔNÐ Nøøøøð Oøøøð˜S‘.ð4ð4Ø$-ð4ð4ð4ˆˆõ&Ñ'Ô'ˆà Ð ðˆCðˆHˆHà ‘^ÐYÐY¸hÀs¹lÐYÐYÐYˆCà˜ZÒ'Ð'ˆ3ˆ3¨TÐ1s¥5µ A¿AÁAcó—dddddddddddddd d œ}tjd  d  | ¦«¦«¦«tj¦«}| | ¦«¦«}|r| d ¦«|vrtd|›d�¦«‚tt| d¦«¦«|| d ¦«z¦«S)z3Convert memory size strings ('12 GB' etc.) to floaträièi@BiÊš;lJ)£éii@l)rRr¶rÃrprÄrÚÚkbÚmbÚgbÚtbÚkibÚmibÚgibÚtibz^\s*(\d+|\d+\.\d+)\s*({0})\s*$ú|rOzvalue z not a valid size) r”r•rkrŸÚkeysrBrZÚlowerÚgrouprºr~rç)Úsize_strÚsuffixesÚsize_rerps rFr‡r‡† sú€à˜AØ ¨g¸GØ '°ÀØ G°GÀGðMðM€Hõ ŒjÐ:×AÒAØ �Š�—’‘”Ñ!Ô!ñ#ô#Ý$&¤Dñ*ô*€Gð � Š �h—n’nÑ&Ô&Ñ'Ô'€AØ ðA�—’˜‘ ”  (Ð*Ð*ÝÐ? (Ð?Ð?Ð?Ñ@Ô@Ð@Ý �u�Q—W’W˜Q‘Z”ZÑ Ô  8¨A¯GªG°A©J¬JÔ#7Ñ7Ñ 8Ô 8Ð8rEcóú— ddl}| ¦«jS#ttf$rYnwxYwt j d¦«r¦i}td¦«5}|D]\}|  ¦«}t|d¦«dz||d  d¦«  ¦«<Œ] ddd¦«n #1swxYwYd|vr|dS|d |d zSdS) z5Return available memory in bytes, or None if unknown.rNrwz /proc/meminforär�ú:Ú memavailableÚmemfreeÚcached) ÚpsutilÚvirtual_memoryÚ availableÚ ImportErrorr›rcÚplatformrSr{r}r~Ústripr˜)r¢Úinfor�ÚlineÚps rFrˆrˆ– sc€ð ؈ ˆ ˆ Ø×$Ò$Ñ&Ô&Ô0Ð0øÝ �Ð (ð ð ð Ø ˆð øøøõ „|×Ò˜wÑ'Ô'ð 4ØˆÝ �/Ñ "Ô "ð A aØð Að A�Ø—J’J‘L”L�Ý03°A°a´D± ´ ¸DÑ0@��Q�q”T—Z’Z ‘_”_×*Ò*Ñ,Ô,Ñ-Ð-ð Að Að Að Añ Aô Að Að Að Að Að Að Aøøøð Að Að Að Að ˜TÐ !Ð !à˜Ô'Ð 'à˜ ”? T¨(¤^Ñ3Ð 3à ˆ4s‚Ÿ3²3Á&A CÃCÃCcój‡—ttd¦«s‰St‰¦«ˆfd„¦«}|S)zµ Decorator to temporarily turn off tracing for the duration of a test. Needed in tests that check refcounting, otherwise the tracing itself influences the refcounts Úgettracec󾕗tj¦«} tjd¦«‰|i|¤Žtj|¦«S#tj|¦«wxYwr)rcr¬Úsettrace)rÀr‡Úoriginal_tracers €rFr�z_no_tracing..wrapper· s^ø€å œ\™^œ^ˆNð -Ý” ˜TÑ"Ô"Ð"Ø�t˜TÐ, VÐ,Ð,å” ˜^Ñ,Ô,Ð,Ð,ø•” ˜^Ñ,Ô,Ð,Ð,øøøs –AÁA)ršrcr)rr�s` rFÚ _no_tracingr°® sLø€õ •3˜ Ñ #Ô #ð Øˆ å ˆt‰Œð -ð -ð -ð -ñ Œð -ðˆrEcóˆ— tjd¦« d¦«d}n#t$rd}YnwxYw|S)NÚCS_GNU_LIBC_VERSIONryräú0.0)rfÚconfstrÚrsplitr)Úvers rFÚ_get_glibc_versionr· sW€ðÝŒjÐ.Ñ/Ô/×6Ò6°sÑ;Ô;¸AÔ>ˆˆøÝ ðððØˆˆˆðøøøð €Js ‚-0° ?¾?có.—tdko t|kS)Nr³)Ú _glibcverrüs rFrPrPÌ s€�y¨EÒ1ÐCµiÀ!²m€rE)rR)Nr\NN)rrr)r�TrŽr‘)rRT)rÖrRT)rRTrRrñTT)rñrRT)NTr)räN)r¼rTrRT)rä)vrCrfrcr¦r”r±r9rðÚ functoolsrrr rÚtempfilerrÚ unittest.caserrrÒÚ sysconfigrårNr¸r r r r r rrrrrrÚnumpy.linalg.lapack_liteÚiorÚ__all__rr/ÚKnownFailureTestr$rlr4Úimplementationror2ršr:r!r3ÚlinalgÚ lapack_liteÚ_ilp64r9r;r<Úget_config_varÚ_vr&rqr Úgetpidrrrr!Ú_no_nep50_warningrrr6rrrr#rr"r~r=ÚunittestÚTestCaser€r…rr(rr%r»r,r'r)rÈrÞrÙÚcontextmanagerrêr*rór+rr-r1r0rñr.r5rtr7r8r‚rzr‡rˆr°r·r¹Ú_glibc_older_thanrDrErFúrÎs�ðððð € € € Ø € € € Ø€€€Ø € € € Ø € € € Ø€€€Ø€€€Ø$Ð$Ð$Ð$Ð$Ð$Ð$Ð$Ø € € € ØÐÐÐØ%Ð%Ð%Ð%Ð%Ð%Ð%Ð%Ø"Ð"Ð"Ð"Ð"Ð"Ø#Ð#Ð#Ð#Ð#Ð#Ø € € € ØÐÐÐàÐÐÐðFðFðFðFðFðFðFðFðFðFðFðFðFðFðFðFðFðFðFðFà(Ð(Ð(Ð(Ð(Ð(Ð(Ð(Ð(Ð(ØÐÐÐàÐÐÐÐÐð ð ð €ð  ð ð ð ð ˜Iñ ô ð ð )ÐØ €à ˆ(Ô Ñ Ô Ð 4Ð 4€Ø Ô Ô ! VÒ +€Ø ˆG�CÐ.Ñ /Ô /€ ؈w�s˜M¨4Ñ0Ô0¸Ð<ÐNÀYÀ€ ØŒ|Ô'Ô.€ à>Ð>€à €ð €YÔ˜oÑ.Ô.Ð4°"€Ø ˆR€<€<Ø€Gð#ð#ð#ð#ð(„7ˆd‚?€?à;?Ø?Cð$ð$ð$ð$ð6EðEðEðEðEð  „\�"�1�"Ô˜Ò Ð à ;¨¨¬©¬Ð ;Ð ;Ð ;ð ð ð ð ð ð"ð"ð"ð„<���Ô�wÒÐØ:¨ ¨¬ © ¬ Ð:Ð:Ð:Àrð8ð8ð8ð8ð8ð*ð 4ð 4ð 4ð 4ð+AØGHððððð8]ð]ð]ð]ð@&-ð&-ð&-ðR€ÔÑÔð{/ð{/ð{/ñÔð{/ð|€ÔÑÔØ@BØ $ða"ða"ða"ñÔða"ðH€ÔÑÔØLNØ@Dðcà#(ðcðcðcðcñÔðcðLr(Àðr(ðr(ðr(ðr(ðr(ðj€ÔÑÔðn ðn ðn ñÔðn ðbL*ðL*ðL*ðL*ð^ðððD"ðD"ðD"ðN+Kð+Kð+Kð+Kð\ ð ð ð"Ð!Ñ#Ô#€ ð €€€ð ð ð ð ð ˆXÔ ñ ô ð ð  €VˆE�]„]€ð,ð,ð,ð:SðSðSð*, ð, ð, ð, ð^+ð+ð+ð+ð\ ð ð ð4CGØ(,ðCNðCNðCNðCNðL<"ð<"ð<"ð<"ð~1ð1ð1ð1ðh<ð<ð<ð<ð~ ð ð ð 9ð 9ð 9ð ÔðAðAðAñÔðAð3%ð3%ð3%ðl ÔðAðAðAñÔðAð!%ð!%ð!%ðH&¨H¸rðB;ðB;ðB;ðB;ðJ ð ð ð ð �iñ ô ð ð  Ôð ð ñÔð ð ÔððñÔðð*?Jð?Jð?Jð?Jð?J˜xÔ6ñ?Jô?Jð?JðDSðSðSðSðSñSôSðSðl Ôð0 ð0 ð0 ñÔð0 ðf ð ð ðFððð$ððð,2ð2ð2ð: 9ð 9ð 9ð ððð0ððð(ððð Ð Ñ Ô € ØDÐDÐÐÐrE