-
Notifications
You must be signed in to change notification settings - Fork 425
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
Support exporting Chapel lists as Python lists #15423
Comments
Since (as I understand it) Python lists are stored monolithically in memory, I wonder whether we should implement the similarly contiguous-in-memory based list implementation that we've talked about in Chapel and have that interoperate with Python lists as a first step. Otherwise, is the implication that we'd have to do a copy of the list to get it into contiguous memory for Python? (where I'm hoping the Python list could potentially refer to the same memory as the Chapel list if they used similar memory layouts?). |
Is there an issue documenting this that we could reference?
I think so, but referring to the same memory sounds ideal to me, if possible. |
Not that I'm aware of. |
Correct me if I'm wrong @lydia-duncan, but I think we |
That sounds familiar, but we've discussed wanting to get out of that business as well I think... |
That's correct, and we do want to stop doing so. I'm okay with not addressing that for this change and handling it more wholesale, especially if we have someplace tracking the spots that should be updated to not copy (we may, but I don't remember off the top of my head) |
I'm not entirely sure if it is possible to avoid copying memory when exporting a Chapel array unless we had some means of i.e. calling I think our best chance of supporting types like |
Currently, Chapel arrays export as numpy ndarrays. This makes sense, because ndarrays can be multidimensional like Chapel arrays (among other reasons). This is a feature request to support exporting Chapel lists to Python lists. This also makes sense, because both lists only support 1 dimension and are stored as dynamic arrays.
Below is a few examples demonstrating this proposal:
The text was updated successfully, but these errors were encountered: