Skip to content
Snippets Groups Projects
Verified Commit f28a880c authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Add type annotations

parent 2b5537b3
No related branches found
No related tags found
No related merge requests found
Pipeline #3117 passed
...@@ -69,7 +69,7 @@ class ProjectedEntry(TypedDict): ...@@ -69,7 +69,7 @@ class ProjectedEntry(TypedDict):
end: str end: str
error: str | None error: str | None
hash: str hash: str
solution_choices: set solution_choices: set[str]
start: str start: str
...@@ -422,9 +422,9 @@ def make_conflicts(data: ScheduleData, schedule_pk: int | None, show_pk: int) -> ...@@ -422,9 +422,9 @@ def make_conflicts(data: ScheduleData, schedule_pk: int | None, show_pk: int) ->
# Generate conflicts and add schedule # Generate conflicts and add schedule
conflicts = generate_conflicts(timeslots) conflicts = generate_conflicts(timeslots)
conflicts["schedule"] = model_to_dict(new_schedule)
return conflicts # create a new dictionary by adding "schedule" to conflicts
return dict(conflicts, schedule=model_to_dict(new_schedule))
def generate_timeslots(schedule: Schedule) -> list[TimeSlot]: def generate_timeslots(schedule: Schedule) -> list[TimeSlot]:
...@@ -571,15 +571,14 @@ def generate_timeslots(schedule: Schedule) -> list[TimeSlot]: ...@@ -571,15 +571,14 @@ def generate_timeslots(schedule: Schedule) -> list[TimeSlot]:
return timeslots return timeslots
# TODO: add type annotations def generate_conflicts(timeslots: list[TimeSlot]) -> Conflicts:
def generate_conflicts(timeslots):
""" """
Tests a list of timeslot objects for colliding timeslots in the database Tests a list of timeslot objects for colliding timeslots in the database
Returns a list of conflicts containing dicts of projected timeslots, collisions and Returns a list of conflicts containing dicts of projected timeslots, collisions and
solutions solutions
""" """
conflicts = {} conflicts: Conflicts = {}
projected = [] projected = []
solutions = {} solutions = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment