a little more work

This commit is contained in:
Daniel Knüttel 2019-07-12 11:07:24 +02:00
parent aacd1473aa
commit 9220314b68

View File

@ -148,10 +148,23 @@ interaction_UFuncWrapper_init
, PyObject * args , PyObject * args
, PyObject * kwds) , PyObject * kwds)
{ {
// 0: ufunc_force
// 1: interaction2D
char type; char type;
PyObject * coefficients; 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} {NULL, NULL, 0, NULL}
}; };
// FIXME
PyUFuncGenericFunction interaction_funcs[] = PyUFuncGenericFunction interaction_funcs[] =
{ &interaction_ufunc_float2D}; { &interaction_ufunc_float2D};
PyUFuncGenericFunction force_funcs[] = PyUFuncGenericFunction force_funcs[] =
@ -206,7 +220,7 @@ PyInit_interaction(void)
return NULL; return NULL;
} }
import_array(); import_array();
import_umath(); import_ufunc();
ufunc_interaction = PyUFunc_FromFuncAndDataAndSignature( ufunc_interaction = PyUFunc_FromFuncAndDataAndSignature(
interaction_funcs interaction_funcs