Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tev
plugin_event
Commits
aa1be1d7
Commit
aa1be1d7
authored
Mar 12, 2017
by
LE GAC Renaud
Browse files
Update report_tools.py to deal with the new Summary, Graph fields and widgets.
parent
033092a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
modules/plugin_event/report_tools.py
modules/plugin_event/report_tools.py
+16
-11
No files found.
modules/plugin_event/report_tools.py
View file @
aa1be1d7
...
...
@@ -206,8 +206,14 @@ class Graph2(object):
# report configuration
config
=
metric2d
.
config
selector
=
metric2d
.
selector
selector
.
graph
=
json
.
loads
(
selector
.
graph
)
config_graph
=
(
selector
.
graph
if
selector
.
is_graph
else
config
.
graph
)
print
config_graph
# protection
config_graph
=
metric2d
.
config
.
graph
if
config_graph
[
u
"kind"
]
not
in
GRAPHS
:
self
.
ax
=
None
return
...
...
@@ -518,15 +524,18 @@ class Metric2D2(BaseReport):
config_x
=
config
.
summary_x
config_y
=
config
.
summary_y
is_summary_x
=
selector
.
is_summary_x
is_summary_y
=
selector
.
is_summary_y
selector_x
=
json
.
loads
(
selector
.
summary_x
)
selector_y
=
json
.
loads
(
selector
.
summary_y
)
summary_x
=
(
selector_x
if
selector_x
[
u
"compute"
]
else
config_x
)
summary_y
=
(
selector_y
if
selector_y
[
u
"compute"
]
else
config_y
)
summary_x
=
(
selector_x
if
is_summary_x
else
config_x
)
summary_y
=
(
selector_y
if
is_summary_y
else
config_y
)
# preserve the original DataFrame in order to avoid pollution
# when series of summaries is computed
if
summary_x
[
u
"compute"
]
or
summary_y
[
u
"compute"
]
:
if
len
(
summary_x
[
"functions"
])
>
0
or
len
(
summary_y
[
"functions"
])
>
0
:
self
.
df0
=
df0
=
df
.
copy
()
dfx
=
self
.
summaries
(
df0
,
summary_x
,
axis
=
"columns"
)
...
...
@@ -567,22 +576,18 @@ class Metric2D2(BaseReport):
"""
df1
=
pd
.
DataFrame
()
if
not
config
[
u
"compute"
]:
return
df1
funcs
=
config
[
u
"function(s)"
]
funcs
=
config
[
u
"functions"
]
if
funcs
in
(
""
,
'""'
,
"''"
,
'[]'
):
return
df1
funcs
=
json
.
loads
(
funcs
)
if
not
isinstance
(
funcs
,
list
):
return
df1
labels
=
config
[
u
"label
(s)
"
]
labels
=
config
[
u
"label
s
"
]
if
labels
in
(
""
,
'""'
,
"''"
,
"[]"
):
labels
=
funcs
else
:
labels
=
json
.
loads
(
config
[
u
"label(s)"
]
)
labels
=
labels
.
split
(
","
)
if
len
(
labels
)
!=
len
(
funcs
):
labels
=
funcs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment