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

Change rounding strategy to ceil

parent aee5627c
Branches
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
import itertools
import json
import math
from dataclasses import dataclass
from datetime import datetime, timedelta
from typing import Iterable, Generator
......@@ -934,10 +935,12 @@ class AKSlot(models.Model):
return []
return [f"availability-person-{owner.pk}"]
ceil_offet_eps = 1e-4
# self.slots_in_an_hour is set in AKJSONExportView
data = {
"id": str(self.pk),
"duration": round(self.duration * self.slots_in_an_hour),
"duration": math.ceil(self.duration * self.slots_in_an_hour - ceil_offet_eps),
"properties": {},
"room_constraints": [constraint.name
for constraint in self.ak.requirements.all()],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment