diff --git a/src/executor.py b/src/executor.py index 6e54eb9c0c3bb2f49e1e42f2d1ef934cb7632e4b..845b5ca76b48968d6dc3547512a7e14771d59ccf 100644 --- a/src/executor.py +++ b/src/executor.py @@ -206,17 +206,16 @@ class Executor(Nextflow_Building_Blocks): #Method which returns the call which calls the element called def get_call_by_name(self, name): + #This is an old comment: #We get the calls that have already been analysed or which are currently being analysed #for example "p(a.out)" -> the call for 'a' may not have been analysed yet #In that case when calling "get_calls" -> we don't want to reanalyse the "p(a.out)" - calls_that_have_been_analysed = self.get_calls_that_have_been_analysed() + if(self.origin.get_type() in ['Root', 'Block']): for c in self.origin.get_calls(): - if(c not in calls_that_have_been_analysed): - calls_that_have_been_analysed[c] = True - #c.initialise() - if(c.first_element_called.get_alias()==name): - return c + #c.initialise()#Don't need to analyse the call cause the element called is already analysed when the call is created + if(c.first_element_called.get_alias()==name): + return c return None else: diff --git a/src/main.py b/src/main.py index 5b80b7d2f44503b596bf303c340e53c031abc048..522bde77c2048d390b8bcd83a775a9cfea9e606f 100644 --- a/src/main.py +++ b/src/main.py @@ -15,9 +15,6 @@ class Main(Nextflow_Building_Blocks): self.initialised = False self.root = None - def get_calls_that_have_been_analysed(self): - return self.nextflow_file.get_calls_that_have_been_analysed() - def get_string_line(self, bit_of_code): return self.nextflow_file.get_string_line(bit_of_code) diff --git a/src/nextflow_building_blocks.py b/src/nextflow_building_blocks.py index c004e35b967f63712ac356f71ea3a5ab0d7320d8..cf683ff77e19c08e4755d90f3e2a60ba6c445767 100644 --- a/src/nextflow_building_blocks.py +++ b/src/nextflow_building_blocks.py @@ -20,9 +20,6 @@ class Nextflow_Building_Blocks: #--------------------------------- #AUXILIARY METHODS FOR ALL CLASSES #--------------------------------- - - def get_calls_that_have_been_analysed(self): - return self.origin.get_calls_that_have_been_analysed() def get_code(self, get_OG = False): return self.code.get_code(get_OG = get_OG) diff --git a/src/nextflow_file.py b/src/nextflow_file.py index 48e105704d98daf9a2adb5c2421d72265ca491eb..6095fd0e3c79d6d816d5e4e85ecc9f2e39f1b4e2 100644 --- a/src/nextflow_file.py +++ b/src/nextflow_file.py @@ -50,9 +50,7 @@ class Nextflow_File(Nextflow_Building_Blocks): def get_DSL(self): return self.workflow.get_DSL() - def get_calls_that_have_been_analysed(self): - return self.workflow.get_calls_that_have_been_analysed() - + #Method which returns the DSL of the workflow -> by default it's DSL2 #I use the presence of include, subworkflows and into/from in processes as a proxy def find_DSL(self): diff --git a/src/subworkflow.py b/src/subworkflow.py index 3ce064e6f45a2bfe98d91846ca039c66457fa6a7..07fb61edfa798639fae924dd489dc685fb1744bd 100644 --- a/src/subworkflow.py +++ b/src/subworkflow.py @@ -44,13 +44,10 @@ class Subworkflow(Main): return sub def get_call_by_name(self, name): - calls_that_have_been_analysed = self.get_calls_that_have_been_analysed() for c in self.root.get_calls(): - if(c not in calls_that_have_been_analysed): - calls_that_have_been_analysed[c] = True - #c.initialise() - if(c.first_element_called.get_alias()==name): - return c + #c.initialise()#Don't need to analyse the call cause the element called is already analysed when the call is created + if(c.first_element_called.get_alias()==name): + return c return None diff --git a/src/workflow.py b/src/workflow.py index a0ac31e3d2c2463f3a88ea15222bf23b830e5c34..0070f2ba93177b674914e575986078bcbf7cb7aa 100644 --- a/src/workflow.py +++ b/src/workflow.py @@ -61,7 +61,6 @@ class Workflow: self.name = name self.graph = None - self.calls_that_have_been_analysed = {} OG_file = Nextflow_File(file, workflow = self, first_file = True) self.DSL = OG_file.find_DSL() @@ -82,9 +81,6 @@ class Workflow: with open(self.output_dir / "debug" / "operations_in_call.nf",'w') as file: pass - def get_calls_that_have_been_analysed(self): - return self.calls_that_have_been_analysed - def get_duplicate_status(self): return self.duplicate