Changeset 0bae15a for python/tests


Ignore:
Timestamp:
Nov 1, 2018, 10:13:11 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
Children:
0ed0405
Parents:
bb63c19
Message:

[tests] use np.loadtxt in utils

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/utils.py

    rbb63c19 r0bae15a  
    99
    1010def array_from_text_file(filename, dtype = 'float'):
    11     filename = os.path.join(os.path.dirname(__file__), filename)
    12     with open(filename) as f:
    13         lines = f.readlines()
    14     return np.array([line.split() for line in lines],
    15             dtype = dtype)
     11    realpathname = os.path.join(os.path.dirname(__file__), filename)
     12    return np.loadtxt(realpathname, dtype = dtype)
    1613
    1714def list_all_sounds(rel_dir):
Note: See TracChangeset for help on using the changeset viewer.