Finished the simulation part of the method sections.
This commit is contained in:
@@ -45,7 +45,8 @@ def reduce_kernel_set(data, inds, keys=None, combis=None):
|
||||
data[key] = data[key][:, inds, ...]
|
||||
return data
|
||||
|
||||
def sort_files_by_rec(paths, sources=['BM04', 'BM93', 'DJN', 'GBC', 'FTN']):
|
||||
def sort_files_by_rec(paths, sources=['BM04', 'BM93', 'DJN', 'GBC', 'FTN'],
|
||||
return_dict=False):
|
||||
# Separate by source:
|
||||
sorted_paths = {}
|
||||
for source in sources:
|
||||
@@ -73,7 +74,11 @@ def sort_files_by_rec(paths, sources=['BM04', 'BM93', 'DJN', 'GBC', 'FTN']):
|
||||
# Open new recording-specific slot:
|
||||
sorted_paths[source].append([])
|
||||
sorted_paths[source][sub_id - 1].append(path)
|
||||
|
||||
|
||||
# Keep source separation:
|
||||
if return_dict:
|
||||
return sorted_paths
|
||||
|
||||
# Re-sort song files by recording only (discarding source separation):
|
||||
sorted_paths = [path for paths in sorted_paths.values() for path in paths]
|
||||
return sorted_paths
|
||||
|
||||
Reference in New Issue
Block a user