This repository has been archived on 2025-04-15. You can view files and clone it, but cannot push or open issues or pull requests.
2023-05-31 13:47:24 +02:00

27 lines
782 B
C

#include "arr_desc.h"
// Numpy data type holding a cluster
PyArray_Descr* cluster_dt(){
import_array();
PyObject *dict;
PyArray_Descr *dtype = NULL;
dict = Py_BuildValue("[(s, s),(s, s),(s, s, (i))]", "x", "u2", "y",
"u2", "data", "i4", 9);
PyArray_DescrConverter(dict, &dtype);
Py_DECREF(dict);
return dtype;
}
// Numpy data type holding the result of a cluster analysis
PyArray_Descr *cluster_analysis_dt() {
import_array(); //TODO! Correct placement for this?
PyObject *dict;
PyArray_Descr *dtype;
dict = Py_BuildValue("[(s, s),(s, s),(s, s)]", "tot3", "i4", "tot2",
"i4", "corner", "u4");
PyArray_DescrConverter(dict, &dtype);
Py_DECREF(dict);
return dtype;
}