From 1a91f7642de6c4e9982377e757d9e2f6fdf8a094 Mon Sep 17 00:00:00 2001 From: alya Date: Wed, 18 Dec 2024 15:53:02 +0200 Subject: [PATCH] refactor --- comparisons/flow_by_flow.py | 7 +++---- comparisons/per_timewindow.py | 2 +- main.py | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/comparisons/flow_by_flow.py b/comparisons/flow_by_flow.py index 1ff0158..325f531 100644 --- a/comparisons/flow_by_flow.py +++ b/comparisons/flow_by_flow.py @@ -16,16 +16,15 @@ class FlowByFlow(ComparisonMethod): def init(self, args: list): self.supported_tools: Tuple[str] = args[0] - def handle_flow_by_flow_comparison(self): + def compare(self): self.log('', "-" * 30) self.log("Comparison method: ", self.name) self.log(' ', ' ') - # now apply this method to all supported tools + # apply this method to all supported tools for tool in self.supported_tools: - # get the actual and predicted labels by the tool calc = Calculator(tool, self.output_dir) - + # get the actual and predicted labels by the tool labels: Iterator = self.get_labels(tool) cm: dict = calc.get_confusion_matrix(labels) self.db.store_performance_errors_flow_by_flow(tool, cm) diff --git a/comparisons/per_timewindow.py b/comparisons/per_timewindow.py index 750fad3..1c6014a 100644 --- a/comparisons/per_timewindow.py +++ b/comparisons/per_timewindow.py @@ -14,7 +14,7 @@ def init(self, args: list): self.supported_tools: Tuple[str] = args[0] self.last_registered_tw: int = self.db.get_last_registered_timewindow() - def handle_per_tw_comparison(self): + def compare(self): self.log('', "-" * 30) self.log("Comparison method: ", self.name) self.log(' ', ' ') diff --git a/main.py b/main.py index 9a4ac3f..068faa4 100644 --- a/main.py +++ b/main.py @@ -253,10 +253,10 @@ def main(self): FlowByFlow(self.output_dir, self.supported_tools - ).handle_flow_by_flow_comparison() + ).compare() PerTimewindow(self.output_dir, self.supported_tools - ).handle_per_tw_comparison() + ).compare() self.db.close()