def test_sum_along_second_axis(self): arr = np.zeros(int(44100 * 2.5)) arr = np.column_stack((arr, arr)) ts = AudioSamples(arr, SR44100()) result = ts.sum(axis=1) self.assertIsInstance(result, AudioSamples) self.assertEqual(1, len(result.dimensions)) self.assertIsInstance(result.dimensions[0], TimeDimension)
def test_sum_along_time_axis(self): arr = np.zeros(int(44100 * 2.5)) arr = np.column_stack((arr, arr)) ts = AudioSamples(arr, SR44100()) result = ts.sum(axis=0) self.assertIsInstance(result, np.ndarray) self.assertNotIsInstance(result, AudioSamples) self.assertEqual(1, len(result.dimensions)) self.assertIsInstance(result.dimensions[0], IdentityDimension)