oneibl.registration

Functions

register_dataset

Registers a set of files belonging to a session only on the server :param file_list: (list of pathlib.Path or pathlib.Path) :param one: optional (oneibl.ONE), current one object, will create an instance if not provided :param created_by: (string) name of user in Alyx (defaults to ‘root’) :param repository: optional: (string) name of the repository in Alyx :param server_only: optional: (bool) if True only creates on the Flatiron (defaults to False) :param versions: optional (list of strings): versions tags (defaults to ibllib version) :param revisions: optional (list of strings): revision name (defaults to no revision) :param default: optional (bool) whether to set as default dataset (defaults to True) :param dry: (bool) False by default :param verbose: (bool) logs :param max_md5_size: (int) maximum file in bytes to compute md5 sum (always compute if Npne) defaults to None :return:

register_session_raw_data

Registers all files corresponding to raw data files to Alyx.

rename_files_compatibility

Classes

RegistrationClient

Object that keeps the ONE instance and provides method to create sessions and register data.

register_dataset(file_list, one=None, created_by=None, repository=None, server_only=False, versions=None, revisions=None, default=True, dry=False, max_md5_size=None)[source]

Registers a set of files belonging to a session only on the server :param file_list: (list of pathlib.Path or pathlib.Path) :param one: optional (oneibl.ONE), current one object, will create an instance if not provided :param created_by: (string) name of user in Alyx (defaults to ‘root’) :param repository: optional: (string) name of the repository in Alyx :param server_only: optional: (bool) if True only creates on the Flatiron (defaults to False) :param versions: optional (list of strings): versions tags (defaults to ibllib version) :param revisions: optional (list of strings): revision name (defaults to no revision) :param default: optional (bool) whether to set as default dataset (defaults to True) :param dry: (bool) False by default :param verbose: (bool) logs :param max_md5_size: (int) maximum file in bytes to compute md5 sum (always compute if Npne) defaults to None :return:

register_session_raw_data(session_path, one=None, overwrite=False, dry=False, **kwargs)[source]

Registers all files corresponding to raw data files to Alyx. It will select files that match Alyx registration patterns. :param session_path: :param one: one instance to work with :param overwrite: (False) if set to True, will patch the datasets. It will take very long. If set to False (default) will skip all already registered data. :param dry: do not register files, returns the list of files to be registered :return: list of file to register :return: Alyx response: dictionary of registered files

class RegistrationClient(one=None)[source]

Bases: object

Object that keeps the ONE instance and provides method to create sessions and register data.

create_sessions(root_data_folder, glob_pattern='**/create_me.flag', dry=False)[source]

Create sessions looking recursively for flag files

Parameters
  • root_data_folder – folder to look for create_me.flag

  • dry – bool. Dry run if True

  • glob_pattern – bool. Dry run if True

Returns

None

create_session(session_path)[source]
register_sync(root_data_folder, dry=False)[source]

Register sessions looking recursively for flag files

Parameters
  • root_data_folder – folder to look for register_me.flag

  • dry – bool. Dry run if True

Returns

register_session(ses_path, file_list=True)[source]

Register session in Alyx

Parameters
  • ses_path – path to the session

  • file_list – bool. Set to False will only create the session and skip registration

  • repository_name – Optional, repository on which to register the data

Returns

Status string on error

rename_files_compatibility(ses_path, version_tag)[source]