ibllib.io.extractors.base

Base Extractor classes A module for the base Extractor classes. The Extractor, given a session path, will extract the processed data from raw hardware files and optionally save them.

Functions

get_pipeline

Get the pre-processinf pipeline name from a session path :param session_path: :return:

get_session_extractor_type

From a session path, loads the settings file, finds the task and checks if extractors exist task names examples: :param session_path: :return: bool

get_task_extractor_type

Returns the task type string from the full pybpod task name: _iblrig_tasks_biasedChoiceWorld3.7.0 returns “biased” _iblrig_tasks_trainingChoiceWorld3.6.0 returns “training’ :param task_name: :return: one of [‘biased’, ‘habituation’, ‘training’, ‘ephys’, ‘mock_ephys’, ‘sync_ephys’]

run_extractor_classes

Run a set of extractors with the same inputs :param classes: list of Extractor class :param save: True/False :param path_out: (defaults to alf path) :param kwargs: extractor arguments (session_path…) :return: dictionary of arrays, list of files

Classes

BaseBpodTrialsExtractor

Base (abstract) extractor class for bpod jsonable data set Wrps the _extract private method

BaseExtractor

Base extractor class Writing an extractor checklist: - on the child class, overload the _extract method - this method should output one or several numpy.arrays or dataframe with a consistent shape - save_names is a list or a string of filenames, there should be one per dataset - set save_names to None for a dataset that doesn’t need saving (could be set dynamically in the _extract method) :param session_path: Absolute path of session folder :type session_path: str/Path

class BaseExtractor(session_path=None)[source]

Bases: abc.ABC

Base extractor class Writing an extractor checklist: - on the child class, overload the _extract method - this method should output one or several numpy.arrays or dataframe with a consistent shape - save_names is a list or a string of filenames, there should be one per dataset - set save_names to None for a dataset that doesn’t need saving (could be set dynamically in the _extract method) :param session_path: Absolute path of session folder :type session_path: str/Path

save_names = None
default_path = WindowsPath('alf')
session_path = None
extract(save=False, path_out=None, **kwargs)[source]
Returns

numpy.ndarray or list of ndarrays, list of filenames

Return type

dtype(‘float64’)

class BaseBpodTrialsExtractor(session_path=None)[source]

Bases: ibllib.io.extractors.base.BaseExtractor

Base (abstract) extractor class for bpod jsonable data set Wrps the _extract private method

Parameters

session_path (str) – Absolute path of session folder

:param bpod_trials :param settings

bpod_trials = None
settings = None
extract(bpod_trials=None, settings=None, **kwargs)[source]
Param

bpod_trials (optional) bpod trials from jsonable in a dictionary

Param

settings (optional) bpod iblrig settings json file in a dictionary

Param

save (bool) write output ALF files, defaults to False

Param

path_out (pathlib.Path) output path (defaults to {session_path}/alf)

Returns

numpy.ndarray or list of ndarrays, list of filenames

Return type

dtype(‘float64’)

run_extractor_classes(classes, session_path=None, **kwargs)[source]

Run a set of extractors with the same inputs :param classes: list of Extractor class :param save: True/False :param path_out: (defaults to alf path) :param kwargs: extractor arguments (session_path…) :return: dictionary of arrays, list of files

get_task_extractor_type(task_name)[source]

Returns the task type string from the full pybpod task name: _iblrig_tasks_biasedChoiceWorld3.7.0 returns “biased” _iblrig_tasks_trainingChoiceWorld3.6.0 returns “training’ :param task_name: :return: one of [‘biased’, ‘habituation’, ‘training’, ‘ephys’, ‘mock_ephys’, ‘sync_ephys’]

get_session_extractor_type(session_path)[source]

From a session path, loads the settings file, finds the task and checks if extractors exist task names examples: :param session_path: :return: bool

get_pipeline(session_path)[source]

Get the pre-processinf pipeline name from a session path :param session_path: :return: