iblrig.path_helper.iterate_collection

iblrig.path_helper.iterate_collection(session_path, collection_name='raw_task_data')[source]

Given a session path returns the next numbered collection name.

Parameters:
  • session_path (str) – The session path containing zero or more numbered collections.

  • collection_name (str) – The collection name without the _NN suffix.

Returns:

The next numbered collection name.

Return type:

str

Parameters:

session_path (str)

Examples

In a folder where there are no raw task data folders

>>> iterate_collection('./subject/2020-01-01/001')
'raw_task_data_00'

In a folder where there is one raw_imaging_data_00 folder

>>> iterate_collection('./subject/2020-01-01/001', collection_name='raw_imaging_data')
'raw_imaging_data_01'