gL iQ PddlZddlZddlmZmZddlmZddl m Z GddZ y)N)Index date_rangecartesian_productc eZdZdZdZdZdZejjdgggddgggggdggd Z d Z ejjd ddgdd gdgd gd d gd dgd gdggdZ dZ y)TestCartesianProductctdddg}}t||g\}}tjgd}tjgd}t j ||t j ||y)NABC)Ar BrCr)r r r r r r )listrnparraytmassert_numpy_array_equal)selfxyresult1result2 expected1 expected2s d/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pandas/tests/reshape/test_util.py test_simplez TestCartesianProduct.test_simple sdE{QG1,aV4HH;< HH23  ##GY7 ##GY7ctdd}dt||gD\}}tgdtj}tgdtj}t j ||t j ||y)N 2000-01-01)periodsc3FK|]}t|jywN)rday).0rs r z:TestCartesianProduct.test_datetimeindex..sLQE!HLLLs!)r r r!r!dtype)r r!r r!)rrrrint32rassert_index_equal)rrrrrrs rtest_datetimeindexz'TestCartesianProduct.test_datetimeindexsi |Q /L2CQF2KL,bhh7 ,bhh7  gy1 gy1rctddd}tjddg}t||g\}}|j d}t j ||y)Nr r! US/Pacificr"tz)rrrrrepeatrr+rrrrrexpecteds rtest_tzaware_retainedz*TestCartesianProduct.test_tzaware_retainedsR |Q< @ HHaV ,aV488A; gx0rctdddjd}tjddg}t ||g\}}|j d}t j||y)Nr r!r.r/categoryr1r2)rastyperrrr3rr+r4s r!test_tzaware_retained_categoricalz6TestCartesianProduct.test_tzaware_retained_categorical's] |Q< @ G G S HHaV ,aV488A; gx0rzx, yrr )abccLtjgtj|j}tjgtj|j}t ||g\}}t j ||t j ||y)Nr()rrasarrayr)rrr)rrrrrrrs r test_emptyzTestCartesianProduct.test_empty/ssHHRrzz!}':':; HHRrzz!}':':; ,aV4 ##GY7 ##GY7rc,tg}g}||k(sJyr$r)rresultr5s rtest_empty_inputz%TestCartesianProduct.test_empty_input8s"2&!!!rXr!r;r<cd}tjt|5t|dddy#1swYyxYw)Nz'Input must be a list-like of list-likesmatchrD)pytestraises TypeErrorr)rrDmsgs rtest_invalid_inputz'TestCartesianProduct.test_invalid_input>s48 ]]9C 0 #  " # # #s 4=c Rd}tjt|5tdDcgc](}t j ddtj *c}t j dtj gz}t|dddycc}w#1swYyxYw) Nz+Product space too large to allocate arrays!rF rr r(i;rH)rIrJ ValueErrorrangerarangeint16r)rrLidimss rtest_exceed_product_spacez.TestCartesianProduct.test_exceed_product_spaceGs~; ]]:S 1 &>CBiHBIIa2884H51LD  %  & &H & &sB-B6BBB&N)__name__ __module__ __qualname__rr,r6r:rImark parametrizer@rCrMrVrrrr s8211 [[Vr2h!Q r?>S%TU8V8"  [[ a!q!fsAhcUS#J# M## &rr) numpyrrIpandasrrpandas._testing_testingrpandas.core.reshape.utilrrr\rrrbs$ 6C&C&r