Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
8 changes: 8 additions & 0 deletions src/bo4e/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"Angebot",
"Ausschreibung",
"Buendelvertrag",
"Einspeisung",
"Energiemenge",
"Fremdkosten",
"Geraet",
Expand Down Expand Up @@ -193,6 +194,9 @@
"Zaehlertyp",
"ZaehlertypSpezifikation",
"ZusatzAttribut",
"Profilart",
"EEGVermarktungsform",
"FernsteuerbarkeitStatus",
"__version__",
"__gh_version__",
]
Expand All @@ -203,6 +207,7 @@
from .bo.angebot import Angebot
from .bo.ausschreibung import Ausschreibung
from .bo.buendelvertrag import Buendelvertrag
from .bo.einspeisung import Einspeisung
from .bo.energiemenge import Energiemenge
from .bo.fremdkosten import Fremdkosten
from .bo.geraet import Geraet
Expand Down Expand Up @@ -314,9 +319,11 @@
from .enum.bemessungsgroesse import Bemessungsgroesse
from .enum.bilanzierungsmethode import Bilanzierungsmethode
from .enum.dienstleistungstyp import Dienstleistungstyp
from .enum.eeg_vermarktungsform import EEGVermarktungsform
from .enum.emobilitaetsart import EMobilitaetsart
from .enum.energierichtung import Energierichtung
from .enum.erzeugungsart import Erzeugungsart
from .enum.fernsteuerbarkeit_status import FernsteuerbarkeitStatus
from .enum.gasqualitaet import Gasqualitaet
from .enum.gebiettyp import Gebiettyp
from .enum.geraeteklasse import Geraeteklasse
Expand Down Expand Up @@ -352,6 +359,7 @@
from .enum.preismodell import Preismodell
from .enum.preisstatus import Preisstatus
from .enum.preistyp import Preistyp
from .enum.profilart import Profilart
from .enum.rechnungslegung import Rechnungslegung
from .enum.rechnungsstatus import Rechnungsstatus
from .enum.rechnungstyp import Rechnungstyp
Expand Down
41 changes: 41 additions & 0 deletions src/bo4e/bo/einspeisung.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""
Contains Buendelvertrag class and corresponding marshmallow schema for de-/serialization
Comment thread
hf-kklein marked this conversation as resolved.
Outdated
"""

# pylint: disable=too-few-public-methods
# pylint: disable=no-name-in-module
from typing import Optional

from ..enum.eeg_vermarktungsform import EEGVermarktungsform
from ..enum.fernsteuerbarkeit_status import FernsteuerbarkeitStatus
from ..enum.geschaeftspartnerrolle import Geschaeftspartnerrolle
from ..enum.landescode import Landescode
from ..utils import postprocess_docstring
from .geschaeftsobjekt import Geschaeftsobjekt


@postprocess_docstring
class Einspeisung(Geschaeftsobjekt):
"""
Abbildung der Einspeisung.

.. raw:: html

<object data="../_static/images/bo4e/bo/Einspeisung.svg" type="image/svg+xml"></object>

.. HINT::
`Einspeisung JSON Schema <https://json-schema.app/view/%23?url=https://raw.githubusercontent.com/BO4E/BO4E-Schemas/{__gh_version__}/src/bo4e_schemas/bo/Einspeisung.json>`_

"""

marktlokations_id: Optional[str] = None

tranchen_id: Optional[str] = None
Comment thread
hf-fvesely marked this conversation as resolved.
Outdated

verguetungsempfaenger: Optional[Geschaeftspartnerrolle] = None

eeg_vermarktungsform: Optional[EEGVermarktungsform] = None

landescode: Optional[Landescode] = None

fernsteuerbarkeit_status: Optional[FernsteuerbarkeitStatus] = None
18 changes: 18 additions & 0 deletions src/bo4e/enum/eeg_vermarktungsform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# pylint:disable=missing-module-docstring

from bo4e.enum.strenum import StrEnum


class EEGVermarktungsform(StrEnum):
"""
Diese Enum repräsentiert die Vermarktungsformen nach dem EEG.
"""

AUSFALLVERGUETUNG = "AUSFALLVERGUETUNG" #: Ausfallvergütung
# Ausfallvergütung für den Fall, dass andere Vermarktungsmethoden nicht verfügbar sind
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die Kommentare sind hier doppelt, also ich meine jeweils das obere: #: Ausfallvergütung braucht man nicht auch noch, wenn man die Langfassung hat, oder ich habe irgendeine Dokuemtationsänderung nicht mitbekommen. :-)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

@lord-haffi lord-haffi Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitte sicherstellen, ob der Kommentar in der Doku auftaucht. Bin mir relativ sicher, dass das Autodoc Feature von Sphinx nur #: über und in der Zeile und """ ... """ unter der Zeile kann.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sehr gut zu wissen, ja stimmt so hatten wir es an anderen Stellen glaub ich auch gehandhabt, ich hab bisher einfach immer geschaut wie es an anderen Stellen gemacht wird

MARKTPRAEMIE = "MARKTPRAEMIE" #: Marktprämie
# Marktprämie für die geförderte Direktvermarktung
SONSTIGES = "SONSTIGES" #: Sonstiges
Comment thread
hf-kklein marked this conversation as resolved.
Outdated
# Sonstige Vermarktungsformen ohne gesetzliche Vergütung
KWKG_VERGUETUNG = "KWKG_VERGUETUNG" #: KWKG-Vergütung
# Vergütung nach dem Kraft-Wärme-Kopplungsgesetz (KWKG)
19 changes: 19 additions & 0 deletions src/bo4e/enum/fernsteuerbarkeit_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# pylint:disable=missing-module-docstring

from bo4e.enum.strenum import StrEnum


class FernsteuerbarkeitStatus(StrEnum):
"""
Enum zur Abbildung des Status der Fernsteuerbarkeit

Marktlokation ist technisch fernsteuerbar. Der NB bestätigt mit der Anmeldung einer erzeugenden Marktlokation zur
Direktvermarktung, dass die Marktlokation mit einer Fernsteuerung ausgestattet, aber dem NB keine Information
darüber vorliegt, dass der LF die Marktlokation fernsteuern kann. Die Voraussetzung zur Zahlung der
Managementprämie für fernsteuerbare Marktlokation ist nicht gegeben.
Comment thread
FreddyFox892 marked this conversation as resolved.
"""

NICHT_FERNSTEUERBAR = "NICHT_FERNSTEUERBAR" #: nicht fernsteuerbar
TECHNISCH_FERNSTEUERBAR = "TECHNISCH_FERNSTEUERBAR" #: technisch fernsteuerbar
LIEFERANT_FERNSTEUERBAR = "LIEFERANT_FERNSTEUERBAR" #: lieferantenseitig fernsteuerbar
#
22 changes: 22 additions & 0 deletions src/bo4e/enum/profilart.py
Copy link
Copy Markdown
Contributor

@hf-kklein hf-kklein Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was hat die profilart mit dem BO Einspeisung zu tun?
ich weiß, ich hab selbst den PR umbenannt, aber die klammer um die änderungen ist doch das BO Einspeisung? und da fällt die profilart aus der reihe

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stimmt, aber war in dem .net pr so mit drin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dann löschen wir es hier raus und machen einen eigenen PR? sonst ist es ja komisch zu reviewen

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bin auch für erstmal löschen, da es so ja derzeit nicht in der lib genutzt wird. Und den docstring müssten wir dann auh eh nochmal neu schreiben, aber dann erst wenn wir das COM Lastprofil auch einbauen

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# pylint:disable=missing-module-docstring

from bo4e.enum.strenum import StrEnum


class Profilart(StrEnum):
"""
Diese Rollen kann ein Geschäftspartner einnehmen.
Comment thread
hf-kklein marked this conversation as resolved.
Outdated

Profilart (temperaturabhängig / standardlastprofil)
"""

ART_STANDARDLASTPROFILOBJ = "ART_STANDARDLASTPROFILOBJ"
Comment thread
hf-kklein marked this conversation as resolved.
Outdated
#: Standardlastprofil
ART_TAGESPARAMETERABHAENGIGES_LASTPROFIL = "ART_TAGESPARAMETERABHAENGIGES_LASTPROFIL"
#: Tagesparameterabhängiges Lastprofil
ART_LASTPROFIL = "ART_LASTPROFIL"
#: Lastprofil
ART_STANDARDEINSPEISEPROFIL = "ART_STANDARDEINSPEISEPROFIL"
#: Standardeinspeiseprofil
ART_TAGESPARAMETERABHAENGIGES_EINSPEISEPROFIL = "ART_TAGESPARAMETERABHAENGIGES_EINSPEISEPROFIL"
#: Tagesparameterabhängiges Einspeiseprofil
31 changes: 31 additions & 0 deletions tests/test_einspeisung.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import pytest

from bo4e import Geschaeftspartnerrolle, Landescode
from bo4e.bo.einspeisung import Einspeisung
from bo4e.enum.eeg_vermarktungsform import EEGVermarktungsform
from bo4e.enum.fernsteuerbarkeit_status import FernsteuerbarkeitStatus
from tests.serialization_helper import assert_serialization_roundtrip


class TestEinspeisung:
@pytest.mark.parametrize(
"einspeisung",
[
pytest.param(
Einspeisung(
marktlokations_id="teststring",
tranchen_id="teststring",
verguetungsempfaenger=Geschaeftspartnerrolle.LIEFERANT,
eeg_vermarktungsform=EEGVermarktungsform.KWKG_VERGUETUNG,
landescode=Landescode.DE, # type:ignore[attr-defined]
fernsteuerbarkeit_status=FernsteuerbarkeitStatus.NICHT_FERNSTEUERBAR,
),
id="all attributes at first level",
),
],
)
def test_serialization_roundtrip(self, einspeisung: Einspeisung) -> None:
"""
Test de-/serialisation of Einspeisung
"""
assert_serialization_roundtrip(einspeisung)