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
bea88ec3
Commit
bea88ec3
authored
3 years ago
by
Mario Raciti
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-610
: Update observed_duration
parent
5dbcdf69
No related branches found
No related tags found
3 merge requests
!634
WIP: COBALT commissioning delta
,
!492
Resolve TMSS-610
,
!481
Draft: SW-971 SW-973 SW-975: Various fixes to build LOFAR correctly.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py
+11
-1
11 additions, 1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py
with
11 additions
and
1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py
+
11
−
1
View file @
bea88ec3
...
@@ -592,8 +592,18 @@ class SchedulingUnitBlueprint(RefreshFromDbInvalidatesCachedPropertiesMixin, Tem
...
@@ -592,8 +592,18 @@ class SchedulingUnitBlueprint(RefreshFromDbInvalidatesCachedPropertiesMixin, Tem
"""
"""
return the overall observed duration of all (observation) tasks of this scheduling unit
return the overall observed duration of all (observation) tasks of this scheduling unit
"""
"""
# TODO: Trigger an exception if a task overlaps with another. Just assume that they run subsequently for now.
if
self
.
observed_start_time
and
self
.
observed_end_time
:
if
self
.
observed_start_time
and
self
.
observed_end_time
:
observed_tasks
=
[]
for
task
in
self
.
task_blueprints
.
all
():
if
task
.
specifications_template
.
type
.
value
==
TaskType
.
Choices
.
OBSERVATION
.
value
and
\
(
task
.
status
==
"
observed
"
or
task
.
status
==
"
finished
"
):
observed_tasks
.
append
(
task
)
# TODO: For now we just assume that tasks run subsequently. Handle overlapping in future.
# Check if there are any overlapping obs task
for
i
,
t1
in
enumerate
(
observed_tasks
):
for
t2
in
observed_tasks
[
i
+
1
:]:
if
t1
.
start_time
<
t2
.
start_time
<
t1
.
stop_time
:
# Trigger an exception if any overlaps.
raise
Exception
(
'
There are at least two tasks overlapping: observed_duration is not reliable.
'
)
return
self
.
observed_end_time
-
self
.
observed_start_time
return
self
.
observed_end_time
-
self
.
observed_start_time
else
:
else
:
return
None
return
None
...
...
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