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
14cc4364
Commit
14cc4364
authored
3 years ago
by
Mario Raciti
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-610
: Add observation_hours_per_category info
parent
3b119ec1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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/adapters/reports.py
+27
-1
27 additions, 1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
with
27 additions
and
1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
+
27
−
1
View file @
14cc4364
...
@@ -65,8 +65,34 @@ def _get_completion_level(cycle: models.Cycle):
...
@@ -65,8 +65,34 @@ def _get_completion_level(cycle: models.Cycle):
def
_get_observation_hours_per_category
(
cycle
:
models
.
Cycle
):
def
_get_observation_hours_per_category
(
cycle
:
models
.
Cycle
):
# TODO: Better define system unavailability and idle values.
result
=
{}
result
[
'
total_duration_A
'
],
result
[
'
total_duration_B
'
],
result
[
'
total_duration_failed
'
],
result
[
'
total_duration_idle
'
]
\
=
timedelta
(),
timedelta
(),
timedelta
(),
timedelta
()
# Get SUBs within prio A
subs_A
=
models
.
SchedulingUnitBlueprint
.
objects
.
filter
(
draft__scheduling_set__project__cycles
=
cycle
.
pk
).
filter
(
priority_queue
=
'
A
'
)
for
sub
in
subs_A
:
if
sub
.
status
==
'
finished
'
:
result
[
'
total_duration_A
'
]
+=
sub
.
duration
if
sub
.
status
==
'
cancelled
'
:
result
[
'
total_duration_failed
'
]
+=
sub
.
duration
result
[
'
total_duration_idle
'
]
+=
sub
.
duration
# TODO: Need to subtract other states.
# Get SUBs within prio B
subs_B
=
models
.
SchedulingUnitBlueprint
.
objects
.
filter
(
draft__scheduling_set__project__cycles
=
cycle
.
pk
).
filter
(
priority_queue
=
'
B
'
)
for
sub
in
subs_B
:
if
sub
.
status
==
'
finished
'
:
result
[
'
total_duration_B
'
]
+=
sub
.
duration
if
sub
.
status
==
'
cancelled
'
:
result
[
'
total_duration_failed
'
]
+=
sub
.
duration
result
[
'
total_duration_idle
'
]
+=
sub
.
duration
# TODO: Need to subtract other states.
result
[
'
total_duration_A
'
]
=
result
[
'
total_duration_A
'
].
total_seconds
()
result
[
'
total_duration_B
'
]
=
result
[
'
total_duration_B
'
].
total_seconds
()
result
[
'
total_duration_failed
'
]
=
result
[
'
total_duration_failed
'
].
total_seconds
()
result
[
'
total_duration_idle
'
]
=
result
[
'
total_duration_idle
'
].
total_seconds
()
return
0
return
result
def
_get_weekly_efficiency
(
cycle
:
models
.
Cycle
):
def
_get_weekly_efficiency
(
cycle
:
models
.
Cycle
):
...
...
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