diff --git a/bob/bio/base/database/filelist/query.py b/bob/bio/base/database/filelist/query.py index 2d6eaf1399d63608f3ea6f49564ee7bf507f23f1..c3454093192d7c54f6eb0f40145b30da76421607 100644 --- a/bob/bio/base/database/filelist/query.py +++ b/bob/bio/base/database/filelist/query.py @@ -10,6 +10,9 @@ from .. import BioFile from .models import ListReader +import logging +logger = logging.getLogger('bob.bio.base') + class FileListBioDatabase(ZTBioDatabase): """This class provides a user-friendly interface to databases that are given as file lists. @@ -226,10 +229,12 @@ class FileListBioDatabase(ZTBioDatabase): if group == 'world': continue if add_zt_files: - if not self.implements_zt(self.protocol, group): - raise ValueError("ZT score files are requested, but no such files are defined in group %s for protocol %s", group, self.protocol) - files += self.tobjects(group, self.protocol) - files += self.zobjects(group, self.protocol, **self.z_probe_options) + if self.implements_zt(self.protocol, group): + files += self.tobjects(group, self.protocol) + files += self.zobjects(group, self.protocol, **self.z_probe_options) + else: + logger.warn("ZT score files are requested, but no such files are defined in group %s for protocol %s", group, self.protocol) + return self.sort(self._make_bio(files)) diff --git a/bob/bio/base/test/test_filelist.py b/bob/bio/base/test/test_filelist.py index 405591a866ba3e7bc2c630a27b533d2e5a39dbb6..c1c0735b475755e8476b783379ffb568a274640b 100644 --- a/bob/bio/base/test/test_filelist.py +++ b/bob/bio/base/test/test_filelist.py @@ -136,6 +136,12 @@ def test_query_protocol(): assert len(db.objects(protocol=prot, groups='dev', purposes='probe')) == 9 +def test_noztnorm(): + db = FileListBioDatabase(os.path.join(os.path.dirname(example_dir), + 'example_filelist2'), 'test') + assert len(db.all_files()) + + def test_query_dense(): db = FileListBioDatabase(example_dir, 'test', use_dense_probe_file_list=True)