ENH: Allow object and subarray dtypes in fromiter#20993
Conversation
6170167 to
d51515f
Compare
4e0d5b8 to
b93c5f6
Compare
Allows dtypes with objects (and subarray) in fromiter. There was never really a good reason for rejecting them. Otherwise does some maintanence (e.g. the array is contiguous, so no need to do complicated index calculations), improve the error message, and add tests for those things. Closes numpygh-4791, numpygh-15789
3572a08 to
e87c430
Compare
aac3fe8 to
34d7e76
Compare
|
Oooh neat, does the mean it's now also possible to create >1D arrays with the likes of, e.g., Also, this feels worthy of a release note in my opinion (and maybe an extra example in the docstring?). |
If you must, yes... but it does that via the subarray dtype, so it might be subtly different from what you expect. |
|
Added something, unfortunately, also triggered an unrelated bug on the way. (the example works, the bug is in some error path) |
1bc8b1e to
7d76c9e
Compare
|
No, just me being stupid, wrote The iteration bailing out on |
Seems we never had a test for this simple path...
7d76c9e to
7078203
Compare
Seems I forgot to commit this one...
|
This all looks good, but was never reviewed. @seberg is there a reason not to put this in? |
|
No, I think review just stalled and should be good. We probably have to apply your stride fix here as well (probably just meaning to remove/modify |
|
Let's merge this then I will rebase #21477 on top |
|
Thanks! |
Allows dtypes with objects (and subarray) in fromiter. There was
never really a good reason for rejecting them.
Otherwise does some maintanence (e.g. the array is contiguous, so
no need to do complicated index calculations), improve the error
message, and add tests for those things.
Closes gh-4791, gh-15789