-
Notifications
You must be signed in to change notification settings - Fork 42
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
problem with multidimensional uint8_t arrays #278
Comments
There have been a couple of recent changes with handling
(The cast fails b/c the array is kept a The memoryview probably fails b/c none of the flags are set (it also claims not to be f_contiguous), so that needs fixing. (The |
Unfortunately, the direct conversion doesn't seem to work with cppyy 3.1.2 (in ROOT 6.32.08):
Trying
outputs the same error on this cppyy version. However, I have found a workaround that works in ROOT 6.32.08 (and is presumably backwards compatible as well):
|
The cast fails b/c internally, the What the checking code should do, is make sure the array is flat and c_contiguous and then it can go to inner view to check the item size. That said, with the just released 3.5.0, both passing |
In ROOT 6.32.08 , which uses cppyy 3.1.2, an issue appeared that didn't happen before.
Basically we store a multimensional uint8_t array, and are having trouble converting it to a numpy array.
Here is a reproducer in the same spirit showing the problem.
but now this no longer works, presumably related to the changes for making uint8_t work in other cases? The cast was necessary to make it work before (and it still doesn't work without the cast, with numpy complains now complaining that it's not C contiguous, though I think it was a different problem earlier, like wrong size or something, I can check).
The LowLevelView itself has the right shape and format, and I can access elements fine from the LowLevelView. If I create a memoryview from the LowLevelView it indeed claims it's not C contiguous and also claims that that the itemsize is 8?
The text was updated successfully, but these errors were encountered: