o 6˜¿a ã@s*ddlZddlmZmZGdd„dƒZdS)éN)Ú assert_raisesÚassert_raises_regexc@sPeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dS)ÚTestIndexErrorsz9Tests to exercise indexerrors not covered by other tests.cCsbt d¡}tt|jdgddtt|jdgddtt|jdgdddtt|jdgdddd S) ztake from a 0-length dimension)éérérr©ÚaxiséÚwrap)r ÚmodeÚclipN)ÚnpÚemptyrÚ IndexErrorÚtake)ÚselfÚx©rúC/usr/lib/python3/dist-packages/numpy/core/tests/test_indexerrors.pyÚtest_arraytypes_fasttake s z(TestIndexErrors.test_arraytypes_fasttakecCstjdtd}tt|jdgƒtjdtd}tt|jdgddtt|jdgddtt|jdgƒtt|jdgdd tt|jdgd d dS) Né©Údtypeé©rrr rrr )r r )rÚzerosÚobjectrrr)rÚdrrrÚtest_take_from_objectsz%TestIndexErrors.test_take_from_objectcCsxtjdtd}tt|jdƒtjdtd}tt|jdƒtjdtd}tt|jddƒtjdtd}tt|jddƒdS)Nrrér)rrr)rrrrrÚitemÚitemset©rÚarrrÚtest_multiindex_exceptionssz*TestIndexErrors.test_multiindex_exceptionscCstt d¡}tt|jddƒtjdtd}tt|jddƒt d¡}tt|jddƒtjdtd}tt|jddƒdS)N)rrédrr)rrr)rrrrÚputrr#rrrÚtest_put_exceptions*s  z#TestIndexErrors.test_put_exceptionscsÒdd„‰t gd¢¡‰tt‡fdd„ƒtt‡fdd„ƒtt‡‡fdd„ƒtt‡‡fdd„ƒt gd ¢¡‰tt‡fd d„ƒtt‡‡fd d„ƒt gd¢¡‰tt‡fd d„ƒtt‡‡fd d„ƒt gd ¢¡‰tt‡fdd„ƒtt‡‡fdd„ƒt gd¢¡‰tt‡fdd„ƒtt‡‡fdd„ƒt gd ¢¡‰tt‡fdd„ƒtt‡‡fdd„ƒt gd¢¡‰tt‡fdd„ƒtt‡‡fdd„ƒt gd ¢¡‰tt‡fdd„ƒtt‡‡fdd„ƒdS)zcases in iterators.ccSó |||<dS©Nr©ÚobjÚindÚvalrrrÚassign6ó z9TestIndexErrors.test_iterators_exceptions..assign)r rrcóˆdS)N©rrNrrr©r$rrÚ:óz;TestIndexErrors.test_iterators_exceptions..cr1)N©rrrrrrr3rrr4;r5có ˆˆddƒS)Nr2r rr©r$r/rrr4<ó cr7)Nr6r rrr8rrr4=r9)r rrcr1)N©rrNrrrr3rrr4@r5cr7)Nr:r rrr8rrr4Ar9có ˆjdS©Né ©Úflatrr3rrr4Dó cóˆˆjddƒS©Nr=rr>rr8rrr4Eócr;r<r>rr3rrr4Gr@crArBr>rr8rrr4HrCcóˆjt d¡Sr<©r?rÚarrayrr3rrr4Kócóˆˆjt d¡dƒSrBrErr8rrr4LócrDr<rErr3rrr4NrGcrHrBrErr8rrr4OrIcóˆjt dg¡Sr<rErr3rrr4Rócóˆˆjt dg¡dƒSrBrErr8rrr4SócrJr<rErr3rrr4UrKcrLrBrErr8rrr4VrMN©rrrr©rrr8rÚtest_iterators_exceptions4s6z)TestIndexErrors.test_iterators_exceptionscs$dd„‰t d¡‰tt‡fdd„ƒt d¡‰tt‡fdd„ƒtt‡‡fdd„ƒt d ¡‰tt‡fd d„ƒtt‡‡fd d„ƒt d ¡‰tt‡‡fd d„ƒt d¡‰tt‡‡fdd„ƒt d¡‰tt‡fdd„ƒtt‡‡fdd„ƒt d ¡‰tt‡fdd„ƒtt‡‡fdd„ƒdS)zcases from mapping.ccSr)r*rr+rrrr/[r0z,TestIndexErrors.test_mapping..assign)rr=cr1)Né rrr3rrr4_r5z.TestIndexErrors.test_mapping..©rrcr1)N©r=r rrr3rrr4br5cr7)NrSr rrr8rrr4cr9)rrcr1)N©r rrrr3rrr4er5cr7)NrTr rrr8rrr4fr9)r=cr7©Nr=r rrr8rrr4ir9)rcr7rUrrr8rrr4kr9csˆdddgfS©Nr r rrr3rrr4nrGcsˆˆdddgfdƒSrVrrr8rrr4orIcsˆdddgfS©Nr rrrr3rrr4qrGcsˆˆdddgfdƒSrWrrr8rrr4rrINrNrOrr8rÚ test_mappingXs&       zTestIndexErrors.test_mappingcs(t d¡‰d‰ttd‡‡fdd„ƒdS)NrR)r rrrrzFtoo many indices for array: array is 2-dimensional, but 5 were indexedcsˆˆSr*rr©r$Úindexrrr4{r5z.)rrrrrOrrYrÚtest_mapping_error_messagets  üz*TestIndexErrors.test_mapping_error_messagecs`t d¡‰tt‡fdd„ƒtt‡fdd„ƒt d¡‰tt‡fdd„ƒtt‡fdd„ƒdS) zcases from methods.c)rrcó ˆ d¡S©Nr&©r!rr3rrr4r@z.TestIndexErrors.test_methods..có ˆ dd¡S©Nr&r ©r"rr3rrr4‚r9)rrcr\r]r^rr3rrr4„r@cr_r`rarr3rrr4…r9NrNrOrr3rÚ test_methods}s  zTestIndexErrors.test_methodsN) Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr%r(rPrXr[rbrrrrrs   $ r)ÚnumpyrÚ numpy.testingrrrrrrrÚs