def test_load_timestamps_only(self): events = load_onsets(pj(ANNOTATIONS_PATH, 'stereo_sample.notes')) self.assertTrue(np.allclose(events, [0.147, 1.567, 2.526, 2.549, 2.563, 2.577, 3.369, 3.449]))
def test_load_onsets_without_comments(self): from tests.test_evaluation_onsets import SAMPLE_DETECTIONS events = load_onsets(pj(DETECTIONS_PATH, 'sample.super_flux.txt')) self.assertTrue(np.allclose(events, SAMPLE_DETECTIONS))
def test_onsets_with_comments_and_empty_lines(self): events = load_onsets(pj(DATA_PATH, 'commented_txt')) self.assertTrue(np.allclose(events, [1.1, 2.1]))
def test_load_onsets(self): from tests.test_evaluation_onsets import SAMPLE_ANNOTATIONS events = load_onsets(pj(ANNOTATIONS_PATH, 'sample.onsets')) self.assertTrue(np.allclose(events, SAMPLE_ANNOTATIONS))