[Numpy-svn] [numpy/numpy] 2e8fcc: API: Make nditer support ndim == 0 for 0-d iterati...

GitHub noreply at github.com
Mon Apr 1 15:53:39 EDT 2013


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: 2e8fcc0814486accb71aacb7d60ebcb3203f3b7a
      https://github.com/numpy/numpy/commit/2e8fcc0814486accb71aacb7d60ebcb3203f3b7a
  Author: Sebastian Berg <sebastian at sipsolutions.net>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M numpy/core/src/multiarray/nditer_api.c
    M numpy/core/src/multiarray/nditer_constr.c
    M numpy/core/src/multiarray/nditer_impl.h
    M numpy/core/src/private/lowlevel_strided_loops.h
    M numpy/core/src/umath/reduction.c
    M numpy/core/src/umath/ufunc_object.c

  Log Message:
  -----------
  API: Make nditer support ndim == 0 for 0-d iterations.

There are relatively few changes necessare here. However there is a
conceptionally there are no axes for the 0-d case, and no axesdata
needs to be used. This still uses the first axisdata. Which means that
in a few places ndim == 0 is special cased or special cased to act like
ndim == 1.
It would probably be a little cleaner to to use the base pointers directly
in the 0-d case and no axes iteration at all. That would require similar
special cases though.

This also makes oa_ndim == -1 the "correct" way to signal that no op_axes
are given with oa_ndim == 0 being, for the time being, dual use. Either
meaning that nothing may be given, or if something something was given
enforcing a 0-d iteration.

The necessary changes to the ufunc machinery are also done.

Documented that the dtype transfer functions do not handle the scalar
case unless even shape is set.


  Commit: acce195ad306529c7f083f48a48b51876168f421
      https://github.com/numpy/numpy/commit/acce195ad306529c7f083f48a48b51876168f421
  Author: Sebastian Berg <sebastian at sipsolutions.net>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M numpy/core/src/multiarray/nditer_pywrap.c

  Log Message:
  -----------
  ENH: Allow np.nditer to support scalar op_axes

Also uses oa_ndim == -1 to signal no op_axes were given. This is slightly
cleaner inside pywrap itself and is a cleaner signal for the iterator.


  Commit: c11fa494fd8f7efcf70097d052b13d8b25caa1ab
      https://github.com/numpy/numpy/commit/c11fa494fd8f7efcf70097d052b13d8b25caa1ab
  Author: Sebastian Berg <sebastian at sipsolutions.net>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M numpy/core/tests/test_nditer.py

  Log Message:
  -----------
  TST: Add basic tests for 0-d np.nditer/np.nested_iter support


  Commit: 610faef24ae57bfb9e9e7f95179e1e405f4c9f0d
      https://github.com/numpy/numpy/commit/610faef24ae57bfb9e9e7f95179e1e405f4c9f0d
  Author: Sebastian Berg <sebastian at sipsolutions.net>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M numpy/core/tests/test_einsum.py

  Log Message:
  -----------
  TST: Add test that einsum multiplies scalars fine


  Commit: 22e1fe48db411b28530e2b289d509abc35346e52
      https://github.com/numpy/numpy/commit/22e1fe48db411b28530e2b289d509abc35346e52
  Author: Sebastian Berg <sebastian at sipsolutions.net>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M numpy/lib/index_tricks.py

  Log Message:
  -----------
  MAINT: Remove np.ndindex 0-d hack.


  Commit: b66a15e0985eb809f735fb47e3d0ea6317f86406
      https://github.com/numpy/numpy/commit/b66a15e0985eb809f735fb47e3d0ea6317f86406
  Author: Sebastian Berg <sebastian at sipsolutions.net>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M doc/source/reference/c-api.iterator.rst

  Log Message:
  -----------
  DOC: Add documentation clarifying the use of oa_ndim


  Commit: 20f44efee8eda236b222180f3c0964eb2ca6b5b2
      https://github.com/numpy/numpy/commit/20f44efee8eda236b222180f3c0964eb2ca6b5b2
  Author: Sebastian Berg <sebastian at sipsolutions.net>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

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

  Log Message:
  -----------
  DOC: mention AdvancedNew iterator change in the release notes.


  Commit: aa4d003598e66ff7c8392544d56ecdcc76493133
      https://github.com/numpy/numpy/commit/aa4d003598e66ff7c8392544d56ecdcc76493133
  Author: Sebastian Berg <sebastian at sipsolutions.net>
  Date:   2013-03-03 (Sun, 03 Mar 2013)

  Changed paths:
    M numpy/core/src/umath/ufunc_object.c

  Log Message:
  -----------
  MAINT: Remove 0-d iterator special case from ufunc_object.c


  Commit: d3edb4e84e3630320a3f577a83113f086cc1b563
      https://github.com/numpy/numpy/commit/d3edb4e84e3630320a3f577a83113f086cc1b563
  Author: Charles Harris <charlesr.harris at gmail.com>
  Date:   2013-04-01 (Mon, 01 Apr 2013)

  Changed paths:
    M doc/release/1.8.0-notes.rst
    M doc/source/reference/c-api.iterator.rst
    M numpy/core/src/multiarray/nditer_api.c
    M numpy/core/src/multiarray/nditer_constr.c
    M numpy/core/src/multiarray/nditer_impl.h
    M numpy/core/src/multiarray/nditer_pywrap.c
    M numpy/core/src/private/lowlevel_strided_loops.h
    M numpy/core/src/umath/reduction.c
    M numpy/core/src/umath/ufunc_object.c
    M numpy/core/tests/test_einsum.py
    M numpy/core/tests/test_nditer.py
    M numpy/lib/index_tricks.py

  Log Message:
  -----------
  Merge pull request #3104 from seberg/nditer-allow-0d

Make AdvancedNew iter more 0-d aware


Compare: https://github.com/numpy/numpy/compare/fd6f038b2e00...d3edb4e84e36


More information about the Numpy-svn mailing list