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
6dc0ca1c
Commit
6dc0ca1c
authored
Jun 01, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add generate_tables function in measure set handler
parent
f13dc492
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
measure-analysis/measure-analysis.py
measure-analysis/measure-analysis.py
+27
-1
No files found.
measure-analysis/measure-analysis.py
View file @
6dc0ca1c
...
...
@@ -54,15 +54,41 @@ class MeasureSetHandler:
if
mtype
in
self
.
measure_sets
and
len
(
self
.
measure_sets
[
mtype
][
'ids'
])
>
0
:
self
.
measure_sets
[
mtype
][
'ids'
].
remove
(
mid
)
measure_file_name
=
MeasureSetHandler
.
measures_dir
+
"/"
+
mtype
+
str
(
mid
)
measure_file_name
=
"{}/{}{}"
.
format
(
MeasureSetHandler
.
measures_dir
,
mtype
,
mid
)
os
.
remove
(
measure_file_name
)
self
.
save
()
print
(
"Removed measure {}{}"
.
format
(
mtype
,
mid
))
def
remove_all
(
self
):
for
mtype
in
self
.
measure_sets
:
for
mid
in
self
.
measure_sets
[
mtype
][
'ids'
]:
print
(
" Deleting {}{}..."
.
format
(
mtype
,
mid
))
self
.
remove_measure_set
(
mtype
,
mid
)
print
(
"Removed all measures"
.
format
(
mtype
,
mid
))
def
generate_tables
():
with
open
(
self
.
measures_dir
+
"/"
+
"measure_tables.md"
)
as
measure_table
:
measure_table
.
write
(
"# Measure Tables
\
n
\
n
"
)
for
mtype
in
self
.
measure_sets
:
need_header
=
True
measure_table
.
write
(
"## {} Tables
\
n
\
n
"
.
format
(
mtype
))
for
mid
in
self
.
measure_sets
[
mtype
][
'ids'
]:
measure
=
self
.
get_measure_set
(
"{}{}"
.
format
(
mtype
,
mid
))
if
need_header
:
measure_table
.
write
(
measure
.
generate_table
(
headers
=
True
))
need_header
=
False
else
:
measure_table
.
write
(
measure
.
generate_table
(
headers
=
False
))
measure_table
.
write
(
"
\
n
"
)
class
MeasureSet
:
...
...
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