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

[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:
if groups is None and purposes is not None:
lowlevel_purposes = []
if 'real' in purposes:
if 'attack' in purposes:
samples = self.db.objects(groups=groups, purposes=lowlevel_purposes, **kwargs)
samples = [BRSUPadFile(s) for s in samples]
return samples
Supports Markdown
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