changeset 721:70542745f473

db creation can now use non-default values for datasize, ntracks and datadim
author map01bf
date Fri, 02 Jul 2010 11:23:26 +0000
parents 2fad8cfdb2d8
children 56e97aa9d0ae
files bindings/python/pyadb.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bindings/python/pyadb.py	Fri Jun 25 19:49:30 2010 +0000
+++ b/bindings/python/pyadb.py	Fri Jul 02 11:23:26 2010 +0000
@@ -32,7 +32,10 @@
 		"falsePositives":bool, "accumulation":str, "distance":str, "npoints":int,
 		"ntracks":int, "includeKeys":list, "excludeKeys":list, "radius":float, "absThres":float,
 		"relThres":float, "durRatio":float, "hopSize":int, "resFmt":str}
-	def __init__(self, path, mode='w'):
+	def __init__(self, path, mode='w', datasize=0, ntracks=0, datadim=0):
+		"""
+		initialize the database.  By default db will hold 20000 tracks, be 2GB in size and determine datadim from the first inserted feature
+		"""
 		self.path = path
 		self.configQuery = {}
 		if not (mode=='w' or mode =='r'):
@@ -40,7 +43,7 @@
 		if os.path.exists(path):
 			self._db = _pyadb._pyadb_open(path, mode)
 		else:
-			self._db = _pyadb._pyadb_create(path,0,0,0)
+			self._db = _pyadb._pyadb_create(path,datasize,ntracks,datadim)
 		self._updateDBAttributes()
 		return