[Numpy-svn] [numpy/numpy] a53009: BUG: fix random.choice scalar object result and di...

GitHub noreply@github....
Mon Mar 4 07:35:20 CST 2013


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: a530098e816e1164efdb356ac2280ba25bfb1c7f
      https://github.com/numpy/numpy/commit/a530098e816e1164efdb356ac2280ba25bfb1c7f
  Author: Sebastian Berg <sebastian@sipsolutions.net>
  Date:   2013-03-04 (Mon, 04 Mar 2013)

  Changed paths:
    M numpy/random/mtrand/mtrand.pyx
    M numpy/random/tests/test_random.py

  Log Message:
  -----------
  BUG: fix random.choice scalar object result and disallow 0-d arrays

Object arrays failed due to bad check for finding out if the result should
be a scalar type and not an array when size=None. Also in this case the
creation of the new array was wrong. This should be fixed with this.

The second fix is to forbid 0-d arrays. Allowing 0-d arrays does not
make much sense. But it is dangerous because for example floats will
be interpreted as 1-d arrays, while one may expect that they are interpreted
as integers. This also saves the trouble of reliably detecting all integers...


  Commit: 66ffc58fb390c3953f9e3047ed9da54329af6baf
      https://github.com/numpy/numpy/commit/66ffc58fb390c3953f9e3047ed9da54329af6baf
  Author: Sebastian Berg <sebastian@sipsolutions.net>
  Date:   2013-03-04 (Mon, 04 Mar 2013)

  Changed paths:
    M numpy/random/mtrand/mtrand.c

  Log Message:
  -----------
  MAINT: regenerate mtrand.c


  Commit: e1055868eb6c015a568f0ccff29b37d1e3970242
      https://github.com/numpy/numpy/commit/e1055868eb6c015a568f0ccff29b37d1e3970242
  Author: seberg <sebastian@sipsolutions.net>
  Date:   2013-03-04 (Mon, 04 Mar 2013)

  Changed paths:
    M numpy/random/mtrand/mtrand.c
    M numpy/random/mtrand/mtrand.pyx
    M numpy/random/tests/test_random.py

  Log Message:
  -----------
  Merge pull request #2992 from seberg/choice-object-scalar

BUG: fix random.choice scalar object result and disallow 0-d arrays


Compare: https://github.com/numpy/numpy/compare/9a62d54e871b...e1055868eb6c


More information about the Numpy-svn mailing list