Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1149 - bytes, bytearray types managed #1156

Merged
merged 1 commit into from Apr 9, 2024

Conversation

Nelson-numerical-software
Copy link
Collaborator

No description provided.

@Nelson-numerical-software Nelson-numerical-software linked an issue Apr 8, 2024 that may be closed by this pull request
Comment on lines 598 to 604
//// Create ArrayOf object with appropriate dimensions and data
// indexType r = dims[0];
// indexType c = dims[0] + PyArray_NDIM(pyArray);
// Dimensions arrayDims(r, c);
// ArrayOf res(nelsonType, arrayDims, dataPtr);
// results << res;
// return true;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Comment on lines 591 to 596
////// Get array dimensions and data pointer
// npy_intp* dims = PyArray_DIMS(pyArray);
// T* dataPtr = (T*)PyArray_DATA(pyArray);
// ArrayOf res(nelsonType, Dimensions(1, 4), dataPtr);
// results << res;
// return true;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Comment on lines 588 to 589
// bool isarray = PyArray_Check(pyObject);
// PyArrayObject* pyArray = (PyArrayObject*)pyObject;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
PythonType pyType = getPythonType(pyObject);
switch (pyType) {
case PY_NUMPY_TYPE: {
PyObject* numpy = NLSPyImport_ImportModule("numpy.core._multiarray_umath");

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable numpy is not used.
return ArrayOf(NLS_LOGICAL, dims, ptr);
void* data = (void*)pyBuffer.buf;
void* ptr = (void*)ArrayOf::allocateArrayOf(nelsonType, dims.getElementCount());
ArrayOf res = ArrayOf(nelsonType, dims, ptr);

Check notice

Code scanning / CodeQL

Declaration hides variable Note

Variable res hides another variable of the same name (on
line 540
).
modules/python_engine/src/cpp/PythonObjectHandle.cpp Dismissed Show dismissed Hide dismissed
@Nelson-numerical-software Nelson-numerical-software merged commit 106cf2b into master Apr 9, 2024
15 of 16 checks passed
@Nelson-numerical-software Nelson-numerical-software deleted the feat-#1149-bytearray-type branch April 9, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

python bytearray type not managed
1 participant