# HG changeset patch # User map01bf # Date 1277495370 0 # Node ID 2fad8cfdb2d8b0ed361799fa0683a89e51da562e # Parent e3f1cf653c3021fae8eb9088df3a043d40a3edd3 number of dims and number of vectors were backward stylistic standard. diff -r e3f1cf653c30 -r 2fad8cfdb2d8 bindings/python/pyadb.py --- 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) diff -r e3f1cf653c30 -r 2fad8cfdb2d8 bindings/python/pyadbmodule.c --- 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{