Example #1
0
def _run_hfo_detection_with_plot_and_cb(plot_name, hfo_cb):
    run_hfo_detection_with_configuration(
        configuration=Configuration(
            data_path=get_hfo_directory('dummy'),
            measurement_mode=MeasurementMode.IEEG,
            hidden_neuron_count=86,
            plots=find_plotting_functions([plot_name]),
            calibration_time=10,
            saving_path=None,
            disable_saving=True,
            loading_path=None,
            plot_mode=PlotMode.SAVE,
            plot_path='plots/',
            signal_to_spike_algorithm=SignalToSpikeAlgorithm.DEFAULT,
        ),
        custom_overrides=EMPTY_CUSTOM_OVERRIDES,
        hfo_cb=hfo_cb)
Example #2
0
def _get_selected_plots(plot_names):
    try:
        return find_plotting_functions(plot_names)
    except ValueError as error:
        sys.exit(f'run.py: error: {error}')
Example #3
0
def test_returns_single_plot_with_duplicate_names():
    plots = find_plotting_functions([VALID_PLOT_NAME, VALID_PLOT_NAME])
    assert len(plots.channel) == 1
    assert len(plots.patient) == 0
Example #4
0
def test_fails_on_missing_plot():
    with pytest.raises(ValueError):
        find_plotting_functions(['yarrr'])
Example #5
0
def test_returns_plots_with_multiple_names():
    plots = find_plotting_functions(
        [VALID_PLOT_NAME, 'internal_patient_debug'])
    assert len(plots.channel) == 1
    assert len(plots.patient) == 1
Example #6
0
def test_return_scorrect_plot_fn():
    plots = find_plotting_functions([VALID_PLOT_NAME])
    assert len(plots.channel) == 1
    assert len(plots.patient) == 0
    with pytest.raises(ChannelDebugError):
        plots.channel[0].function(None)
Example #7
0
def test_returns_correct_plot_name():
    plots = find_plotting_functions([VALID_PLOT_NAME])
    assert len(plots.channel) == 1
    assert len(plots.patient) == 0
    assert plots.channel[0].name == VALID_PLOT_NAME
Example #8
0
def test_returns_no_plots_for_no_names():
    plots = find_plotting_functions([])
    assert len(plots.channel) == 0
    assert len(plots.patient) == 0
Example #9
0
def test_fails_on_empty_plot_name():
    with pytest.raises(ValueError):
        find_plotting_functions([''])