diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d23c07b524544f20bf03ef052a9f8867035425bf..16d0daf6b3c09b609fc5658877c3387ca163b493 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ tests: - pip3 install --no-deps . - python3 -c "from tffpy.utils import generate_config; generate_config()" - pwd - - python3 -c "from configparser import ConfigParser; from pathlib import Path; config.read('/root/.config/tffpy.conf'); config.set('DATA', 'data_path', str(Path(__file__.parent / 'data')); config + - python3 -c "from configparser import ConfigParser; from pathlib import Path; config.read('/root/.config/tffpy.conf'); config.set('DATA', 'data_path', '/builds/skmad-suite/tff2020/data'); config.write(open('/root/.config/tffpy.conf', 'w'))" - pytest-3 # generate the documentation @@ -25,9 +25,7 @@ pages: - pip3 install --no-deps . - python3 setup.py build_sphinx - python3 -c "from tffpy.utils import generate_config; generate_config()" - - pwd - - python3 -c "from configparser import ConfigParser; from pathlib import Path; config.read('/root/.config/tffpy.conf'); config.set('DATA', 'data_path', str(Path(__file__.parent / 'data')); config - - .write(open('/root/.config/tffpy.conf', 'w'))" + - python3 -c "from configparser import ConfigParser; from pathlib import Path; config.read('/root/.config/tffpy.conf'); config.set('DATA', 'data_path', '/builds/skmad-suite/tff2020/data'); config.write(open('/root/.config/tffpy.conf', 'w'))" - cp -r build/sphinx/html public artifacts: paths: diff --git a/python/tffpy/tf_tools.py b/python/tffpy/tf_tools.py index 9baa89a8ec9d9df65a6fddbad316dea0b56c1c58..a3dd2d548d243684e84d71e81440c18f9206530f 100755 --- a/python/tffpy/tf_tools.py +++ b/python/tffpy/tf_tools.py @@ -15,6 +15,28 @@ from tffpy.utils import plot_mask, plot_win def get_dgt_params(win_type, approx_win_len, hop, n_bins, phase_conv='freqinv', sig_len=None): + """ + Build dictionary of DGT parameter + + Parameters + ---------- + win_type : str + Window name, e.g. 'hann', 'gauss' + approx_win_len : int + Approximate window length for FIR windows and + hop : int + Hop size + n_bins : int + Number of frequency bins + phase_conv : + Phase convention + sig_len : int + Signal length + + Returns + ------- + + """ supported_wins = arg_firwin() | {'gauss'} msg = '{} not supported, try {}'.format(win_type, supported_wins) assert win_type in supported_wins, msg