@@ -148,6 +148,7 @@ def create_folders(
148
148
ses_names : Optional [Union [str , List [str ]]] = None ,
149
149
datatype : Union [str , List [str ]] = "" ,
150
150
bypass_validation : bool = False ,
151
+ log : bool = True ,
151
152
) -> List [Path ]:
152
153
"""
153
154
Create a subject / session folder tree in the project
@@ -160,31 +161,36 @@ def create_folders(
160
161
Parameters
161
162
----------
162
163
163
- sub_names :
164
+ top_level_folder : TopLevelFolder
165
+ Whether to make the folders in `rawdata` or
166
+ `derivatives`.
167
+
168
+ sub_names : Union[str, List[str]]
164
169
subject name / list of subject names to make
165
170
within the top-level project folder
166
171
(if not already, these will be prefixed with
167
172
"sub-")
168
- ses_names :
173
+
174
+ ses_names : Optional[Union[str, List[str]]]
169
175
(Optional). session name / list of session names.
170
176
(if not already, these will be prefixed with
171
177
"ses-"). If no session is provided, no session-level
172
178
folders are made.
173
- datatype :
179
+
180
+ datatype : Union[str, List[str]]
174
181
The datatype to make in the sub / ses folders.
175
182
(e.g. "ephys", "behav", "anat"). If "all"
176
183
is selected, all datatypes permitted in
177
184
NeuroBlueprint will be created. If "" is passed
178
185
no datatype will be created.
179
186
180
- top_level_folder :
181
- Whether to make the folders in `rawdata` or
182
- `derivatives`.
183
-
184
- bypass_validation :
187
+ bypass_validation : bool
185
188
If `True`, folders will be created even if they are not
186
189
valid to NeuroBlueprint style.
187
190
191
+ log : bool
192
+ If `True`, details of folder creation will be logged.
193
+
188
194
Notes
189
195
-----
190
196
@@ -212,7 +218,9 @@ def create_folders(
212
218
["ses-001", "ses-002"],
213
219
["ephys", "behav"])
214
220
"""
215
- self ._start_log ("create-folders" , local_vars = locals ())
221
+ if log :
222
+ self ._start_log ("create-folders" , local_vars = locals ())
223
+
216
224
self ._check_top_level_folder (top_level_folder )
217
225
218
226
utils .log ("\n Formatting Names..." )
@@ -244,12 +252,14 @@ def create_folders(
244
252
log = True ,
245
253
)
246
254
247
- utils .print_message_to_user (
248
- f"Finished making folders. \n For log of all created "
249
- f"folders, please see { self .cfg .logging_path } "
250
- )
255
+ utils .print_message_to_user ("Finished making folders." )
251
256
252
- ds_logger .close_log_filehandler ()
257
+ if log :
258
+ utils .print_message_to_user (
259
+ f"For log of all created folders, "
260
+ f"please see { self .cfg .logging_path } "
261
+ )
262
+ ds_logger .close_log_filehandler ()
253
263
254
264
return created_paths
255
265
0 commit comments