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

What looks like a stable version

parent 4df87025
No related branches found
No related tags found
No related merge requests found
Pipeline #14380 failed with stage
in 2 minutes and 25 seconds
...@@ -19,7 +19,7 @@ class Block(Root): ...@@ -19,7 +19,7 @@ class Block(Root):
#This method returns returns all the conditions above the block #This method returns returns all the conditions above the block
#Basically everything which needs to be true for the block to exist #Basically everything which needs to be true for the block to exist
def get_all_conditions(self, conditions = {}): def get_all_conditions(self, conditions):
conditions[self.condition] = '' conditions[self.condition] = ''
self.origin.get_all_conditions(conditions = conditions) self.origin.get_all_conditions(conditions = conditions)
return conditions return conditions
......
...@@ -42,6 +42,9 @@ class Call(Executor): ...@@ -42,6 +42,9 @@ class Call(Executor):
def add_to_emits(self, emitted): def add_to_emits(self, emitted):
self.emits.append(emitted) self.emits.append(emitted)
def get_later_emits(self):
return self.emits
def __str__(self): def __str__(self):
return f"Call_{id(self)}" return f"Call_{id(self)}"
...@@ -78,22 +81,26 @@ class Call(Executor): ...@@ -78,22 +81,26 @@ class Call(Executor):
#Case the param is an operation #Case the param is an operation
elif(param.get_type()=="Operation"): elif(param.get_type()=="Operation"):
#If it's an artificial operation -> we don't need to do anything
if(not param.get_artificial_status()):
code = code.replace(param.get_code(get_OG=True), param_new_name) code = code.replace(param.get_code(get_OG=True), param_new_name)
lines = param.simplify_code().split('\n') lines = param.simplify_code().split('\n')
if(len(lines)==1): if(len(lines)==1):
new_bit = f"{param_new_name} = {lines[0]}" new_bit = f"{param_new_name} = {lines[0]}"
else: else:
head = '\n'.join(lines[:-1]) head = '\n'.join(lines[:-1])
new_bit = f"{head}\n{param_new_name} = {lines[-1]}" new_bit = f"{head}\n{param_new_name} = {lines[-1]}"
code = code.replace(tag_to_add, f"{tag_to_add}\n{new_bit}") code = code.replace(tag_to_add, f"{tag_to_add}\n{new_bit}")
#Case Channel #Case Channel
elif(param.get_type()=="Channel"): elif(param.get_type()=="Channel"):
raise Exception("This shouldn't happen")
None None
elif(param.get_type()=="Emitted"): elif(param.get_type()=="Emitted"):
None None
else: else:
print(param)
raise Exception("This shouldn't happen") raise Exception("This shouldn't happen")
index+=1 index+=1
return code.replace(tag_to_add, "").strip() return code.replace(tag_to_add, "").strip()
...@@ -166,6 +173,7 @@ class Call(Executor): ...@@ -166,6 +173,7 @@ class Call(Executor):
channels = [channel] channels = [channel]
from .operation import Operation from .operation import Operation
ope = Operation(f"{param}", self) ope = Operation(f"{param}", self)
ope.set_as_artificial()
for channel in channels: for channel in channels:
channel.add_sink(self) channel.add_sink(self)
ope.add_element_origins(channel) ope.add_element_origins(channel)
......
...@@ -31,6 +31,14 @@ class Executor(Nextflow_Building_Blocks): ...@@ -31,6 +31,14 @@ class Executor(Nextflow_Building_Blocks):
def get_list_name_processes(self): def get_list_name_processes(self):
return self.origin.get_list_name_processes() return self.origin.get_list_name_processes()
def get_all_conditions(self):
if(self.origin.get_type()=="Root"):
return []
elif(self.origin.get_type()=="Block"):
conditions = {}
return self.origin.get_all_conditions(conditions)
else:
return self.origin.get_all_conditions()
def get_subworkflow_from_name(self, name): def get_subworkflow_from_name(self, name):
...@@ -93,8 +101,6 @@ class Executor(Nextflow_Building_Blocks): ...@@ -93,8 +101,6 @@ class Executor(Nextflow_Building_Blocks):
def get_executors(self): def get_executors(self):
return self.origin.get_executors() return self.origin.get_executors()
def get_condition(self):
return self.condition
def add_element_to_elements_being_called(self, element): def add_element_to_elements_being_called(self, element):
self.origin.add_element_to_elements_being_called(element) self.origin.add_element_to_elements_being_called(element)
......
This diff is collapsed.
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