,|C&hdZddlZddlZddlZddlmZmZddlmZm Z m Z m Z ddl m Z mZmZddlmZmZGddZGd d ZGd d ZGd dZGddZdZdZGddZGddZGddZdZdZdZdZ dZ!dS)z$ Test functions for limits module. N)finfoiinfo)halfsingledouble longdouble) assert_equalassert_ assert_raises)_discovered_machar _float_maceZdZdZdS)TestPythonFloatctt}tt}tt|t|dSN)rfloatr idselfftypeftype2s s/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib64/python3.11/site-packages/numpy/core/tests/test_getlimits.pytest_singletonzTestPythonFloat.test_singletons:e uRYY6 +++++N__name__ __module__ __qualname__rrrrr#,,,,,rrceZdZdZdS)TestHalfctt}tt}tt|t|dSr)rrr rrs rrzTestHalf.test_singletons:d tRYY6 +++++rNrrrrr"r"r rr"ceZdZdZdS) TestSinglectt}tt}tt|t|dSr)rrr rrs rrzTestSingle.test_singleton:f vRYY6 +++++rNrrrrr%r%r rr%ceZdZdZdS) TestDoublectt}tt}tt|t|dSr)rrr rrs rrzTestDouble.test_singleton!r'rNrrrrr)r) r rr)ceZdZdZdS)TestLongdoublectt}tt}tt|t|dSr)rrr rrs rrzTestLongdouble.test_singleton's>j!!z""RYY6 +++++rNrrrrr,r,&r rr,c |dD]8}tt||t||d|d|d|9dS)N)bitsepsepsnegiexpmachepmaxmaxexpminminexpnegepnexpnmant precision resolutiontinysmallest_normalsmallest_subnormalzfinfo instances  and differ on r getattr)f1f2attrs rassert_finfo_equalrG,sq:HH WR&&D(9(9FFFFFFF H H H H HHrc |dD]8}tt||t||d|d|d|9dS)N)r/r6r4ziinfo instances r@rArB)i1i2rFs rassert_iinfo_equalrK5sm&HHWR&&D(9(9FFFFFFF H H H HHHrc eZdZdZdZdZdS) TestFinfoc Lttgdtjtjtjtjtjg}|D]/\}}tt|t|0tttddS)N)rEf4f8c8c16i4) listzipnpfloat16float32float64 complex64 complex128rGrr ValueErrorrdtsdt1dt2s r test_basiczTestFinfo.test_basic<s3666 BJ BL '(()) 7 7HC uSzz5:: 6 6 6 6j%.....rctjtjd}tjtjd}||ksJdS)Ng?)rVrrXrY)rrDrEs rtest_regression_gh23108z!TestFinfo.test_regression_gh23108EsCXbjoo & & Xbjoo & &RxxxxxxrcGdd}|}tj|tj|jksJdS)Nc2eZdZdZejdZdS)?TestFinfo.test_regression_gh23867..NonHashableWithDtypeNrX)rrr__hash__rVdtyperrrNonHashableWithDtyperfMs$HBHY''EEErri)rVrrh)rrixs rtest_regression_gh23867z!TestFinfo.test_regression_gh23867Lse ( ( ( ( ( ( ( ( ! " "x{{bhqw////////rN)rrrrarcrkrrrrMrM;sA///00000rrMceZdZdZdZdS) TestIinfoc ttgdtjtjtjtjtjtjtj tj g}|D]/\}}tt|t|0tttddS)N)rIrJrSi8u1u2u4u8rO)rTrUrVint8int16int32int64uint8uint16uint32uint64rKrr r\r]s rrazTestIinfo.test_basicVs3+++7BHbh8RY 29>??@@ 7 7HC uSzz5:: 6 6 6 6j%.....rctjd}|D]h}tjd5|d|dz }dddn #1swxYwYtt |j|idS)Nuintignore)overr)rVsctypeserrstater rr4)rtypesTmax_calculateds rtest_unsigned_maxzTestIinfo.test_unsigned_max`s 6" 7 7A(+++ - -!"1! - - - - - - - - - - - - - - - q~ 6 6 6 6 7 7sAA A N)rrrrarrrrrmrmUs2///77777rrmceZdZdZdZdS)TestReprc|d}tttjtj|dS)Nz)iinfo(min=-32768, max=32767, dtype=int16))r reprrVrrurexpecteds rtest_iinfo_reprzTestRepr.test_iinfo_reprhs1>T"(28,,--x88888rc|d}tttjtj|dS)NzMfinfo(resolution=1e-06, min=-3.4028235e+38, max=3.4028235e+38, dtype=float32))r rrVrrXrs rtest_finfo_reprzTestRepr.test_finfo_reprls38T"(2:..//:::::rN)rrrrrrrrrrgs2999;;;;;rrc8ttjtjtjfD]9}t |}t |d}t ||:ttjtj tj fD]9}t|}t|d}t||:tjt5t ddddn #1swxYwYtjt5t ddddn #1swxYwYtjt5ttjdddddS#1swxYwYdS)N g333333?g$@hir)intrVrurvrwrrKrrWrXrYrrGpytestraisesr\)c class_iinfoinstance_iinfo class_finfoinstance_finfos rtest_instancesrrs28RXrx 088Ahh qquu;7777RZRZ 888Ahh qqvv;7777 z " " c  z " " d  z " " bhqkks6 C<<DD D<<EE "FFFc@|jD]\}}t|t||t |drPt|jt||jt|jt||jdS)Nshape)__dict__itemsr rChasattrrrh) discoveredma_likekeyvalues rassert_ma_equalrs )//11CC UUGGS11222 5' " " C ggs&;&;&A B B B ggs&;&;&A B B B CCrctjtdftjtdftjtdffD]"\}}t t ||#tjd5t tj}dddn #1swxYwYtj tjj }|j |j fdkr!|dvrt |tddS|j |j fd kr#|dkrt |td dSdSdS) N @r~all?@rrPpr) rVrWr rXrYrr rrrhitemsizeitr5)rrld_mabytess rtest_known_typesrsdJ " 6J " 6J " 68<<w *5117;;;;  " " "22"2=11222222222222222 HR] # # ,E %,;..5H3D3Dy}----- (EL !\ 1 1erkky~..... 2 1kksB))B-0B-cdtjd5ttj}dddn #1swxYwYtjtjj}t jd5}t jd|j |j fdkr!|dvr|j t|d ksJnQ|j |j fd kr#|d kr|j t|d ksJn|j t|d ksJddddS#1swxYwYdS) zrs] ########222222222222>>>>>>>>>>>>>>>>>>,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, ,,,,,,,, HHHHHH 00000000477777777$;;;;;;;;2CCC///$,!!!!!r