Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AKPlanning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Blanke
AKPlanning
Commits
dafa0810
Commit
dafa0810
authored
2 months ago
by
Felix Blanke
Browse files
Options
Downloads
Patches
Plain Diff
Change rounding strategy to ceil
parent
aee5627c
No related branches found
No related tags found
1 merge request
!6
Rounding strategy for slot duration at JSON export
Pipeline
#269103
failed
2 months ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
AKModel/models.py
+4
-1
4 additions, 1 deletion
AKModel/models.py
with
4 additions
and
1 deletion
AKModel/models.py
+
4
−
1
View file @
dafa0810
import
itertools
import
itertools
import
json
import
json
import
math
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
from
typing
import
Iterable
,
Generator
from
typing
import
Iterable
,
Generator
...
@@ -934,10 +935,12 @@ class AKSlot(models.Model):
...
@@ -934,10 +935,12 @@ class AKSlot(models.Model):
return
[]
return
[]
return
[
f
"
availability-person-
{
owner
.
pk
}
"
]
return
[
f
"
availability-person-
{
owner
.
pk
}
"
]
ceil_offet_eps
=
1e-4
# self.slots_in_an_hour is set in AKJSONExportView
# self.slots_in_an_hour is set in AKJSONExportView
data
=
{
data
=
{
"
id
"
:
str
(
self
.
pk
),
"
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
"
:
{},
"
properties
"
:
{},
"
room_constraints
"
:
[
constraint
.
name
"
room_constraints
"
:
[
constraint
.
name
for
constraint
in
self
.
ak
.
requirements
.
all
()],
for
constraint
in
self
.
ak
.
requirements
.
all
()],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment