Skip to content
Snippets Groups Projects
Commit 964230af authored by George Marchment's avatar George Marchment
Browse files

Fix weird bug which wasn't connecting processes in rewritting

parent 90f3f338
No related branches found
No related tags found
No related merge requests found
Pipeline #14386 failed with stage
in 2 minutes and 21 seconds
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment