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

Started added workflow rewrite

parent 470cb7c2
No related branches found
No related tags found
No related merge requests found
Pipeline #14372 failed with stage
in 2 minutes and 33 seconds
...@@ -48,6 +48,49 @@ class Main(Nextflow_Building_Blocks): ...@@ -48,6 +48,49 @@ class Main(Nextflow_Building_Blocks):
dico = {} dico = {}
self.root.get_all_calls_in_subworkflow(calls = dico) self.root.get_all_calls_in_subworkflow(calls = dico)
return list(dico.keys()) return list(dico.keys())
def get_all_executors_in_subworkflow(self):
dico = {}
self.root.get_all_executors_in_subworkflow(calls = dico)
return list(dico.keys())
#TODO -> write tests to test this method
def get_all_calls_in_workflow(self):
all_calls = self.get_all_calls_in_subworkflow()
dico = {}
for c in all_calls:
sub = c.get_first_element_called()
if(sub.get_type()=="Subworkflow"):
if(c not in dico):
sub_calls = sub.get_all_calls_in_workflow()
for sub_c in sub_calls:
dico[sub_c] = ""
for c in all_calls:
dico[c] = ""
return list(dico.keys())
#TODO -> write tests to test this method
def get_all_executors_in_workflow(self):
all_executors = self.get_all_executors_in_subworkflow()
dico = {}
for e in all_executors:
if(e.get_type()=="Call"):
for c in e.get_all_calls():
sub = c.get_first_element_called()
if(sub.get_type()=="Subworkflow"):
if(c not in dico):
sub_calls = sub.get_all_executors_in_workflow()
for sub_c in sub_calls:
dico[sub_c] = ""
#Case it's an operation
else:
dico[e] = ""
for e in all_executors:
dico[e] = ""
return list(dico.keys())
def check_includes(self): def check_includes(self):
......
...@@ -220,7 +220,13 @@ class Root(Nextflow_Building_Blocks): ...@@ -220,7 +220,13 @@ class Root(Nextflow_Building_Blocks):
calls[c] = '' calls[c] = ''
#if(c.get_first_element_called().get_type()=="Subworkflow"): #if(c.get_first_element_called().get_type()=="Subworkflow"):
# c.get_first_element_called().root.get_all_calls(calls = calls) # c.get_first_element_called().root.get_all_calls(calls = calls)
def get_all_executors_in_subworkflow(self, calls = {}):
all_executors = self.get_executors_same_level()+self.get_inside_executors()
for e in all_executors:
calls[e] = ''
############# #############
# PROCESSES # PROCESSES
......
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