ibllib.tests.extractors.test_ephys_fpga

Tests for ephys FPGA sync and FPGA wheel extraction.

Classes

TestExtractedWheelUnits

Tests the infer_wheel_units function.

TestFpgaTrials

Test FpgaTrials class.

TestIBLChannelMaps

TestSyncExtraction

TestTTLsExtraction

TestWheelExtraction

TestWheelMovesExtraction

TestsFolderStructure

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

Bases: TestCase

setUp()[source]

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

test_get_ephys_files()[source]
tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

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

Bases: TestCase

setUp()[source]

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

test_sync_nidq()[source]
test_sync_3B()[source]
test_sync_3A()[source]
sync_gen(fn, ns, nc, sync_depth)[source]
class TestIBLChannelMaps(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_ibl_sync_maps()[source]
class TestTTLsExtraction(methodName='runTest')[source]

Bases: TestCase

test_audio_ttl_wiring_camera()[source]

Test ephys_fpga._clean_audio function.

Test removal of spurious TTLs due to a wrong wiring of the camera onto the soundcard example eid: e349a2e7-50a3-47ca-bc45-20d1899854ec

test_audio_ttl_start_up_down()[source]

If the behaviour starts before FPGA, it is very unlikely but possible that the FPGA starts on up state and that the first front of the audio is a downgoing one. The extraction should handle both cases seamlessly: cf eid d839491f-55d8-4cbe-a298-7839208ba12b

test_frame2ttl_flickers()[source]

Frame2ttl can flicker abnormally. One way to detect this is to remove consecutive polarity switches under a given threshold

test_bpod_trace_extraction()[source]

Test FpgaTrials.get_bpod_event_times method.

test_ttl_bpod_gaelle_writes_protocols_but_guido_doesnt_read_them()[source]
test_align_to_trial()[source]

Test ephys_fpga._assign_events_to_trial function.

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

Bases: TestCase

setUp() None[source]

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

test_x1_decoding()[source]
test_x4_decoding()[source]
test_x2_decoding()[source]
test_wheel_trace_from_sync()[source]

Test ephys_fpga._rotary_encoder_positions_from_fronts function.

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

Bases: TestCase

Tests the infer_wheel_units function.

wheel_radius_cm = 3.1
setUp() None[source]

Create the wheel position data for testing: the positions attribute holds a dictionary of units, each holding a dictionary of encoding types to test, e.g.

positions = {
‘rad’: {

‘X1’: …, ‘X2’: …, ‘X4’: …

}, ‘cm’: {

‘X1’: …, ‘X2’: …, ‘X4’: …

}

} :return:

test_extract_wheel_moves()[source]
class TestWheelMovesExtraction(methodName='runTest')[source]

Bases: TestCase

setUp() None[source]

Test data is in the form ((inputs), (outputs)) where inputs is a tuple containing a numpy array of timestamps and one of positions; outputs is a tuple of outputs from the functions. For details, see help on TestWheel.setUp method in module brainbox.tests.test_behavior

test_extract_wheel_moves()[source]
test_movement_log()[source]

Integration test for inferring the units and decoding type for wheel data input for extract_wheel_moves. Only expected to work for the default wheel diameter.

test_extract_first_movement_times()[source]
class TestFpgaTrials(methodName='runTest')[source]

Bases: TestCase

Test FpgaTrials class.

test_time_fields()[source]

Test for FpgaTrials._time_fields static method.

test_is_trials_object_attribute()[source]

Test for FpgaTrials._is_trials_object_attribute method.