Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
a7c5a4e2
Commit
a7c5a4e2
authored
Jun 02, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'measure-analysis' into packet-exchange
parents
90f57eb8
d4513bf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
measure-analysis/measure-analysis.py
measure-analysis/measure-analysis.py
+9
-6
No files found.
measure-analysis/measure-analysis.py
View file @
a7c5a4e2
...
...
@@ -372,7 +372,7 @@ class MeasureSet:
return
data
def
import_from_json
(
self
,
path
,
flat
=
False
,
cyclictest
=
False
):
def
import_from_json
(
self
,
path
,
flat
=
False
,
cyclictest
=
False
,
user_input
=
False
):
with
open
(
path
)
as
infile
:
...
...
@@ -381,8 +381,9 @@ class MeasureSet:
else
:
data
=
json
.
load
(
infile
)
self
.
metadata
.
update
(
data
[
'metadata'
])
data
[
'metadata'
]
=
self
.
input_metadata
()
if
user_input
:
self
.
metadata
.
update
(
data
[
'metadata'
])
data
[
'metadata'
]
=
self
.
input_metadata
()
measure_type
=
data
[
'measure_type'
]
units
=
data
[
'units'
]
...
...
@@ -437,8 +438,10 @@ class MeasureSet:
if
headers
:
# Table headers
headers
=
[
"Min"
,
"Max"
,
"Avg"
,
"Var"
]
# Add a metadata information column if the metadata_mask isn't empty
if
metadata_mask
!=
[]:
table
+=
[[
"Metadata"
]
+
headers
]
table
+=
[[
"**"
+
", "
.
join
(
metadata_mask
)
+
"**"
]
+
[
"**"
+
" - "
.
join
(
self
.
props_names
)
+
"**"
]
*
len
(
headers
)]
...
...
@@ -451,7 +454,7 @@ class MeasureSet:
values
=
[[
(
format
(
m
[
i
][
j
],
'.4f'
)
+
self
.
units
[
j
])
for
j
in
range
(
len
(
m
[
0
]))]
for
i
in
range
(
len
(
m
))]
if
metadata_mask
!=
{}
:
if
metadata_mask
!=
[]
:
metadata_info
=
[
"{}"
.
format
(
self
.
metadata
[
metadata_name
])
for
metadata_name
in
metadata_mask
]
table
+=
[[
", "
.
join
(
metadata_info
)]
+
[
" - "
.
join
(
values
[
i
])
for
i
in
range
(
len
(
values
))]]
else
:
...
...
@@ -506,9 +509,9 @@ def parse_args():
measure_set
=
MeasureSet
()
if
args
.
c
:
measure_set
.
import_from_json
(
args
.
i
[
0
],
cyclictest
=
True
)
measure_set
.
import_from_json
(
args
.
i
[
0
],
cyclictest
=
True
,
userInput
=
True
)
else
:
measure_set
.
import_from_json
(
args
.
i
[
0
],
flat
=
True
)
measure_set
.
import_from_json
(
args
.
i
[
0
],
flat
=
True
,
userInput
=
True
)
ms_handler
.
add_measure_set
(
measure_set
)
...
...
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