diff --git a/DataCollection.py b/DataCollection.py index ef95130..03100cf 100644 --- a/DataCollection.py +++ b/DataCollection.py @@ -578,6 +578,9 @@ def invokeGenerator(self): def generatorFunction(self): + if self.generator.isEmpty(): + raise Exception("DataCollection.generatorFunction: generator called with insufficient samples.") + while(not self.generator.isEmpty()): data = self.generator.getBatch() @@ -592,6 +595,6 @@ def generatorFunction(self): out = (xout,yout,wout) yield out - raise Exception("DataCollection.generatorFunction: generator ran out of samples. This should not have happened, please report bug.") + diff --git a/bin/convertFromSource.py b/bin/convertFromSource.py index 3a985d2..082bc96 100755 --- a/bin/convertFromSource.py +++ b/bin/convertFromSource.py @@ -104,9 +104,9 @@ traind=None if class_name in class_options: traind = class_options[class_name] -elif not recover and not testdatafor: +elif not recover: print('available classes:') - for key, val in class_options.iteritems(): + for key, val in class_options.items(): print(key) raise Exception('wrong class selection') diff --git a/bin/mergeDataCollections.py b/bin/mergeDataCollections.py index 7b96d32..5e98bcc 100755 --- a/bin/mergeDataCollections.py +++ b/bin/mergeDataCollections.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#!/bin/env python3 from argparse import ArgumentParser from DeepJetCore.DataCollection import DataCollection