Skip to content

Commit

Permalink
refactor: remove unused energy model method
Browse files Browse the repository at this point in the history
It should no longer be necessary to get regularity via EnergyModel.
Venting emitters already know their regularity now.
  • Loading branch information
jsolaas committed Feb 26, 2025
1 parent 3182607 commit 696a93e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
9 changes: 0 additions & 9 deletions src/libecalc/domain/energy/energy_model.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
import abc
from datetime import datetime

from libecalc.domain.energy.energy_component import EnergyComponent
from libecalc.expression import Expression


class EnergyModel(abc.ABC):
"""
Energy model contains energy components which can be consumers, providers, emitters
"""

@abc.abstractmethod
def get_regularity(self, component_id: str) -> dict[datetime, Expression]:
"""
Temporary solution to get regularity since (dto) components don't have the necessary info to evaluate itself.
"""
...

@abc.abstractmethod
def get_consumers(self, provider_id: str = None) -> list[EnergyComponent]:
"""
Expand Down
7 changes: 0 additions & 7 deletions src/libecalc/presentation/yaml/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
)
from libecalc.dto import ResultOptions
from libecalc.dto.component_graph import ComponentGraph
from libecalc.expression import Expression
from libecalc.presentation.yaml.configuration_service import ConfigurationService
from libecalc.presentation.yaml.domain.reference_service import ReferenceService
from libecalc.presentation.yaml.domain.time_series_collections import TimeSeriesCollections
Expand Down Expand Up @@ -82,12 +81,6 @@ def __init__(
self._is_validated = False
self._graph = None

def get_regularity(self, component_id: str) -> dict[datetime, Expression]:
graph = self.get_graph()
installation_id = graph.get_parent_installation_id(component_id)
installation = graph.get_node(installation_id)
return installation.regularity

def get_consumers(self, provider_id: str = None) -> list[EnergyComponent]:
return self.get_graph().get_consumers(provider_id)

Expand Down

0 comments on commit 696a93e

Please sign in to comment.