Skip to content

Commit 6e272fb

Browse files
committed
chore: remove type ignore
1 parent f88d163 commit 6e272fb

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

src/libecalc/domain/infrastructure/path_id.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ def get_unique_tuple_str(self) -> tuple[str, ...]:
4949
if self.has_unique_name():
5050
return (self._name,)
5151

52-
return (self._name, *self._parent.get_unique_tuple_str())
52+
return self._name, *self._parent.get_unique_tuple_str()

src/libecalc/presentation/exporter/domain/exportable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from abc import ABC, abstractmethod
2-
from collections.abc import Iterable, Iterator
2+
from collections.abc import Iterable, Iterator, Sequence
33
from dataclasses import dataclass
44
from enum import Enum
55

@@ -34,7 +34,7 @@ def get_meta(self) -> AttributeMeta: ...
3434

3535
@dataclass
3636
class AttributeSet(ABC):
37-
attributes: list[Attribute]
37+
attributes: Sequence[Attribute]
3838

3939
def __iter__(self) -> Iterator[Attribute]:
4040
return self.attributes.__iter__()

src/libecalc/presentation/exporter/infrastructure.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929

3030

3131
class TimeSeriesAttribute(Attribute):
32-
def __init__(self, time_series: TimeSeries, attribute_meta: AttributeMeta):
32+
def __init__(self, time_series: TimeSeries[float], attribute_meta: AttributeMeta):
3333
self._attribute_meta = attribute_meta
3434
self._time_series = time_series
3535

36-
def datapoints(self) -> Iterable[tuple[datetime, float]]: # type: ignore[override]
36+
def datapoints(self) -> Iterable[tuple[Period, float]]:
3737
return self._time_series.datapoints()
3838

3939
def get_meta(self) -> AttributeMeta:
@@ -91,7 +91,7 @@ def get_electricity_production(self, unit: Unit) -> AttributeSet:
9191
),
9292
)
9393
)
94-
return AttributeSet(attributes) # type: ignore[arg-type]
94+
return AttributeSet(attributes)
9595

9696
def get_maximum_electricity_production(self, unit: Unit) -> AttributeSet:
9797
attributes = []
@@ -130,7 +130,7 @@ def get_maximum_electricity_production(self, unit: Unit) -> AttributeSet:
130130
),
131131
)
132132
)
133-
return AttributeSet(attributes) # type: ignore[arg-type]
133+
return AttributeSet(attributes)
134134

135135
def get_storage_volumes(self, unit: Unit) -> AttributeSet:
136136
attributes = []
@@ -155,7 +155,7 @@ def get_storage_volumes(self, unit: Unit) -> AttributeSet:
155155
),
156156
)
157157
)
158-
return AttributeSet(attributes) # type: ignore[arg-type]
158+
return AttributeSet(attributes)
159159

160160
def get_category(self) -> str:
161161
return self._installation_dto.user_defined_category
@@ -248,7 +248,7 @@ def get_fuel_consumption(self) -> AttributeSet:
248248
)
249249
)
250250

251-
return AttributeSet(attributes) # type: ignore[arg-type]
251+
return AttributeSet(attributes)
252252

253253
def get_power_consumption(self, unit: Unit) -> AttributeSet:
254254
attributes = []
@@ -325,14 +325,13 @@ def get_power_consumption(self, unit: Unit) -> AttributeSet:
325325
)
326326

327327
else:
328-
# TODO: is this ok?
329328
logger.warning(
330329
f"A combination of one or more compressors that do not support fuel to power conversion was used."
331330
f"We are therefore unable to calculate correct power usage. Please only use compressors which support POWER conversion"
332331
f"for fuel consumer '{fuel_consumer.name}'"
333332
)
334333

335-
return AttributeSet(attributes) # type: ignore[arg-type]
334+
return AttributeSet(attributes)
336335

337336
def get_emissions(self, unit: Unit) -> AttributeSet:
338337
attributes = []
@@ -387,7 +386,7 @@ def get_emissions(self, unit: Unit) -> AttributeSet:
387386
)
388387
)
389388

390-
return AttributeSet(attributes) # type: ignore[arg-type]
389+
return AttributeSet(attributes)
391390

392391
def get_name(self) -> str:
393392
return self._installation_graph.graph.get_node_info(self._installation_graph.graph.root).name

0 commit comments

Comments
 (0)