diff --git a/datashuttle/datashuttle.py b/datashuttle/datashuttle.py index 969eac6f..b72a058e 100644 --- a/datashuttle/datashuttle.py +++ b/datashuttle/datashuttle.py @@ -151,84 +151,84 @@ def create_folders( log: bool = True, ) -> Dict[str, List[Path]]: """ - Create a subject / session folder tree in the project - folder. The passed subject / session names are - formatted and validated. If this succeeds, fully - validation against all subject / session folders in - the local project is performed before making the - folders. - - Parameters - ---------- - - top_level_folder : TopLevelFolder - Whether to make the folders in `rawdata` or - `derivatives`. - - sub_names : Union[str, List[str]] - subject name / list of subject names to make - within the top-level project folder - (if not already, these will be prefixed with - "sub-") - - ses_names : Optional[Union[str, List[str]]] - (Optional). session name / list of session names. - (if not already, these will be prefixed with - "ses-"). If no session is provided, no session-level - folders are made. - - datatype : Union[str, List[str]] - The datatype to make in the sub / ses folders. - (e.g. "ephys", "behav", "anat"). If "all" - is selected, all datatypes permitted in - NeuroBlueprint will be created. If "" is passed - no datatype will be created. - - bypass_validation : bool - If `True`, folders will be created even if they are not - valid to NeuroBlueprint style. - -<<<<<<< HEAD - log : bool - If `True`, details of folder creation will be logged. -======= - Returns - ------- - created_paths : - A dictionary of the full filepaths made during folder creation, - where the keys are the type of folder made and the values are a - list of created folder paths (Path objects). If datatype were - created, the dict keys will separate created folders by datatype - name. Similarly, if only subject or session level folders were - created, these are separated by "sub" and "ses" keys. ->>>>>>> 612b276 (Add 'Returns' section to 'create_folders()', fix incorrect type hints.) - - Notes - ----- - - sub_names or ses_names may contain formatting tags - - @TO@ : - used to make a range of subjects / sessions. - Boundaries of the range must be either side of the tag - e.g. sub-001@TO@003 will generate - ["sub-001", "sub-002", "sub-003"] - - @DATE@, @TIME@ @DATETIME@ : - will add date-, time- or - date-_time- keys respectively. Only one per-name - is permitted. - e.g. sub-001_@DATE@ will generate sub-001_date-20220101 - (on the 1st january, 2022). - - Examples - -------- - project.create_folders("rawdata", "sub-001", datatype="all") - - project.create_folders("rawdata", - "sub-002@TO@005", - ["ses-001", "ses-002"], - ["ephys", "behav"]) + Create a subject / session folder tree in the project + folder. The passed subject / session names are + formatted and validated. If this succeeds, fully + validation against all subject / session folders in + the local project is performed before making the + folders. + + Parameters + ---------- + + top_level_folder : TopLevelFolder + Whether to make the folders in `rawdata` or + `derivatives`. + + sub_names : Union[str, List[str]] + subject name / list of subject names to make + within the top-level project folder + (if not already, these will be prefixed with + "sub-") + + ses_names : Optional[Union[str, List[str]]] + (Optional). session name / list of session names. + (if not already, these will be prefixed with + "ses-"). If no session is provided, no session-level + folders are made. + + datatype : Union[str, List[str]] + The datatype to make in the sub / ses folders. + (e.g. "ephys", "behav", "anat"). If "all" + is selected, all datatypes permitted in + NeuroBlueprint will be created. If "" is passed + no datatype will be created. + + bypass_validation : bool + If `True`, folders will be created even if they are not + valid to NeuroBlueprint style. + + <<<<<<< HEAD + log : bool + If `True`, details of folder creation will be logged. + ======= + Returns + ------- + created_paths : + A dictionary of the full filepaths made during folder creation, + where the keys are the type of folder made and the values are a + list of created folder paths (Path objects). If datatype were + created, the dict keys will separate created folders by datatype + name. Similarly, if only subject or session level folders were + created, these are separated by "sub" and "ses" keys. + >>>>>>> 612b276 (Add 'Returns' section to 'create_folders()', fix incorrect type hints.) + + Notes + ----- + + sub_names or ses_names may contain formatting tags + + @TO@ : + used to make a range of subjects / sessions. + Boundaries of the range must be either side of the tag + e.g. sub-001@TO@003 will generate + ["sub-001", "sub-002", "sub-003"] + + @DATE@, @TIME@ @DATETIME@ : + will add date-, time- or + date-_time- keys respectively. Only one per-name + is permitted. + e.g. sub-001_@DATE@ will generate sub-001_date-20220101 + (on the 1st january, 2022). + + Examples + -------- + project.create_folders("rawdata", "sub-001", datatype="all") + + project.create_folders("rawdata", + "sub-002@TO@005", + ["ses-001", "ses-002"], + ["ephys", "behav"]) """ if log: self._start_log("create-folders", local_vars=locals())