comparison trafficintelligence/storage.py @ 1178:ee3eaf902b83

minor improvement
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Sat, 26 Mar 2022 22:50:38 -0400
parents aa88acf06876
children 0e5d37b0b9ff
comparison
equal deleted inserted replaced
1177:aa88acf06876 1178:ee3eaf902b83
324 cursor.execute(queryStatement) 324 cursor.execute(queryStatement)
325 obj.features = loadTrajectoriesFromSqlite(filename, 'feature', [row[0] for i,row in enumerate(cursor) if i<nLongestFeaturesPerObject], timeStep = timeStep) 325 obj.features = loadTrajectoriesFromSqlite(filename, 'feature', [row[0] for i,row in enumerate(cursor) if i<nLongestFeaturesPerObject], timeStep = timeStep)
326 326
327 except sqlite3.OperationalError as error: 327 except sqlite3.OperationalError as error:
328 printDBError(error) 328 printDBError(error)
329 else:
330 print('Impossible to load from non-existing file '+filename)
329 return objects 331 return objects
330 332
331 def loadObjectFeatureFrameNumbers(filename, objectNumbers = None): 333 def loadObjectFeatureFrameNumbers(filename, objectNumbers = None):
332 'Loads the feature frame numbers for each object' 334 'Loads the feature frame numbers for each object'
333 with sqlite3.connect(filename) as connection: 335 with sqlite3.connect(filename) as connection: