Commit 9ea5856e authored by Guillaume HEUSCH's avatar Guillaume HEUSCH

[databases] proper handling when either groups or purposes are not given for NRSU

parent c94f2942
......@@ -140,7 +140,8 @@ class BRSUPadDatabase(PadDatabase):
samples : :py:class:`BRSUPadFile`
A list of BRSUPadFile objects.
"""
if groups is not None:
lowlevel_purposes = None
if groups is not None and purposes is not None:
# for training
lowlevel_purposes = []
......@@ -155,6 +156,13 @@ class BRSUPadDatabase(PadDatabase):
if 'test' in groups and 'attack' in purposes:
lowlevel_purposes.append('attack')
if groups is None and purposes is not None:
lowlevel_purposes = []
if 'real' in purposes:
lowlevel_purposes.append('real')
if 'attack' in purposes:
lowlevel_purposes.append('attack')
samples = self.db.objects(groups=groups, purposes=lowlevel_purposes, **kwargs)
samples = [BRSUPadFile(s) for s in samples]
return samples
......
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