Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
bob
bob.bio.base
Commits
282da01c
There was a problem fetching the pipeline summary.
Commit
282da01c
authored
7 years ago
by
Tiago de Freitas Pereira
Browse files
Options
Downloads
Patches
Plain Diff
Removed global variable results
parent
21e7371f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!113
Removed global variable results
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/base/script/collect_results.py
+16
-11
16 additions, 11 deletions
bob/bio/base/script/collect_results.py
with
16 additions
and
11 deletions
bob/bio/base/script/collect_results.py
+
16
−
11
View file @
282da01c
...
...
@@ -184,28 +184,32 @@ def add_results(args, nonorm, ztnorm = None):
else
:
r
.
ztnorm
(
dev_file
)
global
results
results
.
append
(
r
)
return
r
def
recurse
(
args
,
path
):
"""
Recurse the directory structure and collect all results that are stored in the desired file names.
"""
dir_list
=
os
.
listdir
(
path
)
results
=
[]
# check if the score directories are included in the current path
if
args
.
nonorm
in
dir_list
or
args
.
nonorm
==
'
.
'
:
if
args
.
ztnorm
in
dir_list
or
args
.
ztnorm
==
'
.
'
:
add_results
(
args
,
os
.
path
.
join
(
path
,
args
.
nonorm
),
os
.
path
.
join
(
path
,
args
.
ztnorm
))
return
results
+
[
add_results
(
args
,
os
.
path
.
join
(
path
,
args
.
nonorm
),
os
.
path
.
join
(
path
,
args
.
ztnorm
))
]
else
:
add_results
(
args
,
os
.
path
.
join
(
path
,
args
.
nonorm
))
return
results
+
[
add_results
(
args
,
os
.
path
.
join
(
path
,
args
.
nonorm
))
]
for
e
in
dir_list
:
real_path
=
os
.
path
.
join
(
path
,
e
)
if
os
.
path
.
isdir
(
real_path
):
recurse
(
args
,
real_path
)
r
=
recurse
(
args
,
real_path
)
if
r
is
not
None
:
results
+=
r
return
results
def
table
():
def
table
(
results
):
"""
Generates a table containing all results in a nice format.
"""
A
=
"
"
*
2
+
'
dev nonorm
'
+
"
"
*
5
+
'
dev ztnorm
'
+
"
"
*
6
+
'
eval nonorm
'
+
"
"
*
4
+
'
eval ztnorm
'
+
"
"
*
12
+
'
directory
\n
'
A
+=
"
-
"
*
100
+
"
\n
"
...
...
@@ -219,12 +223,13 @@ def main(command_line_parameters = None):
"""
Iterates through the desired directory and collects all result files.
"""
args
=
command_line_arguments
(
command_line_parameters
)
global
results
results
=
[]
# collect results
directories
=
glob
.
glob
(
args
.
directory
)
for
directory
in
directories
:
recurse
(
args
,
directory
)
r
=
recurse
(
args
,
directory
)
if
r
is
not
None
:
results
+=
r
# sort results if desired
if
args
.
sort
:
...
...
@@ -233,10 +238,10 @@ def main(command_line_parameters = None):
# print the results
if
args
.
self_test
:
table
()
table
(
results
)
elif
args
.
output
:
f
=
open
(
args
.
output
,
"
w
"
)
f
.
writelines
(
table
())
f
.
writelines
(
table
(
results
))
f
.
close
()
else
:
print
(
table
())
print
(
table
(
results
))
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