-
Notifications
You must be signed in to change notification settings - Fork 6
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
Open
FreddyFox892
wants to merge
10
commits into
main
Choose a base branch
from
FST/Issue878_UpdateBO_Enums
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add BO Einspeisung #883
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c305592
First try
FreddyFox892 9e582ae
.-
FreddyFox892 1a90517
add test
FreddyFox892 c69f49c
..
FreddyFox892 81361e5
ka
FreddyFox892 e053ffc
fa
FreddyFox892 deb0bb5
Update src/bo4e/enum/fernsteuerbarkeit_status.py
FreddyFox892 d40e2bc
rmv profilart
FreddyFox892 b74faaa
Merge branch 'main' into FST/Issue878_UpdateBO_Enums
FreddyFox892 a15bb3e
Merge remote-tracking branch 'origin/main' into FST/Issue878_UpdateBO…
hf-fvesely File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| """ | ||
| Contains Einspeisung 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 | ||
|
|
||
| tranche_id: Optional[str] = None | ||
|
|
||
| verguetungsempfaenger: Optional[Geschaeftspartnerrolle] = None | ||
|
|
||
| eeg_vermarktungsform: Optional[EEGVermarktungsform] = None | ||
|
|
||
| landescode: Optional[Landescode] = None | ||
|
|
||
| fernsteuerbarkeit_status: Optional[FernsteuerbarkeitStatus] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # 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 für den Fall, dass andere Vermarktungsmethoden nicht verfügbar sind | ||
|
|
||
| MARKTPRAEMIE = "MARKTPRAEMIE" | ||
| # Marktprämie für die geförderte Direktvermarktung | ||
|
|
||
| SONSTIGE = "SONSTIGE" | ||
| # Sonstige Vermarktungsformen ohne gesetzliche Vergütung | ||
|
|
||
| KWKG_VERGUETUNG = "KWKG_VERGUETUNG" | ||
| # Vergütung nach dem Kraft-Wärme-Kopplungsgesetz (KWKG) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ist, 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. | ||
| """ | ||
|
|
||
| NICHT_FERNSTEUERBAR = "NICHT_FERNSTEUERBAR" #: nicht fernsteuerbar | ||
| TECHNISCH_FERNSTEUERBAR = "TECHNISCH_FERNSTEUERBAR" #: technisch fernsteuerbar | ||
| LIEFERANT_FERNSTEUERBAR = "LIEFERANT_FERNSTEUERBAR" #: lieferantenseitig fernsteuerbar | ||
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", | ||
| tranche_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) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e053ffc
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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