Skip to content

Commit

Permalink
refactor(filesystem): remove unused initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Jun 18, 2024
1 parent 04244a8 commit 1155701
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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 = {}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {}
Expand Down

0 comments on commit 1155701

Please sign in to comment.