Skip to content

Commit

Permalink
fix: remove time_packages (UB1, UB2, UB3) from packages resul…
Browse files Browse the repository at this point in the history
…ts (#460)

* fix: remove `time_packages` (`UB1`, `UB2`, `UB3`) from packages results

* fixed tests

* Update unittests/test_cli_conditions.py

Co-authored-by: kevin <[email protected]>

---------

Co-authored-by: Konstantin <[email protected]>
Co-authored-by: kevin <[email protected]>
Co-authored-by: DeltaDaniel <[email protected]>
  • Loading branch information
4 people authored Sep 25, 2024
1 parent 04b5b0a commit 68f3295
Show file tree
Hide file tree
Showing 4 changed files with 5,758 additions and 5,931 deletions.
3 changes: 1 addition & 2 deletions src/kohlrahbi/conditions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from kohlrahbi.ahb import get_pruefi_to_file_mapping
from kohlrahbi.ahbtable.ahbcondtions import AhbConditions
from kohlrahbi.ahbtable.ahbpackagetable import AhbPackageTable
from kohlrahbi.conditions.allgemeine_festlegungen import time_conditions, time_packages
from kohlrahbi.conditions.allgemeine_festlegungen import time_conditions
from kohlrahbi.logger import logger
from kohlrahbi.read_functions import get_all_conditions_from_doc

Expand Down Expand Up @@ -57,6 +57,5 @@ def scrape_conditions(
collected_packages.include_package_dict(packages.package_dict)
collected_conditions.include_condition_dict(cond_table.conditions_dict)
collected_conditions.include_condition_dict({edifact_format: time_conditions})
collected_packages.include_package_dict({edifact_format: time_packages})
collected_conditions.dump_as_json(output_path)
collected_packages.dump_as_json(output_path)
9 changes: 4 additions & 5 deletions src/kohlrahbi/conditions/allgemeine_festlegungen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
"""
Contains conditions for times in allgemeine Festlegungen.
"""
time_packages = {
"UB1": "([931] ∧ [932] [490]) ⊻ ([931] ∧ [933] [491])",
"UB2": "([931] ∧ [934] [490]) ⊻ ([931] ∧ [935] [491])",
"UB3": "([931] ∧ [932] [492] ∧ [490]) ⊻ ([931] ∧ [933] [492] ∧ [491]) ⊻ ([931] ∧ [934] [493] ∧ [490]) ⊻ ([931] ∧ [935] [493] ∧ [491])",
}
# We decided against adding the time_packages to the regular packages.
# The time-packages are resolved by a special transformer in AHBicht:
# https://github.com/Hochfrequenz/ahbicht/blob/c51c81d2be098dd79ff52b754979892396207fe2/src/ahbicht/expressions/expression_resolver.py#L149

time_conditions = {
"490": "wenn Wert in diesem DE, an der Stelle CCYYMMDDHHMM ein Zeitpunkt aus dem angegeben Zeitraum der Tabelle Kapitel 3.5 „Übersicht gesetzliche deutsche Sommerzeit (MESZ)“ der Spalten:\n\t„Sommerzeit (MESZ) von“ Darstellung in UTC und\n\t„Sommerzeit (MESZ) bis“ Darstellung in UTC ist.",
"491": "wenn Wert in diesem DE, an der Stelle CCYYMMDDHHMM ein Zeitpunkt aus dem angegeben Zeitraum der Tabelle Kapitel 3.6 „Übersicht gesetzliche deutsche Zeit (MEZ)“ der Spalten: \n\t„Winterzeit (MEZ) von“ Darstellung in UTC und\n\t„Winterzeit (MEZ) bis“ Darstellung in UTC ist.",
Expand Down
Loading

0 comments on commit 68f3295

Please sign in to comment.