def test_excerpts_2(): bounds = [(start, end) for (start, end) in excerpts(10, nexcerpts=3, excerpt_size=10)] assert bounds == [(0, 10),]
from spikedetekt2.core import run from kwiklib.utils import itervalues, get_params, Probe, create_trace # ----------------------------------------------------------------------------- # Fixtures # ----------------------------------------------------------------------------- DIRPATH = tempfile.mkdtemp() sample_rate = 2000. duration = 1. nchannels = 8 nsamples = int(sample_rate * duration) raw_data = .1 * np.random.randn(nsamples, nchannels) # Add "spikes". for start, end in excerpts(nsamples, nexcerpts=100, excerpt_size=10): raw_data[start:end] *= 5 prm = get_params(**{ 'nchannels': nchannels, 'sample_rate': sample_rate, 'detect_spikes': 'positive', 'save_high': True, 'save_raw': True, }) prb = {0: { 'channels': list(range(nchannels)), 'graph': [(i, i + 1) for i in range(nchannels - 1)], } }
def test_excerpts_1(): bounds = [(start, end) for (start, end) in excerpts(100, nexcerpts=3, excerpt_size=10)] assert bounds == [(0, 10), (45, 55), (90, 100)]