ibllib.oneibl.registration

Functions

register_dataset

Registers a set of files belonging to a session only on the server

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, default=True, dry=False, max_md5_size=None)[source]

Registers a set of files belonging to a session only on the server

Parameters
  • file_list – (list of pathlib.Path or pathlib.Path)

  • one – optional (one.api.One), current one object, will create an instance if not provided

  • created_by – (string) name of user in Alyx (defaults to ‘root’)

  • repository – optional: (string) name of the repository in Alyx

  • server_only – optional: (bool) if True only creates on the Flatiron (defaults to False)

  • versions – optional (list of strings): versions tags (defaults to ibllib version)

  • default – optional (bool) whether to set as default dataset (defaults to True)

  • dry – (bool) False by default

  • max_md5_size – (int) maximum file in bytes to compute md5 sum (always compute if None)

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.

Parameters
  • session_path

  • one – one instance to work with

  • 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

Returns

Status string on error

rename_files_compatibility(ses_path, version_tag)[source]