Пример #1
0
 def testNormal(self):
     datasets = [
         [0,2,3,5,6,8],
         [10,12,13,15,16,18],
         [3,5,6,8,9,11]
     ]
     for integ in datasets:
         movement = utils.movement_from_integ(integ)
         np.testing.assert_array_equal(movement, [np.nan,2,1,2,1,2])
Пример #2
0
 def testNumpyMaskedArray(self):
     datasets = [
         [0,2,3,5,6,8],
         [10,12,13,15,16,18],
         [3,5,6,8,9,11]
     ]
     for integ in datasets:
         np_integ = np.array(integ)
         masked_integ = np.ma.masked_array(np_integ, [0,0,1,0,0,0])
         movement = utils.movement_from_integ(masked_integ)
         np.testing.assert_array_equal(movement, np.ma.masked_array([np.nan,2,1,2,1,2], mask=[0,0,1,0,0,0]))