Commit baf1e618 authored by valentin.emiya's avatar valentin.emiya
Browse files

add tests for experiment

parent a1c7ad32
Pipeline #5116 failed with stage
in 3 minutes and 4 seconds
......@@ -112,6 +112,8 @@ class SolveTffExperiment(Experiment):
data_params['wideband_src'] = 'car'
problem_params['win_choice'] = ['gauss 64', 'hann 128']
problem_params['crop'] = 4096
problem_params['delta_loc_db'] = 20
problem_params['wb_to_loc_ratio_db'] = 16
solver_params['tolerance_arrf'] = 1e-2
solver_params['proba_arrf'] = 1 - 1e-2
......
# -*- coding: utf-8 -*-
"""Test of the module :module:`tffpy.experiments.exp_solve_tff`
.. moduleauthor:: Valentin Emiya
"""
import unittest
import matplotlib.pyplot as plt
from tffpy.experiments.exp_solve_tff import \
SolveTffExperiment, create_and_run_light_experiment
from tffpy.tests.ci_config import create_config_files
class TestSolveTffExperiment(unittest.TestCase):
def setUp(self):
create_config_files()
def test_light_experiment(self):
create_and_run_light_experiment()
light_exp = SolveTffExperiment.get_experiment(
setting='light', force_reset=False)
for idt in range(light_exp.n_tasks):
light_exp.plot_task(idt=idt, fontsize=16)
plt.close('all')
light_exp.plot_results()
def test_create_full_experiment(self):
experiment = SolveTffExperiment.get_experiment(
setting='full', force_reset=False)
experiment.display_status()
# -*- coding: utf-8 -*-
"""
Run this script to handle the main experiment :class:`SolveTffExperiment`.
.. moduleauthor:: Valentin Emiya
"""
from yafe.utils import generate_oar_script
import matplotlib.pyplot as plt
from tffpy.experiments.exp_solve_tff import \
......
......@@ -12,7 +12,8 @@ from yafe.utils import ConfigParser as YafeConfigParser
from tffpy.utils import get_config_file, generate_config
if __name__ == '__main__':
def create_config_files():
config_file = get_config_file()
if not config_file.exists():
generate_config()
......@@ -37,3 +38,6 @@ if __name__ == '__main__':
yafe_config_parser.set('USER', 'data_path', str(yafe_user_path))
yafe_config_parser.set('LOGGER', 'path', str(yafe_logger_path))
yafe_config_parser.write(open(yafe_config_file, 'w'))
if __name__ == '__main__':
create_config_files()
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
Class :class:`GabMulTff` is the main object to solve a time-frequency fading
Class :class:`GabMulTff` is the main object to solve a time-frequency fading
problem.
.. moduleauthor:: Valentin Emiya
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment