Skip to content

BUG/TST: Fix for #6729 #6733

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

Conversation

gerritholl
Copy link
Contributor

Fix representation of a structured masked array with dimension zero.
The effect of representing a masked array with dimension zero is now
similar to respresenting an mvoid. This commit fixes #6729.

@charris
Copy link
Member

charris commented Dec 1, 2015

What does repr print like?

@gerritholl
Copy link
Contributor Author

@charris

In [8]: print(str(arm))
(0, [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], 0.0)

In [9]: print(repr(arm))
masked_array(data = (0, [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], 0.0),
             mask = (False, [[False, False, False], [False, False, False]], False),
       fill_value = (999999, [[1e+20, 1e+20, 1e+20], [1e+20, 1e+20, 1e+20]], 1e+20),
            dtype = [('f0', '<i8'), ('f1', '<f8', (2, 3)), ('f2', '<f8')])

In [12]: arm.mask["f1"][0,1]=True

In [13]: print(repr(arm))
masked_array(data = (0, [[0.0, --, 0.0], [0.0, 0.0, 0.0]], 0.0),
             mask = (False, [[False, True, False], [False, False, False]], False),
       fill_value = (999999, [[1e+20, 1e+20, 1e+20], [1e+20, 1e+20, 1e+20]], 1e+20),
            dtype = [('f0', '<i8'), ('f1', '<f8', (2, 3)), ('f2', '<f8')])

Fix representation of a structured masked array with dimension zero.
The effect of representing a masked array with dimension zero is now
similar to respresenting an mvoid.  This commit fixes numpy#6729.
@gerritholl gerritholl force-pushed the structured_multidim_masked_array_strrep branch from 5740f38 to d07e20e Compare December 1, 2015 14:08
@charris
Copy link
Member

charris commented Dec 1, 2015

OK, just wanted to make sure. LGTM, thanks @gerritholl .

charris added a commit that referenced this pull request Dec 1, 2015
@charris charris merged commit 433e669 into numpy:master Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String representation of exotic masked structured arrays with ndim=0 fails with ValueError
2 participants