Skip to content

Commit

Permalink
chore: remove numpy core directories
Browse files Browse the repository at this point in the history
  • Loading branch information
Khushiyant committed Jul 30, 2024
1 parent 363b864 commit 2d5f981
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ if (NOT Python_Development_FOUND)
endif()

include_directories("${PROJECT_SOURCE_DIR}/include" "${Python_INCLUDE_DIRS}")
include_directories("/Users/khushiyant/Desktop/Development/gsoc/.venv/lib/python3.10/site-packages/numpy/_core/include")

file (GLOB cppyy_src src/*.cxx)

Expand Down
16 changes: 8 additions & 8 deletions src/Pythonize.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -463,17 +463,17 @@ PyObject* VectorIAdd(PyObject* self, PyObject* args, PyObject* /* kwds */)

PyObject* VectorInit(PyObject* self, PyObject* args, PyObject* /* kwds */)
{
// Specialized vector constructor to allow construction from containers; allowing
// such construction from initializer_list instead would possible, but can be
// error-prone. This use case is common enough for std::vector to implement it
// directly, except for arrays (which can be passed wholesale) and strings (which
// won't convert properly as they'll be seen as buffers)
// Specialized vector constructor to allow construction from containers; allowing
// such construction from initializer_list instead would possible, but can be
// error-prone. This use case is common enough for std::vector to implement it
// directly, except for arrays (which can be passed wholesale) and strings (which
// won't convert properly as they'll be seen as buffers)

ItemGetter* getter = GetGetter(args);

if (getter) {
// construct an empty vector, then back-fill it
PyObject* result = PyObject_CallMethodNoArgs(self, PyStrings::gArray);
// construct an empty vector, then back-fill it
PyObject* result = PyObject_CallMethodNoArgs(self, PyStrings::gRealInit);
if (!result) {
delete getter;
return nullptr;
Expand Down Expand Up @@ -1918,8 +1918,8 @@ bool CPyCppyy::Pythonize(PyObject* pyclass, const std::string& name)
Utility::AddToClass(pyclass, "__setitem__", (PyCFunction)VectorBoolSetItem);
} else {
// constructor that takes python collections
Utility::AddToClass(pyclass, "__init__", (PyCFunction)VectorInit, METH_VARARGS | METH_KEYWORDS);
Utility::AddToClass(pyclass, "__real_init", "__init__");
Utility::AddToClass(pyclass, "__init__", (PyCFunction)VectorInit, METH_VARARGS | METH_KEYWORDS);

// data with size
Utility::AddToClass(pyclass, "__real_data", "data");
Expand Down

0 comments on commit 2d5f981

Please sign in to comment.