Skip to content

Commit ce8ae72

Browse files
DeltaDaniellord-haffihf-fveselyhf-kkleinFreddyFox892
authored
Add BO Bilanzierung and necessary COMs and ENUMs (#508)
* 🚧 initialized bo bilanzierungs class * 🚧 added Lastprofil-Klasse and testing functions. * 🚧 Update Formatierung * 🚧 fixed isort * 🚧 added MaLo validator * 🚧 fixed minor issue in field validator in bilanzierung.py * 🗑️ removed unused comment * 🗑️ removed unused comments -> required/optional attributes * 💡 updated comments for field validators * 🗑️ removed depracted comment in enum botyp * 💡 Updated description for enums. * 💡 updated formatting of comments * ✅ added testsvariables to bo bilanzierung * Minor corrections * ✅ Fixed tests in bo * Update src/bo4e/bo/bilanzierung.py Co-authored-by: Leon Haffmans <49658102+lord-haffi@users.noreply.github.com> * Update tests/test_bilanzierung.py Co-authored-by: Leon Haffmans <49658102+lord-haffi@users.noreply.github.com> * typo/black/iso * 📝 updated documentation * Add new BO, COMs and ENUMs to init.py * Remove validation and adapt test * Also adapt Lastprofil Test * And also Tagesparameter test * changed type of "verbrauchsaufteilung": float -> decimal * added missing import to __init__.py * Update src/bo4e/bo/bilanzierung.py Co-authored-by: Leon Haffmans <49658102+lord-haffi@users.noreply.github.com> * Update src/bo4e/bo/bilanzierung.py Co-authored-by: Leon Haffmans <49658102+lord-haffi@users.noreply.github.com> * Update src/bo4e/bo/bilanzierung.py Co-authored-by: Leon Haffmans <49658102+lord-haffi@users.noreply.github.com> * Update src/bo4e/bo/bilanzierung.py Co-authored-by: Leon Haffmans <49658102+lord-haffi@users.noreply.github.com> * Update src/bo4e/com/lastprofil.py Co-authored-by: Leon Haffmans <49658102+lord-haffi@users.noreply.github.com> * Update src/bo4e/com/tagesparameter.py Co-authored-by: Leon Haffmans <49658102+lord-haffi@users.noreply.github.com> * changed docstrings * Add Abwicklungsmodell ENums to Bilanzierung * Update Profielart * black . * Spell out Enums in Fallgruppenzuordnung * Adapt test data * Adapt boolean name * Adapt tests for new boolean name * Remove wrong info in docstring * Fix grammar * Adapt ENUM Abwicklungsmodell --------- Co-authored-by: Daniel <139119540+hf-ddernbach@users.noreply.github.com> Co-authored-by: Leon Haffmans <49658102+lord-haffi@users.noreply.github.com> Co-authored-by: Franziska <franziska.vesely@hochfrequenz.de> Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de> Co-authored-by: Fstei <frederik.steinkamp@hochfrequenz.de> Co-authored-by: Annika Schloegl <annika.schloegl@hochfrequenz.de> Co-authored-by: Annika <73470827+hf-aschloegl@users.noreply.github.com>
1 parent 4d8e18f commit ce8ae72

18 files changed

Lines changed: 433 additions & 1 deletion

src/bo4e/__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
"""
1010

1111
__all__ = [
12+
"Abwicklungsmodell",
1213
"Angebot",
1314
"Ausschreibung",
15+
"Bilanzierung",
1416
"Buendelvertrag",
1517
"Energiemenge",
1618
"Fremdkosten",
@@ -68,6 +70,7 @@
6870
"Kostenblock",
6971
"Kostenposition",
7072
"KriteriumWert",
73+
"Lastprofil",
7174
"MarktgebietInfo",
7275
"Menge",
7376
"PositionsAufAbschlag",
@@ -86,6 +89,7 @@
8689
"StandorteigenschaftenGas",
8790
"StandorteigenschaftenStrom",
8891
"Steuerbetrag",
92+
"Tagesparameter",
8993
"Tarifberechnungsparameter",
9094
"Tarifeinschraenkung",
9195
"Tarifpreis",
@@ -103,6 +107,7 @@
103107
"Zeitreihenwert",
104108
"Zustaendigkeit",
105109
"AbgabeArt",
110+
"Aggregationsverantwortung",
106111
"Angebotsstatus",
107112
"Anrede",
108113
"ArithmetischeOperation",
@@ -120,6 +125,7 @@
120125
"EMobilitaetsart",
121126
"Energierichtung",
122127
"Erzeugungsart",
128+
"Fallgruppenzuordnung",
123129
"Gasqualitaet",
124130
"Gebiettyp",
125131
"Geraeteklasse",
@@ -156,6 +162,10 @@
156162
"Preismodell",
157163
"Preisstatus",
158164
"Preistyp",
165+
"Profilart",
166+
"Profiltyp",
167+
"Profilverfahren",
168+
"Prognosegrundlage",
159169
"Rechnungslegung",
160170
"Rechnungsstatus",
161171
"Rechnungstyp",
@@ -183,6 +193,7 @@
183193
"Vertragsstatus",
184194
"Verwendungszweck",
185195
"Voraussetzungen",
196+
"WahlrechtPrognosegrundlage",
186197
"Waehrungscode",
187198
"Waehrungseinheit",
188199
"Waermenutzung",
@@ -191,6 +202,7 @@
191202
"Zaehlergroesse",
192203
"Zaehlertyp",
193204
"ZaehlertypSpezifikation",
205+
"Zeitreihentyp",
194206
"ZusatzAttribut",
195207
"__version__",
196208
"__gh_version__",
@@ -201,6 +213,7 @@
201213
# Import BOs
202214
from .bo.angebot import Angebot
203215
from .bo.ausschreibung import Ausschreibung
216+
from .bo.bilanzierung import Bilanzierung
204217
from .bo.buendelvertrag import Buendelvertrag
205218
from .bo.energiemenge import Energiemenge
206219
from .bo.fremdkosten import Fremdkosten
@@ -261,6 +274,7 @@
261274
from .com.kostenblock import Kostenblock
262275
from .com.kostenposition import Kostenposition
263276
from .com.kriteriumwert import KriteriumWert
277+
from .com.lastprofil import Lastprofil
264278
from .com.marktgebietinfo import MarktgebietInfo
265279
from .com.menge import Menge
266280
from .com.positionsaufabschlag import PositionsAufAbschlag
@@ -279,6 +293,7 @@
279293
from .com.standorteigenschaftengas import StandorteigenschaftenGas
280294
from .com.standorteigenschaftenstrom import StandorteigenschaftenStrom
281295
from .com.steuerbetrag import Steuerbetrag
296+
from .com.tagesparameter import Tagesparameter
282297
from .com.tarifberechnungsparameter import Tarifberechnungsparameter
283298
from .com.tarifeinschraenkung import Tarifeinschraenkung
284299
from .com.tarifpreis import Tarifpreis
@@ -298,6 +313,8 @@
298313

299314
# Import Enums
300315
from .enum.abgabeart import AbgabeArt
316+
from .enum.abwicklungsmodell import Abwicklungsmodell
317+
from .enum.aggregationsverantwortung import Aggregationsverantwortung
301318
from .enum.angebotsstatus import Angebotsstatus
302319
from .enum.anrede import Anrede
303320
from .enum.arithmetische_operation import ArithmetischeOperation
@@ -315,6 +332,7 @@
315332
from .enum.emobilitaetsart import EMobilitaetsart
316333
from .enum.energierichtung import Energierichtung
317334
from .enum.erzeugungsart import Erzeugungsart
335+
from .enum.fallgruppenzuordnung import Fallgruppenzuordnung
318336
from .enum.gasqualitaet import Gasqualitaet
319337
from .enum.gebiettyp import Gebiettyp
320338
from .enum.geraeteklasse import Geraeteklasse
@@ -350,6 +368,10 @@
350368
from .enum.preismodell import Preismodell
351369
from .enum.preisstatus import Preisstatus
352370
from .enum.preistyp import Preistyp
371+
from .enum.profilart import Profilart
372+
from .enum.profiltyp import Profiltyp
373+
from .enum.profilverfahren import Profilverfahren
374+
from .enum.prognosegrundlage import Prognosegrundlage
353375
from .enum.rechnungslegung import Rechnungslegung
354376
from .enum.rechnungsstatus import Rechnungsstatus
355377
from .enum.rechnungstyp import Rechnungstyp
@@ -380,11 +402,13 @@
380402
from .enum.waehrungscode import Waehrungscode
381403
from .enum.waehrungseinheit import Waehrungseinheit
382404
from .enum.waermenutzung import Waermenutzung
405+
from .enum.wahlrechtprognosegrundlage import WahlrechtPrognosegrundlage
383406
from .enum.wertermittlungsverfahren import Wertermittlungsverfahren
384407
from .enum.zaehlerauspraegung import Zaehlerauspraegung
385408
from .enum.zaehlergroesse import Zaehlergroesse
386409
from .enum.zaehlertyp import Zaehlertyp
387410
from .enum.zaehlertypspezifikation import ZaehlertypSpezifikation
411+
from .enum.zeitreihentyp import Zeitreihentyp
388412
from .version import __gh_version__, __version__
389413
from .zusatzattribut import ZusatzAttribut
390414

src/bo4e/bo/bilanzierung.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
"""
2+
Contains class Bilanzierung
3+
"""
4+
5+
from datetime import datetime
6+
from decimal import Decimal
7+
from typing import Annotated, Optional
8+
9+
from pydantic import Field
10+
11+
from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt
12+
from bo4e.com.lastprofil import Lastprofil
13+
from bo4e.com.menge import Menge
14+
from bo4e.enum.aggregationsverantwortung import Aggregationsverantwortung
15+
from bo4e.enum.fallgruppenzuordnung import Fallgruppenzuordnung
16+
from bo4e.enum.profiltyp import Profiltyp
17+
from bo4e.enum.prognosegrundlage import Prognosegrundlage
18+
from bo4e.enum.wahlrechtprognosegrundlage import WahlrechtPrognosegrundlage
19+
from bo4e.enum.zeitreihentyp import Zeitreihentyp
20+
21+
from ..enum.abwicklungsmodell import Abwicklungsmodell
22+
from ..enum.typ import Typ
23+
24+
25+
class Bilanzierung(Geschaeftsobjekt):
26+
"""
27+
Das BO Bilanzierung erfasst alle relevanten Informationen zur Bilanzierung.
28+
29+
.. raw:: html
30+
31+
<object data="../_static/images/bo4e/bo/Bilanzierung.svg" type="image/svg+xml"></object>
32+
33+
.. HINT::
34+
`Lastprofil JSON Schema <https://json-schema.app/view/%23?url=https://raw.githubusercontent.com/Hochfrequenz/BO4E-Schemas/{__gh_version__}/src/bo4e_schemas/bo/Bilanzierung.json>`_
35+
36+
"""
37+
38+
typ: Annotated[Optional[Typ], Field(alias="_typ")] = Typ.BILANZIERUNG
39+
40+
marktlokations_id: Optional[str] = None #: ID der Marktlokation
41+
lastprofil: Optional[list[Lastprofil]] = None #: Eine Liste der verwendeten Lastprofile (SLP, SLP/TLP, ALP etc.)
42+
bilanzierungsbeginn: Optional[datetime] = None #: Inklusiver Start der Bilanzierung
43+
bilanzierungsende: Optional[datetime] = None #: Exklusives Ende der Bilanzierung
44+
bilanzkreis: Optional[str] = None #: Bilanzkreis
45+
jahresverbrauchsprognose: Optional[Menge] = None #: Jahresverbrauchsprognose
46+
temperatur_arbeit: Optional[Menge] = None #: Temperatur Arbeit
47+
kundenwert: Optional[Menge] = None #: Kundenwert
48+
verbrauchsaufteilung: Optional[Decimal] = None
49+
"""
50+
Verbrauchsaufteilung in % zwischen SLP und TLP-Profil.
51+
52+
1. [Gemessene Energiemenge der OBIS "nicht Schwachlast"] * [Verbrauchsaufteilung in % / 100%]
53+
= [zu verlagernde Energiemenge]
54+
2. [Gemessene Energiemenge der OBIS "Schwachlast"] - [zu verlagernde Energiemenge]
55+
= [Ermittelte Energiemenge für Schwachlast]
56+
3. [Gemessene Energiemenge der OBIS "nicht Schwachlast"] + [zu verlagernde Energiemenge]
57+
= [Ermittelte Energiemenge für nicht Schwachlast]
58+
"""
59+
zeitreihentyp: Optional[Zeitreihentyp] = None #: Zeitreihentyp (SLS, TLS, etc.)
60+
aggregationsverantwortung: Optional[Aggregationsverantwortung] = None #: Aggregationsverantwortung
61+
prognosegrundlage: Optional[Prognosegrundlage] = None #: Prognosegrundlage
62+
details_prognosegrundlage: Optional[list[Profiltyp]] = None
63+
"""
64+
Prognosegrundlage.
65+
66+
Besteht der Bedarf ein tagesparameteräbhängiges Lastprofil mit gemeinsamer Messung anzugeben,
67+
so ist dies über die 2 -malige Wiederholung des CAV Segments mit der Angabe der Codes E02 und E14 möglich.
68+
"""
69+
wahlrecht_prognosegrundlage: Optional[WahlrechtPrognosegrundlage] = None
70+
"""
71+
Wahlrecht der Prognosegrundlage.
72+
"""
73+
fallgruppenzuordnung: Optional[Fallgruppenzuordnung] = None #: Fallgruppenzuordnung (für gas RLM)
74+
prioritaet: Optional[int] = None #: Priorität des Bilanzkreises (für Gas)
75+
grund_wahlrecht_prognosegrundlage: Optional[WahlrechtPrognosegrundlage] = None
76+
"""
77+
Grund Wahlrecht der Prognosegrundlage.
78+
79+
true=Wahlrecht beim Lieferanten vorhanden
80+
"""
81+
abwicklungsmodell: Optional[Abwicklungsmodell] = None #: Abwicklungsmodell

src/bo4e/bo/energiemenge.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class Energiemenge(Geschaeftsobjekt):
3737
typ: Annotated[Literal[Typ.ENERGIEMENGE], Field(alias="_typ")] = Typ.ENERGIEMENGE
3838
lokations_id: Optional[str] = None
3939
"""Eindeutige Nummer der Marktlokation bzw. der Messlokation, zu der die Energiemenge gehört"""
40-
# todo: add validator such that only mess- or marktlokations IDs are accepted + cross check with lokationstyp
4140
lokationstyp: Optional["Lokationstyp"] = None
4241
"""Gibt an, ob es sich um eine Markt- oder Messlokation handelt"""
4342

src/bo4e/com/lastprofil.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""
2+
Contains class Lastprofil
3+
"""
4+
5+
from typing import Optional
6+
7+
from bo4e.com.com import COM
8+
from bo4e.com.tagesparameter import Tagesparameter
9+
from bo4e.enum.profilart import Profilart
10+
from bo4e.enum.profilverfahren import Profilverfahren
11+
12+
13+
class Lastprofil(COM):
14+
"""
15+
Informationen zum Lastprofil.
16+
17+
.. raw:: html
18+
19+
<object data="../_static/images/bo4e/com/Lastprofil.svg" type="image/svg+xml"></object>
20+
21+
.. HINT::
22+
`Lastprofil JSON Schema <https://json-schema.app/view/%23?url=https://raw.githubusercontent.com/Hochfrequenz/BO4E-Schemas/{__gh_version__}/src/bo4e_schemas/com/Lastprofil.json>`_
23+
24+
"""
25+
26+
bezeichnung: Optional[str] = None #: Bezeichnung des Profils, durch DVGW bzw. den Netzbetreiber vergeben (z.B. H0)
27+
profilschar: Optional[str] = (
28+
None #: Bezeichnung der Profilschar, durch DVGW bzw. den Netzbetreiber vergeben (z.B. H0)
29+
)
30+
verfahren: Optional[Profilverfahren] = None #: Verfahren des Profils (analytisch oder synthetisch)
31+
ist_einspeisung: Optional[bool] = None #: Einspeiseprofil: True/False
32+
tagesparameter: Optional[Tagesparameter] = None #: Klimazone / Temperaturmessstelle
33+
profilart: Optional[Profilart] = None #: Profilart des Lastprofils, e.g. ART_STANDARDLASTPROFIL
34+
herausgeber: Optional[str] = None #: Herausgeber des Lastprofil-Codes, e.g. BDEW

src/bo4e/com/tagesparameter.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Contains tagesparameter class
3+
"""
4+
5+
from typing import Optional
6+
7+
from bo4e.com.com import COM
8+
9+
10+
class Tagesparameter(COM):
11+
"""
12+
Speichert Informationen zu einer tagesparameter abhängigen Messstelle. z.B. den Namen einer Klimazone oder die ID
13+
der Wetterstation für die Temperaturmessstelle
14+
"""
15+
16+
klimazone: Optional[str] = None #: Qualifier der Klimazone, e.g. 7624q
17+
temperaturmessstelle: Optional[str] = None #: Qualifier der Temperaturmessstelle, e.g. 1234x
18+
dienstanbieter: Optional[str] = None #: Dienstanbieter (bei Temperaturmessstellen), e.g. ZT1
19+
herausgeber: Optional[str] = None #: Herausgeber des Lastprofil-Codes, e.g. BDEW

src/bo4e/enum/abwicklungsmodell.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# pylint: disable=missing-module-docstring
2+
from bo4e.enum.strenum import StrEnum
3+
4+
5+
class Abwicklungsmodell(StrEnum):
6+
"""
7+
Art des Abwicklungsmodell (E-Mob)
8+
"""
9+
10+
MODELL_1 = "MODELL_1" #: Modell 1 "Bilanzierung an der Marktlokation"
11+
MODELL_2 = "MODELL_2" #: Modell 2 "Bilanzierung im Bilanzierungsgebiet (BG) des LPB
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
Contains class Aggregationsverantwortungs
3+
"""
4+
5+
from bo4e.enum.strenum import StrEnum
6+
7+
8+
class Aggregationsverantwortung(StrEnum):
9+
"""
10+
Mögliche Qualifier für die Aggregationsverantwortung
11+
"""
12+
13+
UENB = "UENB" #: Übertragungsnetzbetreiber
14+
VNB = "VNB" #: Verteilnetzbetreiber
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Contains Enums for Fallgruppenzuordnung
3+
"""
4+
5+
from bo4e.enum.strenum import StrEnum
6+
7+
8+
class Fallgruppenzuordnung(StrEnum):
9+
"""
10+
Fallgruppenzuordnung nach edi@energy
11+
"""
12+
13+
GABI_RLM_MIT_TAGESBAND = "GABI_RLM_MIT_TAGESBAND"
14+
"""RLM mit Tagesband"""
15+
GABI_RLM_OHNE_TAGESBAND = "GABI_RLM_OHNE_TAGESBAND"
16+
"""RLM ohne Tagesband"""
17+
GABI_RLM_IM_NOMINIERUNGSERSATZVERFAHREN = "GABI_RLM_IM_NOMINIERUNGSERSATZVERFAHREN"
18+
"""RLM im Nominierungsersatzverfahren"""

src/bo4e/enum/profilart.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Contains Enums for Profilart.
3+
"""
4+
5+
from bo4e.enum.strenum import StrEnum
6+
7+
8+
class Profilart(StrEnum):
9+
"""
10+
Profilart: temperaturabh./Standardlastprofil.
11+
"""
12+
13+
ART_STANDARDLASTPROFIL = "ART_STANDARDLASTPROFIL" #: ART_STANDARDLASTPROFIL, Z02
14+
ART_TAGESPARAMETERABHAENGIGES_LASTPROFIL = "ART_TAGESPARAMETERABHAENGIGES_LASTPROFIL"
15+
"""ART_TAGESPARAMETERABHAENGIGES_LASTPROFIL, Z03"""
16+
ART_LASTPROFIL = "ART_LASTPROFIL" #: ART_LASTPROFIL, Z12
17+
ART_STANDARDEINSPEISEPROFIL = "ART_STANDARDEINSPEISEPROFIL" #: ART_STANDARDEINSPEISEPROFIL, Z04
18+
ART_TAGESPARAMETERABHAENGIGES_EINSPEISEPROFIL = "ART_TAGESPARAMETERABHAENGIGES_EINSPEISEPROFIL"
19+
#: ART_TAGESPARAMETERABHAENGIGES_EINSPEISEPROFIL, Z05

src/bo4e/enum/profiltyp.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
Contains Enums for Profiltyp.
3+
"""
4+
5+
from bo4e.enum.strenum import StrEnum
6+
7+
8+
class Profiltyp(StrEnum):
9+
"""
10+
Profiltyp (temperaturabhängig / Standardlastprofil).
11+
"""
12+
13+
SLP_SEP = "SLP_SEP" #: SLP/SEP
14+
TLP_TEP = "TLP_TEP" #: TLP/TEP

0 commit comments

Comments
 (0)