@@ -283,15 +283,11 @@ def setup
283283 ds_file_id = self . invoke_params [ ds_input . id ]
284284 userfile = Userfile . find ( ds_file_id )
285285
286- basename = Revision_info . basename
287- commit = Revision_info . short_commit
288- self . addlog ( "#{ basename } rev. #{ commit } " )
289-
290286 if userfile . is_a? ( BidsDataset )
291- self . addlog "BoutiquesBidsSingleSubject: preparing task for a BidsDataset"
287+ self . addlog "Preparing task for a BidsDataset"
292288 setup_for_bids_dataset ( )
293289 elsif userfile . is_a? ( BidsSubject )
294- self . addlog "BoutiquesBidsSingleSubject: preparing task for a BidsSubject"
290+ self . addlog "Preparing task for a BidsSubject"
295291 setup_for_bids_subject ( )
296292 else
297293 cb_error "This task was given a CBRAIN file of unknown type: #{ userfile . class } ##{ userfile . id } "
@@ -315,14 +311,14 @@ def setup_for_bids_subject #:nodoc:
315311 subject_name = userfile . name # 'sub-1234'
316312
317313 if ! File . directory? ( FakeBidsDirName )
318- self . addlog ( "BoutiquesBidsSingleSubject: Creating fake BIDS dataset '#{ FakeBidsDirName } '" )
314+ self . addlog ( "Creating fake BIDS dataset '#{ FakeBidsDirName } '" )
319315 Dir . mkdir ( FakeBidsDirName )
320316 end
321317
322318 # Make a copy of the subject data
323319 copy_loc = Pathname . new ( FakeBidsDirName ) + subject_name
324320 verb = File . exists? ( copy_loc . to_s ) ? "Updating" : "Copying" # helps identifying what happens when restarting
325- self . addlog ( "BoutiquesBidsSingleSubject: #{ verb } subject data '#{ subject_name } '" )
321+ self . addlog ( "#{ verb } subject data '#{ subject_name } '" )
326322 rsyncout = ssm_bash_this ( "rsync -a -l --no-g --chmod=u=rwX,g=rX,Dg+s,o=r --delete #{ subject_name . bash_escape } / #{ copy_loc . to_s . bash_escape } " )
327323 cb_error "Failed to rsync '#{ subject_name } ';\n rsync reported: #{ rsyncout } " unless rsyncout . blank?
328324
@@ -333,14 +329,14 @@ def setup_for_bids_subject #:nodoc:
333329
334330 # Create dataset_description.json
335331 if ! File . exists? ( desc_json_path )
336- self . addlog ( "BoutiquesBidsSingleSubject: installing dataset_description.json" )
332+ self . addlog ( "Installing dataset_description.json" )
337333 File . open ( desc_json_path , "w" ) { |fh | fh . write read_or_make_dataset_description ( FakeBidsDirName ) }
338334 end
339335
340336 # Create participants.tsv
341337 tsv_header , tsv_record = read_or_make_tsv_for_subject ( subject_name )
342338 if ! File . exists? ( participants_tsv_path )
343- self . addlog "BoutiquesBidsSingleSubject: Creating new participants.tsv file for subject #{ subject_name } "
339+ self . addlog "Creating new participants.tsv file for subject #{ subject_name } "
344340 File . open ( participants_tsv_path , "w" ) { |fh | fh . write "#{ tsv_header } \n #{ tsv_record } \n " }
345341 else
346342 # Append to existing participants.tsv.
@@ -349,15 +345,15 @@ def setup_for_bids_subject #:nodoc:
349345 tsv_content = File . read ( participants_tsv_path ) . split ( "\n " )
350346 # This code will break if several processes are all trying to do this at the exact same time.
351347 if ! tsv_content . any? { |line | line . sub ( /[\s ,].*/ , "" ) == subject_name }
352- self . addlog "BoutiquesBidsSingleSubject: Appending record for #{ subject_name } to participants.tsv"
348+ self . addlog "Appending record for #{ subject_name } to participants.tsv"
353349 File . open ( participants_tsv_path , "a" ) { |fh | fh . write "#{ tsv_record } \n " }
354350 end
355351 end
356352
357353 # Create optional .bidsignore file if any
358354 bidsignore_content = read_bidsignore_file ( )
359355 if ! File . exists? ( ign_path ) && bidsignore_content . present?
360- self . addlog ( "BoutiquesBidsSingleSubject: installing .bidsignore file" )
356+ self . addlog ( "Installing .bidsignore file" )
361357 File . open ( ign_path , "w" ) { |fh | fh . write bidsignore_content }
362358 end
363359
@@ -376,7 +372,7 @@ def read_or_make_tsv_for_subject(subject_name) #:nodoc:
376372 # In the case there is no specific participants.tsv file provided
377373 # in input, we return the info to create a simple one.
378374 if tsv_input_file_id . blank?
379- self . addlog "BoutiquesBidsSingleSubject: participants.tsv file will contain only the subject name"
375+ self . addlog "participants.tsv file will contain only the subject name"
380376 return [ "participant_id" , subject_name ] # TSV contains only participant ID
381377 end
382378
@@ -388,9 +384,9 @@ def read_or_make_tsv_for_subject(subject_name) #:nodoc:
388384 tsv_header = tsv_content [ 0 ] . presence || "participant_id"
389385 tsv_record = tsv_content . detect { |line | line . sub ( /[\s ,].*/ , "" ) == subject_name }
390386 if tsv_record . present?
391- self . addlog "BoutiquesBidsSingleSubject: participants.tsv record for #{ subject_name } extracted from supplied file"
387+ self . addlog "participants.tsv record for #{ subject_name } extracted from supplied file"
392388 else
393- self . addlog "BoutiquesBidsSingleSubject: Warning: no record for #{ subject_name } found in participants.tsv file"
389+ self . addlog "Warning: no record for #{ subject_name } found in participants.tsv file"
394390 tsv_record = subject_name
395391 end
396392 [ tsv_header , tsv_record ]
0 commit comments