コード例 #1
0
ファイル: ndarray.py プロジェクト: LocutusOfBorg/poedit
 def testStridesIndex(self):
     a = numpy.arange(24)
     a.shape = (1,2,3,4)
     def strides_check(i):
         print(i)
         self.assertEqual(ndarray_ext.strides_index(a,i) ,a.strides[i] )
     for i in range(4):
         strides_check(i)
     for i in range(-1,-5,-1):
         strides_check(i)
     try:
         ndarray_ext.strides_index(a,4) # out of bounds -- should raise IndexError
         self.assertTrue(False)
     except IndexError:
         pass
コード例 #2
0
 def testStridesIndex(self):
     a = numpy.arange(24)
     a.shape = (1,2,3,4)
     def strides_check(i):
         print(i)
         self.assertEqual(ndarray_ext.strides_index(a,i) ,a.strides[i] )
     for i in range(4):
         strides_check(i)
     for i in range(-1,-5,-1):
         strides_check(i)
     try:
         ndarray_ext.strides_index(a,4) # out of bounds -- should raise IndexError
         self.assertTrue(False)
     except IndexError:
         pass
コード例 #3
0
ファイル: ndarray.py プロジェクト: LocutusOfBorg/poedit
 def strides_check(i):
     print(i)
     self.assertEqual(ndarray_ext.strides_index(a,i) ,a.strides[i] )
コード例 #4
0
 def strides_check(i):
     print(i)
     self.assertEqual(ndarray_ext.strides_index(a,i) ,a.strides[i] )