Skip to content

Commit

Permalink
refactor: remove result from generator
Browse files Browse the repository at this point in the history
Make it easier to reuse generator by not including unused parameter
  • Loading branch information
jsolaas committed Jun 13, 2024
1 parent c2d9dc9 commit 9a2f9a9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions src/libecalc/presentation/exporter/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def filter(
energy_calculator_result: GraphResult,
time_vector: List[datetime],
) -> FilteredResult:
data_series_collection = [
generator.generate(energy_calculator_result, time_vector) for generator in self.generators
]
data_series_collection = [generator.generate(time_vector) for generator in self.generators]
query_result_collection = self.aggregator.aggregate(energy_calculator_result)

return FilteredResult(
Expand Down
4 changes: 0 additions & 4 deletions src/libecalc/presentation/exporter/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
from datetime import datetime
from typing import List

from libecalc.application.graph_result import GraphResult
from libecalc.dto.result import EcalcModelResult
from libecalc.presentation.exporter.dto.dtos import DataSeries


class Generator(abc.ABC):
@abc.abstractmethod
def generate(
self,
energy_calculator_result: GraphResult,
time_vector: List[datetime],
) -> DataSeries:
pass
Expand All @@ -30,7 +27,6 @@ def __init__(

def generate(
self,
energy_calculator_result: EcalcModelResult,
time_vector: List[datetime],
) -> DataSeries:
return DataSeries(
Expand Down

0 comments on commit 9a2f9a9

Please sign in to comment.