[Numpy-svn] [numpy/numpy] 27f935: BUG: Only convert 0d arrays to scalars in power

GitHub noreply at github.com
Sun Mar 2 08:59:51 EST 2014


  Branch: refs/heads/maintenance/1.8.x
  Home:   https://github.com/numpy/numpy
  Commit: 27f9354e54f7ce4071d74c0d880c591f98266c70
      https://github.com/numpy/numpy/commit/27f9354e54f7ce4071d74c0d880c591f98266c70
  Author: Julian Taylor <jtaylor.debian at googlemail.com>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M numpy/core/src/multiarray/number.c
    M numpy/core/tests/test_umath.py

  Log Message:
  -----------
  BUG: Only convert 0d arrays to scalars in power

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 gh-4145


  Commit: 43f7ff7975540936be9c442906e17df8c581371a
      https://github.com/numpy/numpy/commit/43f7ff7975540936be9c442906e17df8c581371a
  Author: Julian Taylor <jtaylor.debian at googlemail.com>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M doc/release/1.8.1-notes.rst

  Log Message:
  -----------
  DOC: add fixed issue 4145 to release notes


  Commit: f816b0a90cc123dde4240d1d1fa22e582f65340d
      https://github.com/numpy/numpy/commit/f816b0a90cc123dde4240d1d1fa22e582f65340d
  Author: Julian Taylor <juliantaylor108 at gmail.com>
  Date:   2014-03-02 (Sun, 02 Mar 2014)

  Changed paths:
    M doc/release/1.8.1-notes.rst
    M numpy/core/src/multiarray/number.c
    M numpy/core/tests/test_umath.py

  Log Message:
  -----------
  Merge pull request #4419 from juliantaylor/scalar-0d

backport 0d array power fix to 1.8


Compare: https://github.com/numpy/numpy/compare/e5139b7aa228...f816b0a90cc1


More information about the Numpy-svn mailing list