def test_edges():
    n_samples_trace, n_channels = 100, 10
    n_samples_waveforms = 20

    traces = artificial_traces(n_samples_trace, n_channels)

    # Filter.
    b_filter = bandpass_filter(rate=1000,
                               low=50,
                               high=200,
                               order=3)
    filter_margin = 10

    # Create a loader.
    loader = WaveformLoader(traces,
                            n_samples_waveforms=n_samples_waveforms,
                            filter=lambda x: apply_filter(x, b_filter),
                            filter_margin=filter_margin)

    # Invalid time.
    with raises(ValueError):
        loader._load_at(200000)

    ns = n_samples_waveforms + filter_margin
    assert loader._load_at(0).shape == (ns, n_channels)
    assert loader._load_at(5).shape == (ns, n_channels)
    assert loader._load_at(5 - n_samples_trace).shape == (ns, n_channels)
    assert loader._load_at(n_samples_trace - 1).shape == (ns, n_channels)
dataset/ETHPy150Open kwikteam/phy/phy/traces/tests/test_waveform.py/test_edges/swapped operands of `-`