1judZddlZddlZddlZddlmZmZddlZddlZ ddl m Z m Z m Z GddZGddZGd d ZGd d ZdS) z; Test the scalar constructors, which also do type-coercion N)AnyType) assert_equal assert_raisesIS_MUSLceZdZejdejejej ej gejdgddZ ejdejejej ej gdZ ejdejejej ej gdZ dZejdejgd gd fejgd gd fej gd gdfejej gdgdejejej ejej kdejejddggdZdS)TestAsIntegerRatioftypezf, ratio))g?))g)ir ))r)g'@)c\t|||dSN)ras_integer_ratio)selfr fratios x/builddir/build/BUILD/cloudlinux-venv-1.0.11/venv/lib64/python3.11/site-packages/numpy/core/tests/test_scalar_methods.py test_smallzTestAsIntegerRatio.test_smalls. UU1XX..00%88888ctj}t|dd||dt|dd||dt|dd||dt|dd||d dS) Nrrr rg@g?igh) fractionsFractionrr)rr Rs rtest_simple_fractionsz(TestAsIntegerRatio.test_simple_fractionss  QQq!WWQc 33556 8 8 8QQq!WWQc 33556 8 8 8QQq!WWQc 33556 8 8 8QQua[[Qg7799: < < < < L?gFO?)ri3is)r gMJ;?gޫ_?gКAQ?g8O?)rii7irizlong double is same as double)reasonppczIBM double double)marksc t||D]\}}tj|||}|j|ksJ|\}} tj|} tj|} tj| stn+#ttf$rtj dYnwxYwt| | z |d ||dS)Nz%longdouble too small on this platformz{}/{}) zipr'ldexpdtyper longdoubleisfiniter#RuntimeWarningpytestskiprformat) rr frac_valsexp_valsfracexprndnfdfs rtest_roundtripz!TestAsIntegerRatio.test_roundtripAs8Y11 ; ;ID#tc**A7e####%%''DAq E]1%%]1%%{2(''(!>2 E E E CDDDDD E b!W^^Aq%9%9 : : : : ; ;sAB%CCN)__name__ __module__ __qualname__r;mark parametrizer'r(r)r*r8rrr%r+paramskipiffinfoplatformmachine startswithrFrrr r s [W BIr}'677 [Z* * *   99   779 [W BIr}'677 < <77 < [W BIr}'677AA77A = = =  [9 :::### % >>>((( * >>>,,, .  M ! ! ! + + + ""BHRY''828BM+B+BB:#<< ""$H$&&11%88.#00  <6;;76;;;rr ceZdZejdddgejdejddededdfdZ ejdejdejd zdeddfd Z ejdejddeddfd Z dS) TestIsInteger str_valuer!r"codeFloatreturnNcztj|j}||}|rJdSr)r'r7type is_integer)rrVrUclsvalues r test_specialzTestIsInteger.test_specialos?htnn!I##%%%%%%%r AllIntegerctjdd|}|D]}|sJdS)Nrr'arangeastyper[rrV float_arrayr]s r test_truezTestIsInteger.test_truevsWiA&&--d33   & &E##%% % %% % & &rctjdd|}|dz}|D]}|dkr |rJ dS)Nrarg?rrbres r test_falsezTestIsInteger.test_false~skiA&&--d33 s   * *Ezz'')) ) )) ) * *r) rGrHrIr;rJrKr' typecodesstrr^rgrirRrrrTrTns% [[5%.99 [VR\'%:;;&&&&&&<;:9&  [ W% \(BB&c&d&&&&  [VR\'%:;;*s*t***<;***rrTc eZdZejdejejej ej ej ej gde ejddfdZddZejdeddeddfdZejdejejejgde ejddfd Zejd ejd d eddfd Zejdeddeddfd ZddZdS)TestClassGetItemr\rXNcn|t}t|tjsJ|j|usJdSr)r isinstancetypes GenericAlias __origin__)rr\aliass rtest_abczTestClassGetItem.test_abcs@C%!3444443&&&&&&rctjttf}t|tjsJ|jtjusJdSr)r'complexfloatingrrorprqrr)rrss rtest_abc_complexfloatingz)TestClassGetItem.test_abc_complexfloatingsI"38,%!3444442#5555555rarg_lenctf|z}|dvrtj|sJdSd|dkrdndd}tjt |5tj|ddddS#1swxYwYdS)N)rrzToo rfewmanyz arguments)match)rr'rvr;raises TypeError)rrxarg_tupr}s r(test_abc_complexfloating_subscript_tuplez9TestClassGetItem.test_abc_complexfloating_subscript_tuples&7" f  %g. . .. . .HGqLL55fHHHEy666 , ,"7++ , , , , , , , , , , , , , , , , , ,sA//A36A3ctjt5|tddddS#1swxYwYdSr)r;r~rr)rr\s rtest_abc_non_numericz%TestClassGetItem.test_abc_non_numerics ]9 % %   HH                  s 599rVAllctj|j}tjt 5|t ddddS#1swxYwYdSr)r'r7rZr;r~rr)rrVr\s r test_concretezTestClassGetItem.test_concreteshtnn! ]9 % %   HH                  sAAActf|z}|dkrtj|sJdStjt 5tj|ddddS#1swxYwYdS)Nr)rr'numberr;r~r)rrxrs rtest_subscript_tuplez%TestClassGetItem.test_subscript_tuples&7" a<<9W% % %% % %y)) # # '"" # # # # # # # # # # # # # # # # # #sA!!A%(A%c8tjtsJdSr)r'rr)rs rtest_subscript_scalarz&TestClassGetItem.test_subscript_scalarsy~~r)rXN)rGrHrIr;rJrKr'rintegerinexactunsignedinteger signedintegerfloatingrrtrwrangeintrgenericflexible characterrrjrkrrrrRrrrmrms [U      %'DO''''' 6666  [Ya11,,,,,21, [URZbl$KLLRZ(8TML [VR\%%899#$:9  [Ya11#C#D###21#rrmceZdZejdejdejdzdZdZ dS) TestBitCountityperuintctttj|jddD]V}d|d|d}||t |dks J|WdS)NrzSmoke test for (z ).bit_count()1)rmaxr'iinfomin bit_countbincount)rramsgs rrzTestBitCount.test_smallss28E??.22C88 B BArs8  >>>>>>>>>>\;\;\;\;\;\;\;\;~********422222222jCCCCCCCCCCr