changeset 720:2fad8cfdb2d8

number of dims and number of vectors were backward stylistic standard.
author map01bf
date Fri, 25 Jun 2010 19:49:30 +0000
parents e3f1cf653c30
children 70542745f473
files bindings/python/pyadb.py bindings/python/pyadbmodule.c
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/bindings/python/pyadb.py	Fri Jun 25 09:08:56 2010 +0000
+++ b/bindings/python/pyadb.py	Fri Jun 25 19:49:30 2010 +0000
@@ -84,7 +84,7 @@
 				return
 		elif (featData != None):
 			if (len(args["features"].shape) == 1) : args["features"] = args["features"].reshape((args["features"].shape[0],1))
-			args["nDim"], args["nVect"] = args["features"].shape
+			args["nVect"], args["nDim"] = args["features"].shape
 			args["features"] = args["features"].flatten()
 			print "args: " + str(args)
 			ok = _pyadb._pyadb_insertFromArray(**args)
--- a/bindings/python/pyadbmodule.c	Fri Jun 25 09:08:56 2010 +0000
+++ b/bindings/python/pyadbmodule.c	Fri Jun 25 19:49:30 2010 +0000
@@ -127,7 +127,7 @@
 }
 
 /* insert feature data from a numpy array */
-/* array given should have ndarray.shape = (numDims, numVectors)*/
+/* array given should have ndarray.shape = (numVectors, numDims)*/
 /* array datatype needs to be doubles (float may work...)*/
 /* if power is given, must be 1d array of length numVectors*/
 /* if times is given, must be 1d array of length 2*numVectors like this:*/
@@ -520,7 +520,8 @@
 			Py_DECREF(newBits);
 		}
 		if(PyList_Reverse(outgoing)){//need to do this as things come off the accumulator backward.
-			printf("the reverse failed, hopefully a sensable error will follow.\nIf not, fix it.\n");
+			PyErr_SetString(PyExc_RuntimeError,
+			"the reverse failed, hopefully a sensable error will follow.\nIf not, fix it.\n");
 			return NULL;
 			}
 	}else{