Mercurial > hg > plosone_underreview
comparison tests/test_load_features.py @ 2:dfd984dbfaea branch-tests
started tests
author | Maria Panteli <m.x.panteli@gmail.com> |
---|---|
date | Fri, 01 Sep 2017 19:25:52 +0300 |
parents | |
children | 230a0cf17de0 |
comparison
equal
deleted
inserted
replaced
1:f4ea2872bd62 | 2:dfd984dbfaea |
---|---|
1 # -*- coding: utf-8 -*- | |
2 """ | |
3 Created on Fri Sep 1 19:11:52 2017 | |
4 | |
5 @author: mariapanteli | |
6 """ | |
7 | |
8 import pytest | |
9 | |
10 import numpy as np | |
11 | |
12 import load_features | |
13 | |
14 feat_loader = load_features.FeatureLoader(win2sec=8) | |
15 | |
16 def test_get_music_idx_from_bounds(): | |
17 bounds = np.array([['0', '10.5', 'm'], | |
18 ['10.5', '12.0', 's'], | |
19 ['12.0', '30.0', 'm']]) | |
20 sr = feat_loader.framessr2 | |
21 music_bounds = feat_loader.get_music_idx_from_bounds(bounds, sr=sr) | |
22 music_bounds_true = np.arange(np.round(sr * np.float(bounds[-1, 1]))) | |
23 assert np.array_equal(music_bounds, music_bounds_true) | |
24 | |
25 test_get_music_idx_from_bounds() |