stream.evaluate: ensure empty quivers do not get evaluated
Sometimes when running a streaming evaluate job, you may get into the situation where there is data but there are no random or target times associated with that stretch of time. Then you'll get the following:
2018-09-28 18:37:38,418 | chunk_8-evaluate : INFO : creating new buffer for [1222220269.000, 1222220270.000)
2018-09-28 18:37:38,418 | chunk_8-evaluate : INFO : ignoring segdb
2018-09-28 18:37:38,419 | chunk_8-evaluate : INFO : querying for triggers within [1222220269.000, 1222220270.000)
2018-09-28 18:37:39,431 | chunk_8-evaluate : INFO : found data at 1222220269
2018-09-28 18:37:39,431 | chunk_8-evaluate : INFO : acquired 2.000 sec of data at 1222220268
2018-09-28 18:37:39,432 | chunk_8-evaluate : INFO : identified 0 target times
2018-09-28 18:37:39,432 | chunk_8-evaluate : INFO : identified 0 random times
2018-09-28 18:37:39,432 | chunk_8-evaluate : INFO : launching evaluation job for [1222220268.000, 1222220270.000)
2018-09-28 18:37:39,432 | chunk_8-evaluate : INFO : evaulating classifiers sequentially
2018-09-28 18:37:39,432 | chunk_8-evaluate : INFO : evaluating quiver with approx_kernel_svm
2018-09-28 18:37:39,442 | chunk_8-evaluate : ERROR : Traceback (most recent call last):
File "/home/patrick.godwin/local/master/iDQ/bin/idq-streaming_evaluate", line 41, in <module>
stream.evaluate(config_path, gps_start=gps_start, gps_end=gps_end, **vars(opts))
File "/home/patrick.godwin/local/master/iDQ/lib/python2.7/site-packages/idq/stream.py", line 660, in evaluate
quiver = classifier.evaluate(quiver)
File "/home/patrick.godwin/local/master/iDQ/lib/python2.7/site-packages/idq/classifiers/sklearn.py", line 105, in evaluate
num_proc=self.kwargs.get('num_proc', features.DEFAULT_NUM_PROC),
File "/home/patrick.godwin/local/master/iDQ/lib/python2.7/site-packages/idq/features.py", line 430, in vectorize
assert len(self), 'must have at least one FeatureVector to vectorize a quiver'
AssertionError: must have at least one FeatureVector to vectorize a quiver
This checks whether there are times to be able to build a quiver, and if not, skips classifier evaluation for that stretch of time.