Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2016

Conversation

charris
Copy link
Member

@charris charris commented May 23, 2016

Backport #7658

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.

Ref numpy#7621. numpy#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.
@charris charris added 00 - Bug component: numpy.ma masked arrays 08 - Backport Used to tag backport PRs labels May 23, 2016
@charris charris added this to the 1.11.1 release milestone May 23, 2016
@charris charris merged commit 55b2b8f into numpy:maintenance/1.11.x May 23, 2016
@charris charris deleted the backport-7658 branch May 23, 2016 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug 08 - Backport Used to tag backport PRs component: numpy.ma masked arrays
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants