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
f3ea47fb
Commit
f3ea47fb
authored
Mar 20, 2018
by
Theophile GENTILHOMME
Browse files
Test with reference arrays
parent
8f6b2c07
Pipeline
#17767
passed with stage
in 17 minutes and 21 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/measure/data/two-cols.hdf5
0 → 100644
View file @
f3ea47fb
File added
bob/measure/load.py
View file @
f3ea47fb
...
...
@@ -35,7 +35,7 @@ def split(filename):
try
:
columns
=
numpy
.
loadtxt
(
filename
)
neg_pos
=
columns
[:,
0
]
scores
=
columns
[:,
0
]
scores
=
columns
[:,
1
]
except
:
LOGGER
.
error
(
'''Cannot read {}. This file must be a two columns file with
the first column containing -1 or 1 (i.e. negative or
...
...
bob/measure/test_load.py
View file @
f3ea47fb
...
...
@@ -10,6 +10,9 @@
from
nose.tools
import
assert_equal
import
bob.measure.load
import
bob.io.base.test_utils
import
bob.io.base
import
numpy
def
test_split
():
...
...
@@ -22,3 +25,12 @@ def test_split():
assert
neg
is
not
None
assert_equal
(
len
(
neg
),
521
)
assert_equal
(
len
(
pos
),
479
)
test_ref_file_path
=
bob
.
io
.
base
.
test_utils
.
datafile
(
'two-cols.hdf5'
,
'bob.measure'
)
test_ref
=
bob
.
io
.
base
.
HDF5File
(
test_ref_file_path
)
neg_ref
=
test_ref
.
read
(
'negatives'
)
pos_ref
=
test_ref
.
read
(
'positives'
)
del
test_ref
assert
numpy
.
array_equal
(
numpy
.
nan_to_num
(
neg_ref
),
numpy
.
nan_to_num
(
neg
))
assert
numpy
.
array_equal
(
numpy
.
nan_to_num
(
pos_ref
),
numpy
.
nan_to_num
(
pos
))
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