ibllib.tests.test_pipes

Classes

TestExtractors2Tasks

TestLegacyDeprecations

Assert removal of old code.

TestLocalServer

Tests for the ibllib.pipes.local_server module.

TestMultiPartsRecordings

TestPipesMisc

TestRegisterRawDataTask

TestScanFixPassiveFiles

TestSleeplessDecorator

TestSpikeSortingTask

TestSyncData

Tests for the ibllib.pipes.misc.confirm_widefield_remote_folder

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

Bases: TestCase

Tests for the ibllib.pipes.local_server module.

setUp()[source]

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

test_task_queue(lab_repo_mock)[source]

Test ibllib.pipes.local_server.task_queue function.

test_job_creator(pipeline_mock, _)[source]

Test the job_creator function.

This test was created after retiring the legacy pipeline. Here we test that an experiment description file is created for each legacy session, followed by dynamic pipeline creation. The second session tests the behaviour of a legacy pipeline with no corresponding experiment description template. For these sessions we will simply update acquisition_description_legacy_session to add support.

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

Bases: TestCase

test_task_to_pipeline()[source]
test_task_names_extractors()[source]

This is to test against regressions

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

Bases: TestCase

setUp()[source]

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

test_behavior_exists()[source]
test_check_transfer()[source]
test_get_new_filename()[source]
test_rename_and_move()[source]
test_create_ephys_transfer_done_flag()[source]
test_create_video_transfer_done_flag()[source]
test_check_create_raw_session_flag()[source]
test_create_ephys_flags()[source]
test_create_alyx_probe_insertions()[source]
test_probe_names_from_session_path()[source]
test_rename_session()[source]
test_create_basic_transfer_params()[source]

Tests for the ibllib.pipes.misc.create_basic_transfer_params function

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

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

Bases: TestCase

Tests for the ibllib.pipes.misc.confirm_widefield_remote_folder

raw_widefield = ['dorsal_cortex_landmarks.json', 'fakemouse_SpatialSparrow_19000101_182010.camlog', 'fakemouse_SpatialSparrow_19000101_182010_2_540_640_uint16-002.dat', 'snapshots/19000101_190154_1photon.tif']
setUp()[source]

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

test_rdiff_install()[source]
test_transfer_session_folders()[source]
test_rsync_paths()[source]
test_backup_session()[source]
tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

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

Bases: TestCase

setUp()[source]

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

test_scan_fix()[source]
test_find_pairs()[source]
test_move_rename_pairs()[source]
tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

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

Bases: TestCase

test_create_multiparts_flags()[source]
class TestSpikeSortingTask(methodName='runTest')[source]

Bases: TestCase

test_parse_version()[source]
class TestRegisterRawDataTask(methodName='runTest')[source]

Bases: TestCase

setUp() None[source]

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

test_rename_files()[source]

Test upload of snapshots.

Another test for this exists in ibllib.tests.test_base_tasks.TestRegisterRawDataTask. This test does not work on real files and works without a test db.

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

Bases: TestCase

test_decorator_argument_passing()[source]
class TestLegacyDeprecations(methodName='runTest')[source]

Bases: TestCase

Assert removal of old code.

test_remove_legacy_pipeline()[source]

Remove old legacy pipeline code.

The following code is an incomplete list of modules and functions that should be removed:

  • pipes.ephys_preprocessing

  • pipes.training_preprocessing

  • io.extractors.biased_trials.extract_all

  • io.extractors.bpod_trials.extract_all

  • io.extractors.base.get_session_extractor_type

  • io.extractors.base.get_pipeline

  • io.extractors.base._get_pipeline_from_task_type

  • io.extractors.base._get_task_types_json_config

  • io.extractors.extractor_types.json

  • qc.task_extractors.TaskQCExtractor.extract_data

NB: some tasks in ephys_preprocessing and maybe training_preprocessing may be directly used or subclassed by the dynamic pipeline. The TaskQCExtractor class could be removed entirely. Instead, a function could exist to simply fetch the relevant data from the task’s extractor class. Alos, there may be plenty of iblscripts CI tests to be removed.

test_remove_legacy_rig_code()[source]

Remove old legacy (v7) rig code.

The following code is an incomplete list of modules and functions that should be removed:

  • pipes.transfer_rig_data

  • pipes.misc.check_transfer

  • pipes.misc.transfer_session_folders

  • pipes.misc.copy_with_check

  • pipes.misc.backup_session

  • pipes.misc.transfer_folder

  • pipes.misc.load_videopc_params

  • pipes.misc.load_ephyspc_params

  • pipes.misc.create_basic_transfer_params

  • pipes.misc.create_videopc_params

  • pipes.misc.create_ephyspc_params

  • pipes.misc.rdiff_install

  • pipes.misc.rsync_paths

  • pipes.misc.confirm_ephys_remote_folder

  • pipes.misc.create_ephys_flags

  • pipes.misc.create_ephys_transfer_done_flag

  • pipes.misc.create_video_transfer_done_flag

  • pipes.misc.create_transfer_done_flag

pipes.misc.backup_session may be worth keeping and utilized by the iblrig code (arguably useful on both rig and local server). The corresponding tests should also be removed.

In addition some iblscripts.deploy files should be removed, e.g. prepare_ephys_session, prepare_video_session.