Closed carlosal1015 closed 2 years ago
Okay, I dug into this a bit and as far as I can tell, it's enough to just to replace NPY_UPDATEIFCOPY
with NPY_ARRAY_WRITEBACKIFCOPY
in our macro. IIRC there was also some divergence between libdynd and dynd-python around when we stopped active development, so I'll have to go back and try to make sense of what was going on there to get a clean fixed version tagged that actually works. No definite ETA because things are hectic for me right now, but I'll try and get it out soon-ish.
Thanks, very appreciated.
Okay, I've verified that this diff fixes it:
diff --git a/dynd/include/numpy_interop.hpp b/dynd/include/numpy_interop.hpp
index 8036b8f..c109407 100644
--- a/dynd/include/numpy_interop.hpp
+++ b/dynd/include/numpy_interop.hpp
@@ -33,7 +33,6 @@
#define NPY_ARRAY_NOTSWAPPED NPY_NOTSWAPPED
#define NPY_ARRAY_ALIGNED NPY_ALIGNED
#define NPY_ARRAY_WRITEABLE NPY_WRITEABLE
-#define NPY_ARRAY_UPDATEIFCOPY NPY_UPDATEIFCOPY
#endif
#define PY_ARRAY_UNIQUE_SYMBOL pydynd_ARRAY_API
diff --git a/dynd/src/numpy_interop.cpp b/dynd/src/numpy_interop.cpp
index 24f445b..767ff4a 100644
--- a/dynd/src/numpy_interop.cpp
+++ b/dynd/src/numpy_interop.cpp
@@ -524,7 +524,7 @@ dynd::nd::array pydynd::array_from_numpy_array(PyArrayObject *obj,
// Get a shared pointer that tracks buffer ownership
PyObject *base = PyArray_BASE(obj);
dynd::intrusive_ptr<dynd::memory_block_data> memblock;
- if (base == NULL || (PyArray_FLAGS(obj) & NPY_ARRAY_UPDATEIFCOPY) != 0) {
+ if (base == NULL || (PyArray_FLAGS(obj) & NPY_ARRAY_WRITEBACKIFCOPY) != 0) {
Py_INCREF(obj);
memblock = dynd::make_external_memory_block(obj, py_decref_function);
}
There were a bunch of changes since the 0.7.2 release, but they left master in a broken state due to a failed reorg to split apart the type and callable infrastructure. I'm mulling over what to do with those changes. At this point I don't care about the reorg. It's a lot more important just to have a current working copy. I'll see if there's an obvious safe point to roll master back to so I can apply this patch there.
Is having the patch here enough to unblock your work or do you need a tag in master?
Thank you, the above patch is working fine as well. Not required make a new tag/release. Thanks again.
Over Arch Linux distribution, when we compile, we have the following message error at the end.
Version: python-dynd 0.7.2 Python 3.10.5 NumPy: 1.23.0
This due by the following depraction item 3.