Skip to content
Snippets Groups Projects
Commit 2b9419ce authored by Felix Blanke's avatar Felix Blanke
Browse files

type hints

parent e6b791af
No related branches found
No related tags found
6 merge requests!262[WIP] compatibility with koma solver import/export,!261[WIP] compatibility with koma solver import/export,!260[WIP] import/export merge,!259Add view to clear schedule,!237Draft: add tests on json export,!235Merge fork for interoperability of KoMa solver
...@@ -196,7 +196,7 @@ class Event(models.Model): ...@@ -196,7 +196,7 @@ class Event(models.Model):
yield current_block yield current_block
def time_slot(self, *, time_slot_index, slots_in_an_hour=1.0): def time_slot(self, *, time_slot_index: int, slots_in_an_hour: float = 1.0) -> "Availability":
from AKModel.availability.models import Availability from AKModel.availability.models import Availability
slot_duration = timedelta(hours=(1.0 / slots_in_an_hour)) slot_duration = timedelta(hours=(1.0 / slots_in_an_hour))
...@@ -206,7 +206,7 @@ class Event(models.Model): ...@@ -206,7 +206,7 @@ class Event(models.Model):
start=start, start=start,
end=start + slot_duration) end=start + slot_duration)
def schedule_from_json(self, schedule): def schedule_from_json(self, schedule: str) -> None:
schedule = json.loads(schedule) schedule = json.loads(schedule)
slots_in_an_hour = schedule["input"]["timeslots"]["info"]["duration"] slots_in_an_hour = schedule["input"]["timeslots"]["info"]["duration"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment