Commit c0983e3f authored by Yannick DAYER's avatar Yannick DAYER
Browse files

Adapt to all_samples method of bob.bio.base db

parent 32394265
Pipeline #46052 passed with stage
in 34 minutes and 10 seconds
......@@ -154,28 +154,8 @@ def display_face_annotations(
"""
Plots annotations on the corresponding face picture.
"""
logger.debug("Retrieving background model samples from database.")
background_model_samples = database.background_model_samples()
logger.debug("Retrieving references and probes samples from database.")
references_samplesets = []
probes_samplesets = []
for group in groups:
references_samplesets.extend(database.references(group=group))
probes_samplesets.extend(database.probes(group=group))
# Unravels all samples in one list (no SampleSets)
samples = background_model_samples
samples.extend([
sample
for r in references_samplesets
for sample in r.samples
])
samples.extend([
sample
for p in probes_samplesets
for sample in p.samples
])
logger.debug("Retrieving samples from database.")
samples = database.all_samples(groups)
logger.debug(f"{len(samples)} samples loaded from database.")
......
......@@ -18,7 +18,7 @@ def test_display_annotations():
display_face_annotations,
args=(
'--database', 'dummy',
'--groups', 'dev',
'--groups', 'world', '--groups', 'dev',
'--annotations-dir', annotations_dir,
'--output-dir', tmp_dir, '--keep-all',
'--self-test',
......@@ -28,7 +28,7 @@ def test_display_annotations():
'Command exited with this output: `{}\' \n'
'If the output is empty, you can run this script locally to see '
'what is wrong:\n'
'$ bob bio display_face_annotations -vvv -d dummy -g dev -a ./annotations/ -o /tmp/temp_annotated'
'$ bob bio display_face_annotations -vvv -d dummy -g world -g dev -a ./annotations/ -o /tmp/temp_annotated'
''.format(result.output))
assert result.exit_code == 0, assertion_error_message
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment