From 42aa37b06080718f5eec2f4ea1ca278dc96eff77 Mon Sep 17 00:00:00 2001 From: Marcel Johannesmann Date: Mon, 29 Jan 2024 23:28:05 +0100 Subject: [PATCH 1/2] fix: one formatting issue to test branch protections --- src/bdew_datetimes/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bdew_datetimes/__init__.py b/src/bdew_datetimes/__init__.py index 9ea55aa..e1d038c 100644 --- a/src/bdew_datetimes/__init__.py +++ b/src/bdew_datetimes/__init__.py @@ -1,6 +1,7 @@ """ bdew_datetimes is a package that models the BDEW holiday, which is relevant for German utilities """ + from pytz import timezone from .calendar import create_bdew_calendar From 47ef89bdca7f4f024a9b32385e40aa9e211e0a38 Mon Sep 17 00:00:00 2001 From: Marcel Johannesmann Date: Mon, 29 Jan 2024 23:36:29 +0100 Subject: [PATCH 2/2] fix: the rest --- src/bdew_datetimes/calendar.py | 1 + src/bdew_datetimes/german_strom_and_gas_tag.py | 1 + src/bdew_datetimes/periods.py | 1 + tests/test_period.py | 12 ++++++------ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/bdew_datetimes/calendar.py b/src/bdew_datetimes/calendar.py index 89495a2..7792852 100644 --- a/src/bdew_datetimes/calendar.py +++ b/src/bdew_datetimes/calendar.py @@ -2,6 +2,7 @@ contains the business logic (namely the BDEW calendar information) """ + from datetime import date from holidays import HolidayBase, HolidaySum diff --git a/src/bdew_datetimes/german_strom_and_gas_tag.py b/src/bdew_datetimes/german_strom_and_gas_tag.py index 8f71152..ea406e0 100644 --- a/src/bdew_datetimes/german_strom_and_gas_tag.py +++ b/src/bdew_datetimes/german_strom_and_gas_tag.py @@ -2,6 +2,7 @@ A module to evaluate datetimes and whether they are "on the edge" of a German "Stromtag" or "Gastag" respectively """ + from datetime import datetime, time from enum import Enum from typing import Callable diff --git a/src/bdew_datetimes/periods.py b/src/bdew_datetimes/periods.py index 9fdab6a..cdcc351 100644 --- a/src/bdew_datetimes/periods.py +++ b/src/bdew_datetimes/periods.py @@ -3,6 +3,7 @@ ("gesetzliche Fristen") in the German energy market. It is based on the chapter "Fristenberechnung" in the GPKE. """ + import datetime from dataclasses import dataclass from datetime import date diff --git a/tests/test_period.py b/tests/test_period.py index 489a712..c8ce385 100644 --- a/tests/test_period.py +++ b/tests/test_period.py @@ -155,7 +155,7 @@ def test_get_previous_working_day(start: date, expected: date): Period( 6, DayType.WORKING_DAY, - end_date_type=EndDateType.INCLUSIVE + end_date_type=EndDateType.INCLUSIVE, # the abmeldedatum is the inclusive end of a contract ), date(2016, 7, 12), @@ -166,7 +166,7 @@ def test_get_previous_working_day(start: date, expected: date): Period( -6, DayType.WORKING_DAY, - end_date_type=EndDateType.INCLUSIVE + end_date_type=EndDateType.INCLUSIVE, # the abmeldedatum is the inclusive end of a contract ), date(2016, 7, 4), @@ -181,7 +181,7 @@ def test_get_previous_working_day(start: date, expected: date): Period( 7, DayType.WORKING_DAY, - end_date_type=EndDateType.EXCLUSIVE + end_date_type=EndDateType.EXCLUSIVE, # lieferbeginn is the exclusive end of the previous contract ), date(2016, 7, 14), @@ -192,7 +192,7 @@ def test_get_previous_working_day(start: date, expected: date): Period( -7, DayType.WORKING_DAY, - end_date_type=EndDateType.EXCLUSIVE + end_date_type=EndDateType.EXCLUSIVE, # lieferbeginn is the exclusive end of the previous contract ), date(2016, 7, 4), @@ -207,7 +207,7 @@ def test_get_previous_working_day(start: date, expected: date): Period( 10, DayType.WORKING_DAY, - end_date_type=EndDateType.EXCLUSIVE + end_date_type=EndDateType.EXCLUSIVE, # lieferbeginn is the exclusive end of the previous contract ), date(2016, 7, 19), @@ -218,7 +218,7 @@ def test_get_previous_working_day(start: date, expected: date): Period( -10, DayType.WORKING_DAY, - end_date_type=EndDateType.EXCLUSIVE + end_date_type=EndDateType.EXCLUSIVE, # lieferbeginn is the exclusive end of the previous contract ), date(2016, 7, 4),