From 1155701e12246dc9deecd6018fe83e69271e7b14 Mon Sep 17 00:00:00 2001 From: belthlemar Date: Wed, 12 Jun 2024 17:40:29 +0200 Subject: [PATCH] refactor(filesystem): remove unused initialization --- .../output/simulation/mode/common/binding_const.py | 9 --------- .../filesystem/root/output/simulation/mode/economy.py | 4 +--- .../root/output/simulation/mode/mcall/grid.py | 9 --------- .../root/output/simulation/mode/mcall/mcall.py | 11 ----------- .../root/output/simulation/mode/mcind/mcind.py | 2 +- .../root/output/simulation/mode/mcind/scn.py | 7 ------- 6 files changed, 2 insertions(+), 40 deletions(-) diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/binding_const.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/binding_const.py index 804b97b141..822c5c8d93 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/binding_const.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/common/binding_const.py @@ -1,5 +1,3 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig -from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.matrix.matrix import MatrixFrequency @@ -9,13 +7,6 @@ class OutputSimulationBindingConstraintItem(FolderNode): - def __init__( - self, - context: ContextServer, - config: FileStudyTreeConfig, - ): - super().__init__(context, config) - def build(self) -> TREE: existing_files = [d.stem.replace("binding-constraints-", "") for d in self.config.path.iterdir()] children: TREE = { diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/economy.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/economy.py index 7380f9d4da..eec1cd2a77 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/economy.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/economy.py @@ -27,8 +27,6 @@ def build(self) -> TREE: self.context, self.config.next_file("mc-ind"), self.simulation ) if self.simulation.synthesis: - children["mc-all"] = OutputSimulationModeMcAll( - self.context, self.config.next_file("mc-all"), self.simulation - ) + children["mc-all"] = OutputSimulationModeMcAll(self.context, self.config.next_file("mc-all")) return children diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/grid.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/grid.py index be39571ad4..6778e09b7d 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/grid.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/grid.py @@ -1,18 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig -from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.raw_file_node import RawFileNode class OutputSimulationModeMcAllGrid(FolderNode): - def __init__( - self, - context: ContextServer, - config: FileStudyTreeConfig, - ): - FolderNode.__init__(self, context, config) - def build(self) -> TREE: files = [d.stem for d in self.config.path.iterdir()] children: TREE = {} diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/mcall.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/mcall.py index 53858f8a70..ff9aded294 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/mcall.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcall/mcall.py @@ -1,20 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig, Simulation -from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common.utils import OUTPUT_MAPPING class OutputSimulationModeMcAll(FolderNode): - def __init__( - self, - context: ContextServer, - config: FileStudyTreeConfig, - simulation: Simulation, - ): - FolderNode.__init__(self, context, config) - self.simulation = simulation - def build(self) -> TREE: if not self.config.output_path: return {} diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/mcind.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/mcind.py index 2155f8f5bc..8007eddd91 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/mcind.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/mcind.py @@ -20,7 +20,7 @@ def __init__( def build(self) -> TREE: children: TREE = { str("{:05d}".format(scn)): OutputSimulationModeMcIndScn( - self.context, self.config.next_file("{:05d}".format(scn)), self.simulation, "{:05d}".format(scn) + self.context, self.config.next_file("{:05d}".format(scn)) ) for scn in self.simulation.playlist or range(1, self.simulation.nbyears + 1) } diff --git a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/scn.py b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/scn.py index 22f787b2bb..4a2ce634a8 100644 --- a/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/scn.py +++ b/antarest/study/storage/rawstudy/model/filesystem/root/output/simulation/mode/mcind/scn.py @@ -1,16 +1,9 @@ -from antarest.study.storage.rawstudy.model.filesystem.config.model import FileStudyTreeConfig, Simulation -from antarest.study.storage.rawstudy.model.filesystem.context import ContextServer from antarest.study.storage.rawstudy.model.filesystem.folder_node import FolderNode from antarest.study.storage.rawstudy.model.filesystem.inode import TREE from antarest.study.storage.rawstudy.model.filesystem.root.output.simulation.mode.common.utils import OUTPUT_MAPPING class OutputSimulationModeMcIndScn(FolderNode): - def __init__(self, context: ContextServer, config: FileStudyTreeConfig, simulation: Simulation, scenario: str): - FolderNode.__init__(self, context, config) - self.simulation = simulation - self.scenario = scenario - def build(self) -> TREE: if not self.config.output_path: return {}