Repository navigation
BUG: Only convert 0d arrays to scalars in power - #4146
Conversation
|
It might be possible to simplify the function using other conversion functions, but this fixes the issue at hand nicely. |
|
This doesn't fix the problem: If I don't use This PR only works if I run python as |
|
OOps, right point, completly nonsense fix :) |
|
Updated, could remove the numpy scalar branch, since we support Index, but it should not really matter either way. |
|
Maybe a bit late for 1.8.1rc1, but this would be useful to merge and backport. Just ran into this, and it's quite annoying to avoid. |
|
OK, lets give it a shot. I supose 1.8.1 will give us some testing of these fixes also. |
|
Merged, thanks Sebastian. Oops, needs a rebase now. |
|
Rebased. |
|
Why does the test still need to filter warnings? The code being tested should not raise a warning. If it does, it is a bug. |
|
Oops, yes, it does not do that anymore, so removed it. |
Operations such as `x**array([2])` would convert the 2 into an integer and loose the dimension information, because the array (at this time, it is deprecated), supports `__index__` even though it is not 0-d. This fixes it, by not trying the index machinery when it was an array, since it is unnecessary. Closes numpygh-4145
BUG: Only convert 0d arrays to scalars in power
|
merged but its a nontrivial backport, if you want it in do it quick |
Operations such as
x**array([2])would convert the2 into an integer and loose the dimension information,
because the array (at this time, it is deprecated),
supports
__index__even though it is not 0-d.This fixes it, by not trying the index machinery
when it was an array, since it is unnecessary.
Closes gh-4145
Really very simple fix. Should likely be backported.