diff --git a/src/workflow.py b/src/workflow.py index e6e82262a44f9f7c799f8aace201a42c598019b9..465d512d8ab611201291af0bc92f4af81b6feef3 100644 --- a/src/workflow.py +++ b/src/workflow.py @@ -734,10 +734,16 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen subworkflow_clusters_to_add, subworkflow_cluster_calls_to_add = [], [] index_cluster = 0 for elements in clusters: + #Check that there is at least one process in cluster + at_least_one_process = False + for e in elements: + if(e.get_type()=="Process"): + at_least_one_process = True + #Only create the subworkflows for clusters with more than one element processes_added = [] things_added_in_cluster = [] - if(len(elements)>1): + if(len(elements)>1 and at_least_one_process): name, body, take, emit = "", "", "", "" first_element = True for ele in elements: @@ -781,6 +787,7 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen code = code.replace(ele.get_code(get_OG = True), "", 1) #Ignore these cases + #TODO -> you should be able to remove this if(ele.get_code()[:4] not in ["emit", "take"]): origins = ele.get_origins() for o in origins: @@ -839,8 +846,14 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen new_param_names, index, old_param_names = [], 1, [] for param in takes_param: param_name = f"param_{name}_{index}" - new_param_names.append(param_name) - old_param_names.append(param.get_code()) + #Here if the input is a channel -> we keep the same name for readibility + #It also solves a bug described on the 18/02/2025 + if(param.get_type()!='Channel'): + new_param_names.append(param_name) + old_param_names.append(param.get_code()) + else: + new_param_names.append(param.get_code()) + old_param_names.append(param.get_code()) index += 1 if(len(new_param_names)>0): temp = '\n'.join(new_param_names)