ibllib.pipes.base_tasks

Abstract base classes for dynamic pipeline tasks.

Classes

AudioTask

BehaviourTask

DynamicTask

EphysTask

ExperimentDescriptionRegisterRaw

dict of list: custom sign off keys corresponding to specific devices

MesoscopeTask

RegisterRawDataTask

Base register raw task. To rename files 1. input and output must have the same length 2. output files must have full filename.

VideoTask

WidefieldTask

class DynamicTask(session_path, **kwargs)[source]

Bases: Task

get_sync_collection(sync_collection=None)[source]
get_sync(sync=None)[source]
get_sync_extension(sync_ext=None)[source]
get_sync_namespace(sync_namespace=None)[source]
get_protocol(protocol=None, task_collection=None)[source]
get_task_collection(collection=None)[source]
get_device_collection(device, device_collection=None)[source]
read_params_file()[source]
class BehaviourTask(session_path, **kwargs)[source]

Bases: DynamicTask

get_protocol(protocol=None, task_collection=None)[source]
get_task_collection(collection=None)[source]
get_protocol_number(number=None, task_protocol=None)[source]
class VideoTask(session_path, cameras, **kwargs)[source]

Bases: DynamicTask

class AudioTask(session_path, **kwargs)[source]

Bases: DynamicTask

class EphysTask(session_path, **kwargs)[source]

Bases: DynamicTask

get_pname(pname)[source]
get_nshanks(nshanks=None)[source]
class WidefieldTask(session_path, **kwargs)[source]

Bases: DynamicTask

class MesoscopeTask(session_path, **kwargs)[source]

Bases: DynamicTask

get_signatures(**kwargs)[source]

From the template signature of the task, create the exact list of inputs and outputs to expect based on the available device collection folders

Necessary because we don’t know in advance how many device collection folders (“imaging bouts”) to expect

load_sync()[source]

Load the sync and channel map.

This method may be expanded to support other raw DAQ data formats.

Returns:

  • one.alf.io.AlfBunch – A dictionary with keys (‘times’, ‘polarities’, ‘channels’), containing the sync pulses and the corresponding channel numbers.

  • dict – A map of channel names and their corresponding indices.

class RegisterRawDataTask(session_path, **kwargs)[source]

Bases: DynamicTask

Base register raw task. To rename files

  1. input and output must have the same length

  2. output files must have full filename

priority = 100
job_size = 'small'
rename_files(symlink_old=False)[source]
register_snapshots(unlink=False, collection=None)[source]

Register any photos in the snapshots folder to the session. Typically imaging users will take numerous photos for reference. Supported extensions: .jpg, .jpeg, .png, .tif, .tiff

If a .txt file with the same name exists in the same location, the contents will be added to the note text.

Parameters:
  • unlink (bool) – If true, files are deleted after upload.

  • collection (str, list, optional) – Location of ‘snapshots’ folder relative to the session path. If None, uses ‘device_collection’ attribute (if exists) or root session path.

Returns:

The newly registered Alyx notes.

Return type:

list of dict

class ExperimentDescriptionRegisterRaw(session_path, **kwargs)[source]

Bases: RegisterRawDataTask

dict of list: custom sign off keys corresponding to specific devices

sign_off_categories = {'neuropixel': ['raw', 'spike_sorting', 'alignment']}
property signature

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)