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

Updated the search for executors and blocks to have them in a better order

parent 61c0317f
No related branches found
No related tags found
No related merge requests found
Pipeline #14348 failed with stage
in 2 minutes and 11 seconds
...@@ -227,23 +227,35 @@ class Root(Nextflow_Building_Blocks): ...@@ -227,23 +227,35 @@ class Root(Nextflow_Building_Blocks):
self.extract_executors() self.extract_executors()
#TODO i need to sort the execution order out #This is to get the order of execution
code = self.get_code()
position_2_thing_2_analyse = {} position_2_thing_2_analyse = {}
for block in self.blocks: for block in self.blocks:
pos = code.find(block.get_code()) block_code = block.get_code()
if(pos!=-1): found = False
position_2_thing_2_analyse[pos] = block while(not found or len(block_code)==0):
code = code.replace(block.get_code(), "a"*len(block.get_code()), 1) pos = code.find(block_code)
else: if(pos!=-1):
position_2_thing_2_analyse[pos] = block
code = code.replace(block_code, "a"*len(block_code), 1)
found = True
else:
block_code = block_code[:-1]
if(not found):
raise Exception("This shouldn't happen") raise Exception("This shouldn't happen")
for e in self.executors: for e in self.executors:
pos = code.find(e.get_code()) e_code = e.get_code()
if(pos!=-1): found = False
position_2_thing_2_analyse[pos] = e while(not found or len(e_code)==0):
code = code.replace(e.get_code(), "a"*len(e.get_code())) pos = code.find(e_code)
else: if(pos!=-1):
raise Exception("This shouldn't happen") position_2_thing_2_analyse[pos] = e
code = code.replace(e_code, "a"*len(e_code), 1)
found = True
else:
e_code = e_code[:-1]
if(not found):
raise Exception("This shouldn't happen")
sorted_position_2_thing_2_analyse = dict(sorted(position_2_thing_2_analyse.items())) sorted_position_2_thing_2_analyse = dict(sorted(position_2_thing_2_analyse.items()))
for key in sorted_position_2_thing_2_analyse: for key in sorted_position_2_thing_2_analyse:
......
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