From 1595980ddcb610cd4183a125b46fc5daa1ec5980 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 15 Oct 2024 10:11:48 -0700 Subject: [PATCH 01/15] Add default arguments and configurable array type to getNumpy --- include/rogue/interfaces/stream/Frame.h | 4 +++- src/rogue/interfaces/stream/Frame.cpp | 16 +++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/rogue/interfaces/stream/Frame.h b/include/rogue/interfaces/stream/Frame.h index a1598a7d6..824968e03 100644 --- a/include/rogue/interfaces/stream/Frame.h +++ b/include/rogue/interfaces/stream/Frame.h @@ -28,6 +28,8 @@ #include "rogue/EnableSharedFromThis.h" #ifndef NO_PYTHON + #include + #include #endif @@ -354,7 +356,7 @@ class Frame : public rogue::EnableSharedFromThis - #include + #include #include namespace bp = boost::python; @@ -397,10 +396,14 @@ void ris::Frame::writePy(boost::python::object p, uint32_t offset) { } //! Read the specified number of bytes at the specified offset of frame data into a numpy array -boost::python::object ris::Frame::getNumpy(uint32_t offset, uint32_t count) { +boost::python::object ris::Frame::getNumpy(uint32_t offset, uint32_t count, int dtype) { // Retrieve the size, in bytes of the data npy_intp size = getPayload(); + if (count == 0) { + count = size - offset; + } + // Check this does not request data past the EOF if ((offset + count) > size) { throw(rogue::GeneralError::create("Frame::getNumpy", @@ -413,7 +416,7 @@ boost::python::object ris::Frame::getNumpy(uint32_t offset, uint32_t count) { // Create a numpy array to receive it and locate the destination data buffer npy_intp dims[1] = {count}; - PyObject* obj = PyArray_SimpleNew(1, dims, NPY_UINT8); + PyObject* obj = PyArray_SimpleNew(1, dims, dtype); PyArrayObject* arr = reinterpret_cast(obj); uint8_t* dst = reinterpret_cast(PyArray_DATA(arr)); @@ -502,7 +505,10 @@ void ris::Frame::setup_python() { .def("getLastUser", &ris::Frame::getLastUser) .def("setChannel", &ris::Frame::setChannel) .def("getChannel", &ris::Frame::getChannel) - .def("getNumpy", &ris::Frame::getNumpy) + .def("getNumpy", &ris::Frame::getNumpy, ( + bp::arg("offset")=0, + bp::arg("count")=0, + bp::arg("dtype")=NPY_UINT8)) .def("putNumpy", &ris::Frame::putNumpy) .def("_debug", &ris::Frame::debug); #endif From 1a7a455ee30f73e092b2a75fb9ddf6f97d9dac23 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 15 Oct 2024 10:36:02 -0700 Subject: [PATCH 02/15] Fix parameter name for consistency --- include/rogue/interfaces/stream/Frame.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rogue/interfaces/stream/Frame.h b/include/rogue/interfaces/stream/Frame.h index 824968e03..2022da379 100644 --- a/include/rogue/interfaces/stream/Frame.h +++ b/include/rogue/interfaces/stream/Frame.h @@ -356,7 +356,7 @@ class Frame : public rogue::EnableSharedFromThis Date: Tue, 15 Oct 2024 10:48:47 -0700 Subject: [PATCH 03/15] Temporarily turn of C++ linter --- .github/workflows/rogue_ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rogue_ci.yml b/.github/workflows/rogue_ci.yml index 2ed6874eb..c0db8fff9 100644 --- a/.github/workflows/rogue_ci.yml +++ b/.github/workflows/rogue_ci.yml @@ -50,9 +50,9 @@ jobs: flake8 --count ./tests/ # C++ Linter - - name: C++ Linter - run: | - find . -name '*.h' -o -name '*.cpp' | xargs cpplint +# - name: C++ Linter +# run: | +# find . -name '*.h' -o -name '*.cpp' | xargs cpplint # Rogue - name: Build Rogue From 25c51998df04b7b975d31f9c4aa7d1c59b0d1a99 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 15 Oct 2024 12:03:36 -0700 Subject: [PATCH 04/15] Update the way dtype is passed --- include/rogue/interfaces/stream/Frame.h | 4 ++-- src/rogue/interfaces/stream/Frame.cpp | 25 ++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/include/rogue/interfaces/stream/Frame.h b/include/rogue/interfaces/stream/Frame.h index 2022da379..396d0d537 100644 --- a/include/rogue/interfaces/stream/Frame.h +++ b/include/rogue/interfaces/stream/Frame.h @@ -353,10 +353,10 @@ class Frame : public rogue::EnableSharedFromThistype_num; + } else { + throw(rogue::GeneralError::create("Frame::getNumpy", + "Invalid dtype argument. Must be a NumPy dtype object.")); + } + // Create a numpy array to receive it and locate the destination data buffer npy_intp dims[1] = {count}; - PyObject* obj = PyArray_SimpleNew(1, dims, dtype); + PyObject* obj = PyArray_SimpleNew(1, dims, numpy_type); PyArrayObject* arr = reinterpret_cast(obj); uint8_t* dst = reinterpret_cast(PyArray_DATA(arr)); @@ -488,6 +499,14 @@ void ris::Frame::setup_python() { _import_array(); + // Create a NumPy dtype object from the NPY_UINT8 constant + PyObject* dtype_uint8 = reinterpret_cast(PyArray_DescrFromType(NPY_UINT8)); + if (!dtype_uint8) { + throw(rogue::GeneralError::create("Frame::setup_python", + "Failed to create default dtype object for NPY_UINT8.")); + } + + bp::class_("Frame", bp::no_init) .def("lock", &ris::Frame::lock) .def("getSize", &ris::Frame::getSize) @@ -508,7 +527,7 @@ void ris::Frame::setup_python() { .def("getNumpy", &ris::Frame::getNumpy, ( bp::arg("offset")=0, bp::arg("count")=0, - bp::arg("dtype")=NPY_UINT8)) + bp::arg("dtype")=bp::object(bp::handle<>(bp::borrowed(dtype_uint8))))) .def("putNumpy", &ris::Frame::putNumpy) .def("_debug", &ris::Frame::debug); #endif From 0835beeafa4dfee0378637b111b59a07569732ad Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 15 Oct 2024 12:03:55 -0700 Subject: [PATCH 05/15] Whitespace --- src/rogue/interfaces/stream/Frame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rogue/interfaces/stream/Frame.cpp b/src/rogue/interfaces/stream/Frame.cpp index 3a3392096..d115f93fe 100644 --- a/src/rogue/interfaces/stream/Frame.cpp +++ b/src/rogue/interfaces/stream/Frame.cpp @@ -424,7 +424,7 @@ boost::python::object ris::Frame::getNumpy(uint32_t offset, uint32_t count, bp:: throw(rogue::GeneralError::create("Frame::getNumpy", "Invalid dtype argument. Must be a NumPy dtype object.")); } - + // Create a numpy array to receive it and locate the destination data buffer npy_intp dims[1] = {count}; PyObject* obj = PyArray_SimpleNew(1, dims, numpy_type); @@ -505,7 +505,7 @@ void ris::Frame::setup_python() { throw(rogue::GeneralError::create("Frame::setup_python", "Failed to create default dtype object for NPY_UINT8.")); } - + bp::class_("Frame", bp::no_init) .def("lock", &ris::Frame::lock) From eaedb417c075b5fb614d245c2278fe76a76f1ab6 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 15 Oct 2024 12:18:12 -0700 Subject: [PATCH 06/15] Add default offset arguments for readPy and writePy --- src/rogue/interfaces/stream/Frame.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rogue/interfaces/stream/Frame.cpp b/src/rogue/interfaces/stream/Frame.cpp index d115f93fe..a3b39ed68 100644 --- a/src/rogue/interfaces/stream/Frame.cpp +++ b/src/rogue/interfaces/stream/Frame.cpp @@ -512,8 +512,10 @@ void ris::Frame::setup_python() { .def("getSize", &ris::Frame::getSize) .def("getAvailable", &ris::Frame::getAvailable) .def("getPayload", &ris::Frame::getPayload) - .def("read", &ris::Frame::readPy) - .def("write", &ris::Frame::writePy) + .def("read", &ris::Frame::readPy, ( + bp::arg("offset")=0)) + .def("write", &ris::Frame::writePy, ( + bp::arg("offset")=0)) .def("setError", &ris::Frame::setError) .def("getError", &ris::Frame::getError) .def("setFlags", &ris::Frame::setFlags) @@ -528,7 +530,8 @@ void ris::Frame::setup_python() { bp::arg("offset")=0, bp::arg("count")=0, bp::arg("dtype")=bp::object(bp::handle<>(bp::borrowed(dtype_uint8))))) - .def("putNumpy", &ris::Frame::putNumpy) + .def("putNumpy", &ris::Frame::putNumpy, ( + bp::arg("offset")=0)) .def("_debug", &ris::Frame::debug); #endif } From 38327130096825d56cbc4f831bbda9212130c7eb Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 15 Oct 2024 12:44:35 -0700 Subject: [PATCH 07/15] Add readBa method --- include/rogue/interfaces/stream/Frame.h | 10 ++++++++++ src/rogue/interfaces/stream/Frame.cpp | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/include/rogue/interfaces/stream/Frame.h b/include/rogue/interfaces/stream/Frame.h index 396d0d537..3334535bc 100644 --- a/include/rogue/interfaces/stream/Frame.h +++ b/include/rogue/interfaces/stream/Frame.h @@ -327,6 +327,7 @@ class Frame : public rogue::EnableSharedFromThisreadPy(byteArray, offset); + + return byteArray; +} + + //! Write python buffer to frame, starting at offset. Python Version void ris::Frame::writePy(boost::python::object p, uint32_t offset) { Py_buffer pyBuf; @@ -514,6 +529,8 @@ void ris::Frame::setup_python() { .def("getPayload", &ris::Frame::getPayload) .def("read", &ris::Frame::readPy, ( bp::arg("offset")=0)) + .def("readBa", &ris::Frame::readBytearrayPy, ( + bp::arg("offset")=0)) .def("write", &ris::Frame::writePy, ( bp::arg("offset")=0)) .def("setError", &ris::Frame::setError) From 986489a3b4696e0a8b5cf187d463abab5194e948 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 15 Oct 2024 13:02:37 -0700 Subject: [PATCH 08/15] Better bytearray allocation --- src/rogue/interfaces/stream/Frame.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rogue/interfaces/stream/Frame.cpp b/src/rogue/interfaces/stream/Frame.cpp index 7bf375361..9c6f12ba7 100644 --- a/src/rogue/interfaces/stream/Frame.cpp +++ b/src/rogue/interfaces/stream/Frame.cpp @@ -376,7 +376,8 @@ bp::object ris::Frame::readBytearrayPy(uint32_t offset) { uint32_t size = getPayload(); // Create a Python bytearray to hold the data - boost::python::object byteArray = boost::python::eval("bytearray")(size - offset); + bp::object byteArray(bp::handle<>(PyByteArray_FromStringAndSize(nullptr, size - offset))); + this->readPy(byteArray, offset); From 86a87ed9a16e96f834ee201100ff6bd743d493a7 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 15 Oct 2024 13:41:11 -0700 Subject: [PATCH 09/15] Add getMemoryviewPy feature --- include/rogue/interfaces/stream/Frame.h | 11 +++++++-- src/rogue/interfaces/stream/Frame.cpp | 30 ++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/include/rogue/interfaces/stream/Frame.h b/include/rogue/interfaces/stream/Frame.h index 3334535bc..d64944547 100644 --- a/include/rogue/interfaces/stream/Frame.h +++ b/include/rogue/interfaces/stream/Frame.h @@ -341,10 +341,17 @@ class Frame : public rogue::EnableSharedFromThis(PyByteArray_FromStringAndSize(nullptr, size))); + + this->readPy(byteArray, 0); + + // Create a memoryview from the bytearray + PyObject* memoryView = PyMemoryView_FromObject(byteArray.ptr()); + if (!memoryView) { + throw(rogue::GeneralError::create("Frame::getMemoryviewPy", + "Failed to create memoryview.")); + } + + // Return the memoryview as a Python object + return bp::object(bp::handle<>(memoryView)); + +} + + //! Write python buffer to frame, starting at offset. Python Version void ris::Frame::writePy(boost::python::object p, uint32_t offset) { @@ -530,8 +553,9 @@ void ris::Frame::setup_python() { .def("getPayload", &ris::Frame::getPayload) .def("read", &ris::Frame::readPy, ( bp::arg("offset")=0)) - .def("readBa", &ris::Frame::readBytearrayPy, ( + .def("getBa", &ris::Frame::getBytearrayPy, ( bp::arg("offset")=0)) + .def("getMemoryview", &ris::Frame::getMemoryviewPy) .def("write", &ris::Frame::writePy, ( bp::arg("offset")=0)) .def("setError", &ris::Frame::setError) From a2f3067b5e8ac6b727a3ad71fa118dc669719fd9 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Wed, 16 Oct 2024 09:32:26 -0700 Subject: [PATCH 10/15] Add count parameter to getBytearrayPy --- include/rogue/interfaces/stream/Frame.h | 3 ++- src/rogue/interfaces/stream/Frame.cpp | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/rogue/interfaces/stream/Frame.h b/include/rogue/interfaces/stream/Frame.h index d64944547..9af5f204a 100644 --- a/include/rogue/interfaces/stream/Frame.h +++ b/include/rogue/interfaces/stream/Frame.h @@ -343,8 +343,9 @@ class Frame : public rogue::EnableSharedFromThis(PyByteArray_FromStringAndSize(nullptr, size - offset))); - + bp::object byteArray(bp::handle<>(PyByteArray_FromStringAndSize(nullptr, count))); + // readPy will check bounds this->readPy(byteArray, offset); return byteArray; @@ -554,7 +559,8 @@ void ris::Frame::setup_python() { .def("read", &ris::Frame::readPy, ( bp::arg("offset")=0)) .def("getBa", &ris::Frame::getBytearrayPy, ( - bp::arg("offset")=0)) + bp::arg("offset")=0, + bp::arg("count")=0)) .def("getMemoryview", &ris::Frame::getMemoryviewPy) .def("write", &ris::Frame::writePy, ( bp::arg("offset")=0)) From 387b65d0f2c35481c3a1b3ee82d479cf00122075 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Wed, 16 Oct 2024 10:04:48 -0700 Subject: [PATCH 11/15] Add linter back to CI --- .github/workflows/rogue_ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rogue_ci.yml b/.github/workflows/rogue_ci.yml index c0db8fff9..2ed6874eb 100644 --- a/.github/workflows/rogue_ci.yml +++ b/.github/workflows/rogue_ci.yml @@ -50,9 +50,9 @@ jobs: flake8 --count ./tests/ # C++ Linter -# - name: C++ Linter -# run: | -# find . -name '*.h' -o -name '*.cpp' | xargs cpplint + - name: C++ Linter + run: | + find . -name '*.h' -o -name '*.cpp' | xargs cpplint # Rogue - name: Build Rogue From 7f3692207e4b37c04bef871b408f0de7a7c5aad7 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Mon, 4 Nov 2024 10:44:46 -0800 Subject: [PATCH 12/15] Whitespace cleanup --- include/rogue/interfaces/stream/Frame.h | 4 ++-- src/rogue/interfaces/stream/Frame.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/rogue/interfaces/stream/Frame.h b/include/rogue/interfaces/stream/Frame.h index 9af5f204a..9db0ba3ca 100644 --- a/include/rogue/interfaces/stream/Frame.h +++ b/include/rogue/interfaces/stream/Frame.h @@ -327,7 +327,7 @@ class Frame : public rogue::EnableSharedFromThis(PyByteArray_FromStringAndSize(nullptr, count))); @@ -408,7 +408,7 @@ bp::object ris::Frame::getMemoryviewPy() { } // Return the memoryview as a Python object - return bp::object(bp::handle<>(memoryView)); + return bp::object(bp::handle<>(memoryView)); } From 6b9827b2d523b4f5464f0834196abf31c2801ced Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Mon, 4 Nov 2024 10:57:14 -0800 Subject: [PATCH 13/15] Fix casting style --- src/rogue/interfaces/stream/Frame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rogue/interfaces/stream/Frame.cpp b/src/rogue/interfaces/stream/Frame.cpp index f00efd355..a25743408 100644 --- a/src/rogue/interfaces/stream/Frame.cpp +++ b/src/rogue/interfaces/stream/Frame.cpp @@ -464,7 +464,7 @@ boost::python::object ris::Frame::getNumpy(uint32_t offset, uint32_t count, bp:: int numpy_type; PyObject* dtype_pyobj = dtype.ptr(); // Get the raw PyObject from the Boost.Python object if (PyArray_DescrCheck(dtype_pyobj)) { - numpy_type = ((PyArray_Descr*)dtype_pyobj)->type_num; + numpy_type = (reinterpret_case(dtype_pyobj))->type_num; } else { throw(rogue::GeneralError::create("Frame::getNumpy", "Invalid dtype argument. Must be a NumPy dtype object.")); From d6b25031daf656c14a116e48694b13d07e75d12b Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Mon, 4 Nov 2024 10:57:21 -0800 Subject: [PATCH 14/15] clang-format --- include/rogue/interfaces/stream/Frame.h | 2 -- src/rogue/interfaces/stream/Frame.cpp | 39 +++++++++---------------- 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/include/rogue/interfaces/stream/Frame.h b/include/rogue/interfaces/stream/Frame.h index 9db0ba3ca..0189fe4b0 100644 --- a/include/rogue/interfaces/stream/Frame.h +++ b/include/rogue/interfaces/stream/Frame.h @@ -328,7 +328,6 @@ class Frame : public rogue::EnableSharedFromThis(PyByteArray_FromStringAndSize(nullptr, count))); @@ -403,17 +401,13 @@ bp::object ris::Frame::getMemoryviewPy() { // Create a memoryview from the bytearray PyObject* memoryView = PyMemoryView_FromObject(byteArray.ptr()); if (!memoryView) { - throw(rogue::GeneralError::create("Frame::getMemoryviewPy", - "Failed to create memoryview.")); + throw(rogue::GeneralError::create("Frame::getMemoryviewPy", "Failed to create memoryview.")); } // Return the memoryview as a Python object return bp::object(bp::handle<>(memoryView)); - } - - //! Write python buffer to frame, starting at offset. Python Version void ris::Frame::writePy(boost::python::object p, uint32_t offset) { Py_buffer pyBuf; @@ -459,15 +453,13 @@ boost::python::object ris::Frame::getNumpy(uint32_t offset, uint32_t count, bp:: size)); } - // Convert Python dtype object to NumPy type int numpy_type; PyObject* dtype_pyobj = dtype.ptr(); // Get the raw PyObject from the Boost.Python object if (PyArray_DescrCheck(dtype_pyobj)) { numpy_type = (reinterpret_case(dtype_pyobj))->type_num; } else { - throw(rogue::GeneralError::create("Frame::getNumpy", - "Invalid dtype argument. Must be a NumPy dtype object.")); + throw(rogue::GeneralError::create("Frame::getNumpy", "Invalid dtype argument. Must be a NumPy dtype object.")); } // Create a numpy array to receive it and locate the destination data buffer @@ -547,24 +539,19 @@ void ris::Frame::setup_python() { // Create a NumPy dtype object from the NPY_UINT8 constant PyObject* dtype_uint8 = reinterpret_cast(PyArray_DescrFromType(NPY_UINT8)); if (!dtype_uint8) { - throw(rogue::GeneralError::create("Frame::setup_python", - "Failed to create default dtype object for NPY_UINT8.")); + throw( + rogue::GeneralError::create("Frame::setup_python", "Failed to create default dtype object for NPY_UINT8.")); } - bp::class_("Frame", bp::no_init) .def("lock", &ris::Frame::lock) .def("getSize", &ris::Frame::getSize) .def("getAvailable", &ris::Frame::getAvailable) .def("getPayload", &ris::Frame::getPayload) - .def("read", &ris::Frame::readPy, ( - bp::arg("offset")=0)) - .def("getBa", &ris::Frame::getBytearrayPy, ( - bp::arg("offset")=0, - bp::arg("count")=0)) + .def("read", &ris::Frame::readPy, (bp::arg("offset") = 0)) + .def("getBa", &ris::Frame::getBytearrayPy, (bp::arg("offset") = 0, bp::arg("count") = 0)) .def("getMemoryview", &ris::Frame::getMemoryviewPy) - .def("write", &ris::Frame::writePy, ( - bp::arg("offset")=0)) + .def("write", &ris::Frame::writePy, (bp::arg("offset") = 0)) .def("setError", &ris::Frame::setError) .def("getError", &ris::Frame::getError) .def("setFlags", &ris::Frame::setFlags) @@ -575,12 +562,12 @@ void ris::Frame::setup_python() { .def("getLastUser", &ris::Frame::getLastUser) .def("setChannel", &ris::Frame::setChannel) .def("getChannel", &ris::Frame::getChannel) - .def("getNumpy", &ris::Frame::getNumpy, ( - bp::arg("offset")=0, - bp::arg("count")=0, - bp::arg("dtype")=bp::object(bp::handle<>(bp::borrowed(dtype_uint8))))) - .def("putNumpy", &ris::Frame::putNumpy, ( - bp::arg("offset")=0)) + .def("getNumpy", + &ris::Frame::getNumpy, + (bp::arg("offset") = 0, + bp::arg("count") = 0, + bp::arg("dtype") = bp::object(bp::handle<>(bp::borrowed(dtype_uint8))))) + .def("putNumpy", &ris::Frame::putNumpy, (bp::arg("offset") = 0)) .def("_debug", &ris::Frame::debug); #endif } From c87a109570ed7419dc4ddf83c057a17bc17df675 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Mon, 4 Nov 2024 11:00:52 -0800 Subject: [PATCH 15/15] Fix typo --- src/rogue/interfaces/stream/Frame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rogue/interfaces/stream/Frame.cpp b/src/rogue/interfaces/stream/Frame.cpp index 4444c5a8b..3891c1a4a 100644 --- a/src/rogue/interfaces/stream/Frame.cpp +++ b/src/rogue/interfaces/stream/Frame.cpp @@ -457,7 +457,7 @@ boost::python::object ris::Frame::getNumpy(uint32_t offset, uint32_t count, bp:: int numpy_type; PyObject* dtype_pyobj = dtype.ptr(); // Get the raw PyObject from the Boost.Python object if (PyArray_DescrCheck(dtype_pyobj)) { - numpy_type = (reinterpret_case(dtype_pyobj))->type_num; + numpy_type = (reinterpret_cast(dtype_pyobj))->type_num; } else { throw(rogue::GeneralError::create("Frame::getNumpy", "Invalid dtype argument. Must be a NumPy dtype object.")); }