alf.folders

Functions

find_mouse_sessions

find_sessions

Returns all sessions found in all subfolders of a main data folder

find_subject_folders

Returns all subject folders found from a main data folder

find_subject_names

Returns all subject names found from a main data folder

next_num_folder

Return the next number for a session given a session_date_folder

remove_empty_folders

Will iteratively remove any children empty folders

search

session_name

Returns the session name (subject/date/number) string for any filepath useing session_path

session_path

Returns the session path from any filepath if the date/number pattern is found

subjects_data_folder

Given a root_data_folder will try to find a ‘Subjects’ data folder.

subjects_data_folder(folder: pathlib.Path, rglob: bool = False) → pathlib.Path[source]

Given a root_data_folder will try to find a ‘Subjects’ data folder. If Subjects folder is passed will return it directly.

remove_empty_folders(folder: Union[str, pathlib.Path]) → None[source]

Will iteratively remove any children empty folders

find_sessions(folder: Union[str, pathlib.Path]) → List[str][source]

Returns all sessions found in all subfolders of a main data folder

find_subject_names(folder: Union[str, pathlib.Path]) → List[str][source]

Returns all subject names found from a main data folder

session_path(path: Union[str, pathlib.Path]) → str[source]

Returns the session path from any filepath if the date/number pattern is found

session_name(path: Union[str, pathlib.Path]) → str[source]

Returns the session name (subject/date/number) string for any filepath useing session_path

next_num_folder(session_date_folder: str) → str[source]

Return the next number for a session given a session_date_folder

find_subject_folders(folder: Union[str, pathlib.Path]) → List[pathlib.Path][source]

Returns all subject folders found from a main data folder

find_mouse_sessions(folder, mouse)[source]
search(**kwargs)[source]