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
d4513bf4
Commit
d4513bf4
authored
Jun 02, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix table display when no metadata information is present
parent
bdb875a0
Changes
1
Show 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 @
d4513bf4
...
@@ -372,7 +372,7 @@ class MeasureSet:
...
@@ -372,7 +372,7 @@ class MeasureSet:
return
data
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
:
with
open
(
path
)
as
infile
:
...
@@ -381,6 +381,7 @@ class MeasureSet:
...
@@ -381,6 +381,7 @@ class MeasureSet:
else
:
else
:
data
=
json
.
load
(
infile
)
data
=
json
.
load
(
infile
)
if
user_input
:
self
.
metadata
.
update
(
data
[
'metadata'
])
self
.
metadata
.
update
(
data
[
'metadata'
])
data
[
'metadata'
]
=
self
.
input_metadata
()
data
[
'metadata'
]
=
self
.
input_metadata
()
...
@@ -437,8 +438,10 @@ class MeasureSet:
...
@@ -437,8 +438,10 @@ class MeasureSet:
if
headers
:
if
headers
:
# Table headers
headers
=
[
"Min"
,
"Max"
,
"Avg"
,
"Var"
]
headers
=
[
"Min"
,
"Max"
,
"Avg"
,
"Var"
]
# Add a metadata information column if the metadata_mask isn't empty
if
metadata_mask
!=
[]:
if
metadata_mask
!=
[]:
table
+=
[[
"Metadata"
]
+
headers
]
table
+=
[[
"Metadata"
]
+
headers
]
table
+=
[[
"**"
+
", "
.
join
(
metadata_mask
)
+
"**"
]
+
[
"**"
+
" - "
.
join
(
self
.
props_names
)
+
"**"
]
*
len
(
headers
)]
table
+=
[[
"**"
+
", "
.
join
(
metadata_mask
)
+
"**"
]
+
[
"**"
+
" - "
.
join
(
self
.
props_names
)
+
"**"
]
*
len
(
headers
)]
...
@@ -451,7 +454,7 @@ class MeasureSet:
...
@@ -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
))]
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
]
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
))]]
table
+=
[[
", "
.
join
(
metadata_info
)]
+
[
" - "
.
join
(
values
[
i
])
for
i
in
range
(
len
(
values
))]]
else
:
else
:
...
@@ -506,9 +509,9 @@ def parse_args():
...
@@ -506,9 +509,9 @@ def parse_args():
measure_set
=
MeasureSet
()
measure_set
=
MeasureSet
()
if
args
.
c
:
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
:
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
)
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