added total to lequa protocols for bag iteration
This commit is contained in:
parent
5374ef3cae
commit
1907c040ad
|
|
@ -99,6 +99,9 @@ class SamplesFromDir(AbstractProtocol):
|
|||
sample, _ = self.load_fn(os.path.join(self.path_dir, f'{id}.txt'))
|
||||
yield sample, prevalence
|
||||
|
||||
def total(self):
|
||||
return len(self.true_prevs)
|
||||
|
||||
|
||||
class LabelledCollectionsFromDir(AbstractProtocol):
|
||||
|
||||
|
|
@ -113,6 +116,10 @@ class LabelledCollectionsFromDir(AbstractProtocol):
|
|||
lc = LabelledCollection.load(path=collection_path, loader_func=self.load_fn)
|
||||
yield lc
|
||||
|
||||
def total(self):
|
||||
return len(self.true_prevs)
|
||||
|
||||
|
||||
|
||||
class ResultSubmission:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue