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

GitHub noreply@github....
Fri Mar 8 17:01:17 CST 2013


  Branch: refs/heads/maintenance/1.7.x
  Home:   https://github.com/numpy/numpy
  Commit: 1af8949515100c9f625f0c1f3e4c3cb4b10a1638
      https://github.com/numpy/numpy/commit/1af8949515100c9f625f0c1f3e4c3cb4b10a1638
  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: 8070640b54ff286dbce033505389aef9033a1234
      https://github.com/numpy/numpy/commit/8070640b54ff286dbce033505389aef9033a1234
  Author: Sebastian Berg <sebastian@sipsolutions.net>
  Date:   2013-03-06 (Wed, 06 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:
  -----------
  MAINT: random.choice python 2.4 compatibility changes


  Commit: 23a2ce2124149d5beaf087dc9cadcba43fddd001
      https://github.com/numpy/numpy/commit/23a2ce2124149d5beaf087dc9cadcba43fddd001
  Author: Sebastian Berg <sebastian@sipsolutions.net>
  Date:   2013-03-06 (Wed, 06 Mar 2013)

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

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


  Commit: 86a01020d39fa24c6cb8ff54061e5df58d3e65c6
      https://github.com/numpy/numpy/commit/86a01020d39fa24c6cb8ff54061e5df58d3e65c6
  Author: njsmith <njs@pobox.com>
  Date:   2013-03-08 (Fri, 08 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 #3117 from seberg/backport-choice-object-scalar

Backport gh-2992


Compare: https://github.com/numpy/numpy/compare/bb1bdea328ef...86a01020d39f


More information about the Numpy-svn mailing list