Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.measure
Commits
352f5a2b
Commit
352f5a2b
authored
Sep 17, 2015
by
Manuel Günther
Browse files
Improved py27 and py3 compatibility
parent
dc772a2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/measure/openbr.py
View file @
352f5a2b
...
...
@@ -152,13 +152,14 @@ def write_matrix(
scores
[
probe
].
append
((
score
,
0xff
if
client
==
id
else
0x7f
))
# go ahead and sort the scores per probe
scores
=
{
k
:
sorted
(
v
,
key
=
lambda
x
:
x
[
0
],
reverse
=
True
)
for
k
,
v
in
scores
.
iteritems
()}
sorted_scores
=
{}
for
k
,
v
in
scores
.
items
():
sorted_scores
[
k
]
=
sorted
(
v
,
key
=
lambda
x
:
x
[
0
],
reverse
=
True
)
# now, write matrix
for
p
,
probe
in
enumerate
(
probe_names
):
if
probe
in
scores
:
for
m
in
range
(
min
(
search
,
len
(
scores
[
probe
]))):
matrix
[
p
,
m
],
mask
[
p
,
m
]
=
scores
[
probe
][
m
]
for
m
in
range
(
min
(
search
,
len
(
sorted_
scores
[
probe
]))):
matrix
[
p
,
m
],
mask
[
p
,
m
]
=
sorted_
scores
[
probe
][
m
]
# OK, now finally write the file in the desired format
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment