diff --git a/c/interaction/interaction.c b/c/interaction/interaction.c index c829654..9048dee 100644 --- a/c/interaction/interaction.c +++ b/c/interaction/interaction.c @@ -148,10 +148,23 @@ interaction_UFuncWrapper_init , PyObject * args , PyObject * kwds) { + // 0: ufunc_force + // 1: interaction2D char type; PyObject * coefficients; - if(!PyArgs_ParseTupleAndKeywords(args, kwds, "" // FIXME + if(!PyArgs_ParseTupleAndKeywords(args, kwds, "BO!", &type, &PyList_Type, &coefficients)) + { + return -1; + } + + if(PyList_Size(coefficients) != 19) + { + PyErr_SetString("coefficients must have length 19", PyExc_ValueError); + return -1; + } + + } @@ -167,6 +180,7 @@ static PyMethodDef InteractionMethods[] = { {NULL, NULL, 0, NULL} }; +// FIXME PyUFuncGenericFunction interaction_funcs[] = { &interaction_ufunc_float2D}; PyUFuncGenericFunction force_funcs[] = @@ -206,7 +220,7 @@ PyInit_interaction(void) return NULL; } import_array(); - import_umath(); + import_ufunc(); ufunc_interaction = PyUFunc_FromFuncAndDataAndSignature( interaction_funcs