oneibl.one

class oneibl.one.ONE(username=None, password=None, base_url=None, silent=False)
static keywords()

Returns possible keywords to be used in the one.list method

Returns:a tuple containing possible search terms:
Return type:tuple
list(eid=None, keyword='dataset-type', details=False)

From a Session ID, queries Alyx database for datasets-types related to a session.

Parameters:
  • eid (str or list of strings) – Experiment ID, for IBL this is the UUID String of the Session as per Alyx database. Example: ‘698361f6-b7d0-447d-a25d-42afdef7a0da’ If None, returns the set of possible values. Only for the following keys: (‘users’, ‘dataset-types’, subjects’)
  • keyword (str) – The attribute to be listed.
  • details (bool) – returns a second argument with a full dictionary to provide context
Returns:

list of strings, plus list of dictionaries if details option selected

Return type:

list, list

for a list of keywords, use the methods one.search_terms()

load(eid, dataset_types=None, dclass_output=False, dry_run=False, cache_dir=None, download_only=False, clobber=False, offline=False, keep_uuid=False)

From a Session ID and dataset types, queries Alyx database, downloads the data from Globus, and loads into numpy array.

Parameters:
  • eid (str) – Experiment ID, for IBL this is the UUID of the Session as per Alyx database. Could be a full Alyx URL: ‘http://localhost:8000/sessions/698361f6-b7d0-447d-a25d-42afdef7a0da’ or only the UUID: ‘698361f6-b7d0-447d-a25d-42afdef7a0da’. Can also be a list of the above for multiple eids.
  • dataset_types (list) – [None]: Alyx dataset types to be returned.
  • dclass_output (bool If None or an empty dataset_type is specified, the output will be a dictionary by default.) – [False]: forces the output as dataclass to provide context.
  • cache_dir (str) – temporarly overrides the cache_dir from the parameter file
  • download_only (bool) – do not attempt to load data in memory, just download the files
  • clobber (bool) – force downloading even if files exists locally
  • keep_uuid (bool) – keeps the UUID at the end of the filename (defaults to False)
Returns:

List of numpy arrays matching the size of dataset_types parameter, OR a dataclass containing arrays and context data.

Return type:

list, dict, dataclass SessionDataInfo

search(details=False, limit=None, **kwargs)
Applies a filter to the sessions (eid) table and returns a list of json dictionaries
corresponding to sessions.

For a list of search terms, use the methods

>>> one.search_terms()
Parameters:
  • details (bool) – default False, returns also the session details as per the REST response
  • limit (int List of possible search terms) – default None, limits results (if pagination enabled on server)
  • dataset_types (list of str) – list of dataset_types
  • users (list or str) – a list of users
  • subjects (list or str) – a list of subjects nickname
  • lab (list or str) – a str or list of lab names
  • date_range (list) – list of 2 strings or list of 2 dates that define the range
  • number (str or int) – session number
Returns:

list of eids, if details is True, also returns a list of json dictionaries, each entry corresponding to a matching session

Return type:

list, list

static search_terms()

Returns possible search terms to be used in the one.search method.

Returns:a tuple containing possible search terms:
Return type:tuple
static setup()

Interactive command tool that populates parameter file for ONE IBL.