コード例 #1
0
 def testKnownEventsEnds(self):
     """Tests the known cases."""
     events, ends = ehfheatwaves.identify_hw(self.ehfdata)
     self.assertTrue((events == self.known_events).all())
     self.assertTrue((ends == self.known_ends).all())
コード例 #2
0
 def testShape(self):
     """The shape of the input EHF index and the outputs should be the same."""
     events, ends = ehfheatwaves.identify_hw(self.ehfdata)
     input_shape = self.ehfdata.shape
     self.assertEqual(events.shape, input_shape)
     self.assertEqual(ends.shape, input_shape)
コード例 #3
0
 def testReturnTupple(self):
     """Should return a tupple containging the event indicator and the durations (numpy.ndarrays)."""
     result = ehfheatwaves.identify_hw(self.ehfdata)
     self.assertIs(tuple, type(result))
     self.assertIs(np.ma.core.MaskedArray, type(result[0]))
     self.assertIs(np.ma.core.MaskedArray, type(result[1]))