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

Fixed duplicate problem

parent 72f707c6
No related branches found
No related tags found
No related merge requests found
Pipeline #14252 failed with stage
in 2 minutes and 30 seconds
import re
import json
import copy
from .code_ import Code
......@@ -376,11 +377,17 @@ class Call(Executor):
subworkflow = self.get_subworkflow_from_name(tab_call[0])
fun = self.get_function_from_name(tab_call[0])
if(process!=None and subworkflow==None and fun==None):
#temp = process
##If the lements need to duplicated -> then we need to duplicate it
#if(self.get_duplicate_status()):
self.first_element_called = process
#print(process.get_name(), process.call)
#If the lements need to duplicated -> then we need to duplicate it
temp = process
if(self.get_duplicate_status()):
print(process.get_number_times_called())
if(process.get_number_times_called()>0):
print("here")
temp = copy.deepcopy(process)
temp.set_alias(f"{process.get_name()}_{process.get_number_times_called()}")
self.first_element_called = temp
temp.incremente_number_times_called()
print(process.get_name(), process.call)
if(process==None and subworkflow!=None and fun==None):
self.first_element_called = subworkflow
if(process==None and subworkflow==None and fun!=None):
......
......@@ -30,11 +30,18 @@ class Process(Nextflow_Building_Blocks):
self.initialise()
self.initialised = True
self.call = []
self.number_times_called = 0
##It's important this is last
#self.condition = Condition(self)
def set_alias(self, alias):
self.alias = alias
def get_number_times_called(self):
return self.number_times_called
def incremente_number_times_called(self):
self.number_times_called+=1
def set_call(self, call):
self.call.append(call)
......
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