-
Notifications
You must be signed in to change notification settings - Fork 205
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
feature request: allow changing ndarray WRITABLE flag after ndarray construction #171
Comments
Any chance that this will be implemented? Would you review a PR if I prepare one? |
Yes, it looks like a simple |
This would be the generic solution, right, but it may open possibilities to wreck havoc with the internal consistency of the array. We could document this with a "use at your own peril" or something. When I look through the list of flags of the C-API |
I'd rather not hand-hold users of the API. So if this is possible in the NumPy C API, I'm inclined to make it accessible in Boost.Python directly. But of course, proper documentation (including warning signs) would be helpful. |
Ok! |
I submitted a PR. Some tests are failing, but this seems unrelated to the new code... |
I want to write a function which creates, fills, and returns an ndarray in C++. The ndarray owns its memory, but should be non-writable for the user. I would therefore like to clear the WRITABLE flag after I finished filling it in my function. I studied the header and I see no way of doing this right now, because flags are not writable after creating an ndarray. For most flags this makes sense, the WRITABLE flag seems to be the only one which you may want to change manually.
Is it possible to add this feature? Best regards!
The text was updated successfully, but these errors were encountered: