You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Numpy v1 compatibility broken on main with DimArray #727
Describe the bug ArrayValue.__array__() now supports the copy argument and defaults to copy=None, but this is not supported on numpy v1 and breaks when using a DimArray from DimensionalData.jl:
My guess is that Base.unsafe_convert(::Type{Ptr{T}}, ::DimArray) is not defined, which is required to be wrappable as a python array, since this is how we get a pointer to the underlying data.
In this case we fall back to converting the array to an Array, and perhaps the above issue only arises in this branch?
My guess is that Base.unsafe_convert(::Type{Ptr{T}}, ::DimArray) is not defined, which is required to be wrappable as a python array, since this is how we get a pointer to the underlying data.
Yep you're quite right, I'll close this then since it's not a PythonCall issue.
Activity
cjdoris commentedon Dec 1, 2025
Thanks. I think the fix is to call
np.asarrayinstead ofnp.arraywhencopy=Nonebecausenp.array(x, copy=None)is not supported in numpy v1.JamesWrigley commentedon Dec 3, 2025
Hmm, but that doesn't explain why it works with
Arrayand notDimArray🤔 I think something else is happening.cjdoris commentedon Dec 6, 2025
My guess is that
Base.unsafe_convert(::Type{Ptr{T}}, ::DimArray)is not defined, which is required to be wrappable as a python array, since this is how we get a pointer to the underlying data.In this case we fall back to converting the array to an
Array, and perhaps the above issue only arises in this branch?JamesWrigley commentedon Dec 6, 2025
Is that a new requirement? Because it did work in the last stable release.
cjdoris commentedon Dec 6, 2025
No it's not new. Can you give an MWE showing it working and not working?
JamesWrigley commentedon Jan 16, 2026
Actually no sorry, I think I was mistaken 😕
JamesWrigley commentedon Jan 16, 2026
Yep you're quite right, I'll close this then since it's not a PythonCall issue.