def test_load_beats(): beats_path = ('tests/resources/mir_datasets/RWC-Classical/' + 'annotations/AIST.RWC-MDB-C-2001.BEAT/RM-C003.BEAT.TXT') beat_data = rwc_classical.load_beats(beats_path) # check types assert type(beat_data) is utils.BeatData assert type(beat_data.beat_times) is np.ndarray assert type(beat_data.beat_positions) is np.ndarray # check values assert np.array_equal( beat_data.beat_times, np.array([1.65, 2.58, 2.95, 3.33, 3.71, 4.09, 5.18, 6.28])) assert np.array_equal(beat_data.beat_positions, np.array([2, 1, 2, 1, 2, 1, 2, 1])) # load a file which doesn't exist beats_data_none = rwc_classical.load_beats('fake/path') assert beats_data_none is None
def beats(self): """BeatData: human-labeled beat annotation""" return load_beats(self.beats_path)
def beats(self): """BeatData: human-labeled beat data""" return load_beats(self.beats_path)