Exemplo n.º 1
0
 def test_cutoff(self):
     size = 10
     waveform = np.arange(size, dtype=float)
     for cutoff in (-1, 1):
         # outside of [0, 1) range
         self.assertRaises(ValueError, waveform_features.waveform_width,
                           waveform, cutoff=cutoff)
     for cutoff in np.linspace(0., 1., num=size, endpoint=False):
         width = waveform_features.waveform_width(waveform, cutoff=cutoff)
         self.assertEqual(width, size - 1)
Exemplo n.º 2
0
 def test_np_array(self):
     waveform = np.asarray(self.waveform)
     width = waveform_features.waveform_width(waveform)
     self.assertEqual(width, self.target_width)
Exemplo n.º 3
0
 def test_pq_quantity(self):
     waveform = np.asarray(self.waveform) * pq.mV
     width = waveform_features.waveform_width(waveform)
     self.assertEqual(width, self.target_width)
Exemplo n.º 4
0
 def test_list(self):
     width = waveform_features.waveform_width(self.waveform)
     self.assertEqual(width, self.target_width)