Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/bo4e/com/sigmoidparameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,3 @@ class Sigmoidparameter(COM):
B: Optional[Decimal] = None #: Wendepunkt für die bepreiste Menge (kW)
C: Optional[Decimal] = None #: Exponent (einheitenlos)
D: Optional[Decimal] = None #: Briefmarke Transportnetz (EUR/kWh)

def calculate(self, leistung: Decimal) -> Decimal:
"""
calculates LP
:param leistung: Leistung in Kilowatt
:return: den Sigmoidparameter LP in EUR/kWh
"""
if self.A is None or self.B is None or self.C is None or self.D is None:
raise ValueError("Sigmoidparameter is not fully defined")
return self.A / (1 + (leistung / self.B) ** self.C) + self.D
18 changes: 0 additions & 18 deletions tests/test_sigmoidparameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,3 @@ def test_sigmoidparameter_serialization_roundtrip(self, sigmoidparameter: Sigmoi
Test de-/serialisation of Sigmoidparameter with minimal attributes.
"""
assert_serialization_roundtrip(sigmoidparameter)

@pytest.mark.parametrize(
"sigmoidparameter, leistung, expected_lp",
[
pytest.param(
Sigmoidparameter(
A=Decimal(1),
B=Decimal(3),
C=Decimal(3),
D=Decimal(4),
),
Decimal(3),
Decimal(4.5),
),
],
)
def test_lp_calculation(self, sigmoidparameter: Sigmoidparameter, leistung: Decimal, expected_lp: Decimal) -> None:
assert sigmoidparameter.calculate(leistung) == expected_lp