[Numpy-svn] [numpy/numpy] 7ce655: BUG: fix incorrect printing of 1D masked arrays

GitHub noreply at github.com
Mon May 23 18:54:52 EDT 2016


  Branch: refs/heads/maintenance/1.11.x
  Home:   https://github.com/numpy/numpy
  Commit: 7ce6556a4c9cc4b27dbb5ace66f530ece2c205d1
      https://github.com/numpy/numpy/commit/7ce6556a4c9cc4b27dbb5ace66f530ece2c205d1
  Author: Simon Conseil <contact at saimon.org>
  Date:   2016-05-23 (Mon, 23 May 2016)

  Changed paths:
    M numpy/ma/core.py
    M numpy/ma/tests/test_core.py

  Log Message:
  -----------
  BUG: fix incorrect printing of 1D masked arrays

Ref #7621. #6748 added `np.ma.MaskedArray._print_width` which is used to cut
a masked array before printing it (to save memory and cpu time during the
conversion to the object dtype). But this doesn't work correctly for 1D arrays,
for which up to 1000 values can be printed before cutting the array.

So this commit adds a new class variable `_print_width_1d` to handle the 1D case
separately.


  Commit: 55b2b8f1f06717b061c221cb31235d7b33d0bcf0
      https://github.com/numpy/numpy/commit/55b2b8f1f06717b061c221cb31235d7b33d0bcf0
  Author: Charles Harris <charlesr.harris at gmail.com>
  Date:   2016-05-23 (Mon, 23 May 2016)

  Changed paths:
    M numpy/ma/core.py
    M numpy/ma/tests/test_core.py

  Log Message:
  -----------
  Merge pull request #7665 from charris/backport-7658

Backport 7658, BUG: fix incorrect printing of 1D masked arrays


Compare: https://github.com/numpy/numpy/compare/693bead140fc...55b2b8f1f067


More information about the Numpy-svn mailing list