minor renamings

This commit is contained in:
Jörn-Michael Miehe 2023-09-20 18:14:58 +02:00
parent eef06ed131
commit 0fcae295ec
3 changed files with 11 additions and 15 deletions

View file

@ -17,15 +17,15 @@ class Server(BaseModel):
# Tag, an dem der Kalender startet # Tag, an dem der Kalender startet
# TODO penner # TODO penner
first_day: int = 1 begin_day: int = 1
# Monat, in dem der Kalender startet # Monat, in dem der Kalender startet
# TODO penner # TODO penner
month: int = 12 begin_month: int = 12
# Alle Türen bleiben noch so viele Tage offen # Kalender so viele Tage nach der letzten Türöffnung schließen
# TODO penner # TODO penner
keep_open: int = 90 close_after: int = 90
class Puzzle(BaseModel): class Puzzle(BaseModel):
@ -35,10 +35,6 @@ class Puzzle(BaseModel):
# Lösungswort # Lösungswort
solution: str solution: str
# Länge des Kalenders
# TODO penner
days: int = 24
# Kalenderdefinition # Kalenderdefinition
calendar: str = "default.toml" calendar: str = "default.toml"

View file

@ -116,10 +116,10 @@ class EventDates:
# - assume sorted (ascending) # - assume sorted (ascending)
events: list[int], events: list[int],
# countdown to closing begins after last event # countdown to closing begins after last event
closing_after: int, close_after: int,
) -> None: ) -> None:
# account for the last event, then add closing period # account for the last event, then add closing period
self.__overall_duration = timedelta(days=events[-1] - 1 + closing_after) self.__overall_duration = timedelta(days=events[-1] - 1 + close_after)
# the events may begin last year, this year or next year # the events may begin last year, this year or next year
maybe_begin = ( maybe_begin = (

View file

@ -11,7 +11,7 @@ def test_get_before():
begin_month=12, begin_month=12,
begin_day=1, begin_day=1,
events=list(range(1, 25)), events=list(range(1, 25)),
closing_after=5, close_after=5,
) )
assert ed.first == date(2023, 12, 1) assert ed.first == date(2023, 12, 1)
@ -28,7 +28,7 @@ def test_get_after():
begin_month=12, begin_month=12,
begin_day=1, begin_day=1,
events=list(range(1, 25)), events=list(range(1, 25)),
closing_after=5, close_after=5,
) )
assert ed.first == date(2024, 12, 1) assert ed.first == date(2024, 12, 1)
@ -45,7 +45,7 @@ def test_get_during_events():
begin_month=12, begin_month=12,
begin_day=1, begin_day=1,
events=list(range(1, 25)), events=list(range(1, 25)),
closing_after=5, close_after=5,
) )
assert ed.first == date(2023, 12, 1) assert ed.first == date(2023, 12, 1)
@ -62,7 +62,7 @@ def test_get_during_closing():
begin_month=12, begin_month=12,
begin_day=1, begin_day=1,
events=list(range(1, 25)), events=list(range(1, 25)),
closing_after=5, close_after=5,
) )
assert ed.first == date(2023, 12, 1) assert ed.first == date(2023, 12, 1)
@ -79,7 +79,7 @@ def test_get_during_wrap():
begin_month=12, begin_month=12,
begin_day=1, begin_day=1,
events=list(range(1, 25)), events=list(range(1, 25)),
closing_after=8, close_after=8,
) )
assert ed.first == date(2023, 12, 1) assert ed.first == date(2023, 12, 1)