Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
RadioObservatory
LOFAR
Commits
3850771b
Commit
3850771b
authored
4 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-190
: bug fix: compare .value of Enum's and add seconds, not timedeltas
parent
a7cca3e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!252
Resolve TMSS-190
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/src/tmss/tmssapp/models/scheduling.py
+3
-3
3 additions, 3 deletions
SAS/TMSS/src/tmss/tmssapp/models/scheduling.py
with
3 additions
and
3 deletions
SAS/TMSS/src/tmss/tmssapp/models/scheduling.py
+
3
−
3
View file @
3850771b
...
...
@@ -162,13 +162,13 @@ class Subtask(BasicCommon):
@property
def
specified_duration
(
self
)
->
timedelta
:
'''
get the specified (or estimated) duration of this subtask based on the specified task duration and the subtask type
'''
if
self
.
specifications_template
.
type
.
value
==
SubtaskType
.
Choices
.
OBSERVATION
:
if
self
.
specifications_template
.
type
.
value
==
SubtaskType
.
Choices
.
OBSERVATION
.
value
:
# observations have a specified duration, so grab it from the spec.
return
timedelta
(
seconds
=
self
.
task_blueprint
.
specifications_doc
.
get
(
'
duration
'
,
0
))
if
self
.
specifications_template
.
type
.
value
==
SubtaskType
.
Choices
.
PIPELINE
:
if
self
.
specifications_template
.
type
.
value
==
SubtaskType
.
Choices
.
PIPELINE
.
value
:
# pipelines usually do not have a specified duration, so make a guess (half the obs duration?).
return
timedelta
(
seconds
=
self
.
task_blueprint
.
specifications_doc
.
get
(
'
duration
'
,
max
(
p
.
specified_duration
for
p
in
self
.
predecessors
)
/
2
))
return
timedelta
(
seconds
=
self
.
task_blueprint
.
specifications_doc
.
get
(
'
duration
'
,
max
(
p
.
specified_duration
.
total_seconds
()
for
p
in
self
.
predecessors
)
/
2
))
# other subtasktypes usually depend on cpu/data/network etc. So, make a guess (for now)
return
timedelta
(
minutes
=
5
)
...
...
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