diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2019-11-27 15:44:22 -0600 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2020-02-05 17:46:46 -0800 |
commit | 48dbe8453d6dcbf22e49f0080b364d7f0e642f50 (patch) | |
tree | 3c0f6d8722ea1ebfa992d77befbdfe0870606f07 /numpy/array_api/tests/test_array_object.py | |
parent | a9bc5db4671c6c702e3a8a35fbf31b8d3225fad2 (diff) | |
download | numpy-48dbe8453d6dcbf22e49f0080b364d7f0e642f50.tar.gz |
BUG: Use ``__array__`` during dimension discovery
``__array__`` was previously not used during dimension discovery,
while bein gused during dtype discovery (if dtype is not given),
as well as during filling of the resulting array.
This would lead to inconsistencies with respect to array likes
that have a shape including a 0 (typically as first dimension).
Thus a shape of ``(0, 1, 1)`` would be found as ``(0,)`` because
a nested list/sequence cannot represent empty shapes, except 1-D.
This uses the `_array_from_array_like` function, which means that
some coercions may be tiny bit slower, at the gain of removing
a lot of complex code.
(this also reverts commit d0d250a3c9d7d90e75701c32d7d435640e6b02eb
or the related change).
This is a continuation of work by Sergei Lebedev in gh-13663
which had to be reverted due to problems with Pandas, and the
general inconsistency. This version may not resolve all issues
with pandas, but does resolve the inconsistency.
Closes gh-13958
Diffstat (limited to 'numpy/array_api/tests/test_array_object.py')
0 files changed, 0 insertions, 0 deletions