diff --git a/src/block.py b/src/block.py index 7788cd748f285f5cb2f260ab0c3151b17aa0337b..7ef7cd739df57a7accfa2d5dad962174c593ef1f 100644 --- a/src/block.py +++ b/src/block.py @@ -7,11 +7,12 @@ class Block(Root): Root.__init__(self = self, code = code, origin = origin, modules_defined = modules_defined, subworkflow_inputs = existing_channels) self.condition = Condition(origin=self, condition = condition) - #def initialise(self): - # return super().initialise() + def initialise(self): + if(self.condition.value not in []): + return super().initialise() def get_type(self): - return "Root" + return "Block" def same_condition(self, block): return self.condition.same_condition(block.condition) diff --git a/src/call.py b/src/call.py index c4ba74b60265ed6ab565e948b52ed1d167266b92..5f474f008d275c622d8cdefe1cd0bbc3161185df 100644 --- a/src/call.py +++ b/src/call.py @@ -163,10 +163,11 @@ class Call(Executor): self.origin.add_channel(channel) channels = [channel] from .operation import Operation - ope = Operation(param, self) + ope = Operation(f"{param}", self) for channel in channels: channel.add_sink(self) ope.add_element_origins(channel) + ope.set_as_artificial() self.parameters.append(ope) analysed_param = True @@ -305,7 +306,7 @@ class Call(Executor): operation = p if(operation.show_in_structure): operation.get_structure(dico) - #dico["edges"].append({'A':str(operation), 'B':str(sub_input), "label":""}) + dico["edges"].append({'A':str(operation), 'B':str(sub_input), "label":""}) #Case parameter is a Call elif(p.get_type()=="Call"): diff --git a/src/root.py b/src/root.py index 4436ea09489bfaafcd794ffef5d0d1990e8af0f2..3292fdc937f4a982e7747d4e767a4e28154ca887 100644 --- a/src/root.py +++ b/src/root.py @@ -231,8 +231,6 @@ class Root(Nextflow_Building_Blocks): position_2_thing_2_analyse = {} for block in self.blocks: pos = code.find(block.get_code()) - print(block.get_code()) - print() if(pos!=-1): position_2_thing_2_analyse[pos] = block code = code.replace(block.get_code(), "a"*len(block.get_code()), 1) @@ -247,20 +245,18 @@ class Root(Nextflow_Building_Blocks): raise Exception("This shouldn't happen") sorted_position_2_thing_2_analyse = dict(sorted(position_2_thing_2_analyse.items())) - print(sorted_position_2_thing_2_analyse) + for key in sorted_position_2_thing_2_analyse: element = sorted_position_2_thing_2_analyse[key] element.initialise() #for block in self.blocks: - # print("block",code.find(block.get_code())) # #TODO -> this would be the place you put the verification of the conditions # block.initialise() # ##Analyse Executors #for e in self.executors: - # print(code.find(e.get_code())) # e.initialise() #Initialise each subworkflow being called