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
cd6dd8a7
Commit
cd6dd8a7
authored
3 years ago
by
Mario Raciti
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-610
: Add data_ingested_per_site_and_type info
parent
356840f1
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
+22
-5
22 additions, 5 deletions
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
with
22 additions
and
5 deletions
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
+
22
−
5
View file @
cd6dd8a7
...
...
@@ -18,7 +18,7 @@ def create_cycle_report(request: Request, cycle: models.Cycle) -> {}:
'
completion_level
'
:
_get_completion_level
(
cycle
),
'
observation_hours_per_category
'
:
_get_observation_hours_per_category
(
cycle
),
'
weekly_efficiency
'
:
_get_weekly_efficiency
(
cycle
),
'
data_ingested_per_site_and_
category
'
:
_get_data_ingested_per_site_and_
category
(
cycle
),
'
data_ingested_per_site_and_
type
'
:
_get_data_ingested_per_site_and_
type
(
request
,
cycle
),
'
projects_summary
'
:
_get_projects_summary
(
request
,
cycle
),
'
usage_mode
'
:
_get_usage_mode
(
cycle
),
'
failures
'
:
_get_failures
(
cycle
),
...
...
@@ -150,11 +150,24 @@ def _get_weekly_efficiency(cycle: models.Cycle):
return
0
def
_get_data_ingested_per_site_and_
category
(
cycle
:
models
.
Cycle
):
def
_get_data_ingested_per_site_and_
type
(
request
:
Request
,
cycle
:
models
.
Cycle
)
->
[]
:
"""
Help function to retrieve data ingested per site and
category
info.
Help function to retrieve data ingested per site and
type
info.
"""
return
0
result
=
[]
# Get DataProducts related to the cycle
dataproducts
=
models
.
Dataproduct
.
objects
.
filter
(
producer__subtask__task_blueprints__draft__scheduling_unit_draft__scheduling_set__project__cycles
=
cycle
.
pk
)
# TODO: Group dataproducts also per site.
# Iterate over types
datatypes
=
[
c
for
c
in
models
.
Datatype
.
Choices
]
for
dt
in
datatypes
:
dataproducts_per_type
=
dataproducts
.
filter
(
datatype
=
dt
.
value
)
dataproducts_per_type_data
=
[
serializers
.
DataproductSerializer
(
dp
,
context
=
{
'
request
'
:
request
}).
data
for
dp
in
dataproducts_per_type
]
result
.
append
({
'
type
'
:
dt
.
value
,
'
dataproducts
'
:
dataproducts_per_type_data
})
return
result
def
_get_projects_summary
(
request
:
Request
,
cycle
:
models
.
Cycle
)
->
{}:
...
...
@@ -218,7 +231,11 @@ def _get_usage_mode(cycle: models.Cycle) -> []:
def
_get_failures
(
cycle
:
models
.
Cycle
):
return
0
"""
Help function to retrieve failures rate info as a function of time.
"""
# TODO: See TMSS-662 for details.
return
None
# Project Report
...
...
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