8000 Define StructSequence types for SDS info/metadata. · rtosholdings/riptide_cpp@9f37043 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9f37043

Browse files
committed
Define StructSequence types for SDS info/metadata.
Fixes #13. Define some StructSequence types for SDS info/metadata and modify SDS Python functions to create instances of these types instead of plain tuples.
1 parent 878b6a0 commit 9f37043

File tree

3 files changed

+389
-64
lines changed

3 files changed

+389
-64
lines changed

src/RipTide.cpp

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,10 @@ static PyObject* SetThreadWakeUp(PyObject* self, PyObject* args) {
15071507
return PyLong_FromLongLong((long long)newWakeup);
15081508
}
15091509

1510+
1511+
PyObject* RecordArrayToColMajor(PyObject* self, PyObject* args);
1512+
1513+
15101514
//--------------------------------------------------------
15111515
const char* docstring_asarray =
15121516
"Parameters\n"
@@ -1560,8 +1564,6 @@ const char* docstring_asfastarray =
15601564
"asarray : Similar function.\n";
15611565

15621566

1563-
PyObject* RecordArrayToColMajor(PyObject* self, PyObject* args);
1564-
15651567
/* ==== Set up the methods table ====================== */
15661568
//struct PyMethodDef {
15671569
// const char *ml_name; /* The name of the built-in function/method */
@@ -1713,7 +1715,7 @@ static PyModuleDef CSigMathUtilModule = {
17131715
NULL // freefunc
17141716
};
17151717

1716-
// For version 3, PyInut_Name must be used as this function is called when the module is imported
1718+
// For Python version 3, PyInit_{module_name} must be used as this function is called when the module is imported
17171719
PyMODINIT_FUNC PyInit_riptide_cpp() {
17181720

17191721
INT32 count = 0;
@@ -1765,7 +1767,7 @@ count++;
17651767
}
17661768

17671769

1768-
// Build LUTs used in comarisons after mask generated
1770+
// Build LUTs used in comparisons after mask generated
17691771
for (int i = 0; i < 256; i++) {
17701772
BYTE* pDest = (BYTE*)&gBooleanLUT64[i];
17711773
for (int j = 0; j < 8; j++) {
@@ -1918,11 +1920,24 @@ count++;
19181920
pRow->dtype1 = NPY_ULONGLONG;
19191921
pRow->dtype2 = NPY_LONGLONG;
19201922

1923+
// Register types defined by this module.
1924+
PyObject* mod_dict = PyModule_GetDict(m);
1925+
if (!mod_dict)
1926+
{
1927+
LOGGING("Unable to get the module dictionary for the riptide_cpp module.\n")
1928+
return NULL;
1929+
}
1930+
1931+
if (!RegisterSdsPythonTypes(mod_dict))
1932+
{
1933+
LOGGING("An error occurred when creating/registering SDS Python types.");
1934+
return NULL;
1935+
}
19211936

19221937
// start up the worker threads now in case we use them
19231938
g_cMathWorker->StartWorkerThreads(0);
19241939

1925-
LOGGING("Fastmath loaded\n");
1940+
LOGGING("riptide_cpp loaded\n");
19261941
return m;
19271942
}
19281943

0 commit comments

Comments
 (0)
0