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
d1b53fe5
Commit
d1b53fe5
authored
6 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
Story
SW-300
: cleaning up code to adhere to pep standards
parent
51033e6b
No related branches found
No related tags found
2 merge requests
!89
Monitoring maintenance Epic branch merge
,
!1
Resolve OSB-13 "Monitoringmaintenance "
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCU/Maintenance/MDB_tools/cli/probe_mdb.py
+12
-12
12 additions, 12 deletions
LCU/Maintenance/MDB_tools/cli/probe_mdb.py
with
12 additions
and
12 deletions
LCU/Maintenance/MDB_tools/cli/probe_mdb.py
+
12
−
12
View file @
d1b53fe5
...
...
@@ -105,9 +105,9 @@ def get_query_string_for_time_limit(from_date, to_date):
else
:
date
=
to_date
query
+=
'
&start_time__year__lte=%d
'
%
(
date
.
year
)
query
+=
'
&start_time__month__lte=%d
'
%
(
date
.
month
)
query
+=
'
&start_time__day__lte=%d
'
%
(
date
.
day
)
query
+=
'
&start_time__year__lte=%d
'
%
(
date
.
year
,
)
query
+=
'
&start_time__month__lte=%d
'
%
(
date
.
month
,
)
query
+=
'
&start_time__day__lte=%d
'
%
(
date
.
day
,
)
except
ValueError
:
logger
.
error
(
'
format of to date not valid; YYYY-MM-DD es. 2016-15-12
'
)
...
...
@@ -190,17 +190,18 @@ def reformat_values(item):
return
str
(
item
)
def
print_out_station_test_summary
(
station_test
,
id
):
def
print_out_station_test_summary
(
station_test
,
id
x
):
"""
Prints the summary of the station test
:param station_test: dict containing the results of the station test
:param idx: index of the current station test
:return:
"""
summary_fields
=
[
'
station_name
'
,
'
station_type
'
,
'
start_time
'
,
'
end_time
'
,
'
performed_checks
'
]
summary_header
=
[
'
Name
'
,
'
Type
'
,
'
Start
'
,
'
End
'
,
'
Checks
'
]
values
=
[
reformat_values
(
station_test
[
item
])
for
item
in
summary_fields
]
print
()
print
(
'
Station test #{}
'
.
format
(
id
))
print
(
'
Station test #{}
'
.
format
(
id
x
))
table_width
=
200
terminal
=
blessings
.
Terminal
()
if
terminal
.
does_styling
:
...
...
@@ -275,8 +276,8 @@ def print_out_component_errors(station_test):
tile_errors
=
error
.
get
(
'
tile_errors
'
,
None
)
if
tile_errors
:
for
i
,
tile_error
in
enumerate
(
tile_errors
):
tile_error_string
=
'
Tile error #{} on tile id {}
'
.
format
(
i
,
tile_error
[
'
tile_id
'
])
for
k
,
tile_error
in
enumerate
(
tile_errors
):
tile_error_string
=
'
Tile error #{} on tile id {}
'
.
format
(
k
,
tile_error
[
'
tile_id
'
])
print
(
tile_error_indentation
+
tile_error_string
)
print
(
tile_error_indentation
+
'
-
'
*
len
(
tile_error_string
))
...
...
@@ -294,7 +295,7 @@ def rtsm_sort_errors(errors):
rcu
time
:param
component_errors:
:param
errors: RTSM errors to be sorted
:return:
"""
sorted_components
=
sorted
(
errors
,
key
=
itemgetter
(
'
rcu
'
,
'
error_type
'
,
'
time
'
))
...
...
@@ -313,11 +314,10 @@ def print_out_rtsm_summary(rtsm_results):
table_width
=
terminal
.
width
table
=
beautifultable
.
BeautifulTable
(
max_width
=
table_width
)
header
=
[
'
observation_id
'
,
'
station_name
'
,
'
start_time
'
,
'
end_time
'
,
'
component_id
'
,
'
error_type
'
,
'
start_frequency
'
,
'
stop_frequency
'
,
'
component_id
'
,
'
error_type
'
,
'
start_frequency
'
,
'
stop_frequency
'
,
'
mode
'
,
'
percentage
'
]
table
.
column_headers
=
[
'
observation_id
'
,
'
station_name
'
,
'
start_time
'
,
'
end_time
'
,
'
component_id
'
,
'
error_type
'
,
'
start_frequency
'
,
'
stop_frequency
'
,
'
mode
'
,
'
percentage
'
]
table
.
column_headers
=
header
for
rtsm_result
in
sorted
(
rtsm_results
,
key
=
itemgetter
(
'
observation_id
'
)):
obs_id
=
rtsm_result
[
'
observation_id
'
]
station_name
=
rtsm_result
[
'
station_name
'
]
...
...
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