-
Notifications
You must be signed in to change notification settings - Fork 5
Add BO Einspeisung #883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add BO Einspeisung #883
Changes from 4 commits
c305592
9e582ae
1a90517
c69f49c
81361e5
e053ffc
deb0bb5
d40e2bc
b74faaa
a15bb3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| """ | ||
| Contains Buendelvertrag class and corresponding marshmallow schema for de-/serialization | ||
| """ | ||
|
|
||
| # 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 | ||
|
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 | ||
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. :-)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
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) | ||
| 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. | ||
|
FreddyFox892 marked this conversation as resolved.
|
||
| """ | ||
|
|
||
| NICHT_FERNSTEUERBAR = "NICHT_FERNSTEUERBAR" #: nicht fernsteuerbar | ||
| TECHNISCH_FERNSTEUERBAR = "TECHNISCH_FERNSTEUERBAR" #: technisch fernsteuerbar | ||
| LIEFERANT_FERNSTEUERBAR = "LIEFERANT_FERNSTEUERBAR" #: lieferantenseitig fernsteuerbar | ||
| # | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was hat die profilart mit dem BO Einspeisung zu tun?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stimmt, aber war in dem .net pr so mit drin
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
hf-kklein marked this conversation as resolved.
Outdated
|
||
|
|
||
| Profilart (temperaturabhängig / standardlastprofil) | ||
| """ | ||
|
|
||
| ART_STANDARDLASTPROFILOBJ = "ART_STANDARDLASTPROFILOBJ" | ||
|
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 | ||
| 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) |
Uh oh!
There was an error while loading. Please reload this page.