From 6df3ee7e125f4ab0c6a4295785c6b749e67fde3c Mon Sep 17 00:00:00 2001
From: George Marchment <georgemarchment@yahoo.fr>
Date: Wed, 12 Feb 2025 13:18:09 +0100
Subject: [PATCH] Fixed weird bug

---
 src/block.py                    | 5 -----
 src/call.py                     | 4 +---
 src/channel.py                  | 5 +++--
 src/code_.py                    | 3 ---
 src/executor.py                 | 2 +-
 src/main.py                     | 2 +-
 src/nextflow_building_blocks.py | 9 +--------
 src/nextflow_file.py            | 1 -
 8 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/src/block.py b/src/block.py
index 375341b..8d03cfc 100644
--- a/src/block.py
+++ b/src/block.py
@@ -7,11 +7,6 @@ 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 delete(self):
-        super().delete()
-        self.condition.delete()
-        del self.condition
-
     def initialise(self):
         if(self.condition.value not in self.origin.get_conditions_2_ignore()):
             return super().initialise()
diff --git a/src/call.py b/src/call.py
index 1ad4f15..02d68eb 100644
--- a/src/call.py
+++ b/src/call.py
@@ -26,9 +26,7 @@ class Call(Executor):
         #It's important this is last
         #self.condition = Condition(self)
 
-    def delete(self):
-        self.condition.delete()
-        del self.condition
+
      
     #This method returns all the calls inside a call eg p1(p2(), p3()) returns [p1(p2(), p3()), p2(), p3()]
     def get_all_calls(self):
diff --git a/src/channel.py b/src/channel.py
index cf2a68c..ca7a9e5 100644
--- a/src/channel.py
+++ b/src/channel.py
@@ -16,13 +16,14 @@ class Channel(Nextflow_Building_Blocks):
     def __init__(self, name, origin):
         self.name = name.strip()
         self.origin = origin
+        self.source = []
+        self.sink = []
         to_call = []
         for m in self.get_modules_defined():
             to_call.append(m.get_alias())
         if(self.name in to_call):
             raise BioFlowInsightError(f"'{self.name}' is trying to be created as a channel{self.get_string_line(self.origin.get_code())}. It already exists as a process or a subworkflow in the nextflow file.", num = 4, origin=self)
-        self.source = []
-        self.sink = []
+        
 
 
     def get_code(self, get_OG = True):
diff --git a/src/code_.py b/src/code_.py
index c03ff90..3fd7bd3 100644
--- a/src/code_.py
+++ b/src/code_.py
@@ -11,9 +11,6 @@ class Code:
         self.initialise()
         #self.check_its_nextflow()
 
-    def delete(self):
-        del self.code
-        del self.code_wo_comments
 
     
     def initialise(self):
diff --git a/src/executor.py b/src/executor.py
index cda3531..f37341a 100644
--- a/src/executor.py
+++ b/src/executor.py
@@ -20,7 +20,7 @@ class Executor(Nextflow_Building_Blocks):
     def __init__(self, code, origin):
         self.origin = origin
         self.code = Code(code = code, origin = self)
-        self.condition = None
+
         
         
 
diff --git a/src/main.py b/src/main.py
index 2e2551b..9167875 100644
--- a/src/main.py
+++ b/src/main.py
@@ -73,7 +73,7 @@ class Main(Nextflow_Building_Blocks):
 
             #Check that includes are not defined in the main or subworkflows
             self.check_includes()
-            self.root = Root(code=self.get_code(), origin=self, modules_defined=self.modules_defined)
+            self.root = Root(code=self.get_code(), origin=self, modules_defined=self.modules_defined, subworkflow_inputs = [])
             self.root.initialise()
 
 
diff --git a/src/nextflow_building_blocks.py b/src/nextflow_building_blocks.py
index 993e585..78954c0 100644
--- a/src/nextflow_building_blocks.py
+++ b/src/nextflow_building_blocks.py
@@ -13,14 +13,7 @@ from .bioflowinsighterror import BioFlowInsightError
 class Nextflow_Building_Blocks:
     def __init__(self, code):
         self.code = Code(code = code, origin = self)
-
-    def delete(self):
-        self.code.delete()
-        del self.code
-
-        
-
-
+    
     #---------------------------------
     #AUXILIARY METHODS FOR ALL CLASSES
     #---------------------------------
diff --git a/src/nextflow_file.py b/src/nextflow_file.py
index 719cb96..ba05366 100644
--- a/src/nextflow_file.py
+++ b/src/nextflow_file.py
@@ -307,7 +307,6 @@ class Nextflow_File(Nextflow_Building_Blocks):
                 from .main import Main
                 #Extarct Processes
                 self.extract_processes()
-                print(len(self.processes))
                 code = self.get_code()
                 #Replacing the processes defined with their identifiers -> this is to simplifly the analysis with the conditions
                 for process in self.processes:
-- 
GitLab