ibllib.tests.test_ephys

Functions

a_little_spike

make_synthetic_data

synthetic_with_bad_channels

Classes

TestDetectBadChannels

TestDetectSpikes

TestDriftmapSpikeSortingMemmap

Unit tests for ibllib.ephys.spikes.driftmap_spike_sorting_memmap.

TestEphysQC

TestFpgaTask

TestNeuropixel

Comprehensive tests about geometry are run as part of the spikeglx reader testing suite

a_little_spike(nsw=121, nc=1)[source]
make_synthetic_data(ns=10000, nc=384, nss=121, ncs=21, nspikes=1200, tr=None, sample=None)[source]
synthetic_with_bad_channels()[source]
class TestNeuropixel(methodName='runTest')[source]

Bases: TestCase

Comprehensive tests about geometry are run as part of the spikeglx reader testing suite

test_layouts()[source]
tests_headers()[source]
class TestFpgaTask(methodName='runTest')[source]

Bases: TestCase

test_impeccable_dataset()[source]
class TestEphysQC(methodName='runTest')[source]

Bases: TestCase

tempdir = None
classmethod setUpClass() None[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass() None[source]

Hook method for deconstructing the class fixture after running all tests in the class.

setUp() None[source]

Hook method for setting up the test fixture before exercising it.

tearDown() None[source]

Hook method for deconstructing the test fixture after testing it.

test_ensure_data()[source]
class TestDetectSpikes(methodName='runTest')[source]

Bases: TestCase

test_spike_detection()[source]

Test that creates a synthetic dataset with spikes and an amplitude decay function with the probe gemetry, and then pastes spikes all around the dataset and detects and de-duplicates The test is feeding the detections in a new round of simulation, and then computing the zero-lag cross-correlation between input and simulated output, and asserting on the similarity

class TestDetectBadChannels(methodName='runTest')[source]

Bases: TestCase

test_channel_detections()[source]

This test creates a synthetic dataset with voltage stripes and 3 types of bad channels 1) dead channels or low amplitude 2) noisy 3) out of the brain

class TestDriftmapSpikeSortingMemmap(methodName='runTest')[source]

Bases: TestCase

Unit tests for ibllib.ephys.spikes.driftmap_spike_sorting_memmap.

rec_len = 300.0
firing_rate = 50
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_output_matches_brainbox_driftmap()[source]

Chunked histogram is identical to the image produced by brainbox.plot.driftmap.

test_spike_count_conserved()[source]

Sum of histogram bins equals n_spikes (no spikes lost or double-counted).

test_nan_depths_excluded()[source]

Spikes with NaN depth are silently skipped and not counted in the histogram.

test_chunking_invariant()[source]

Result is independent of chunk_size.