Repository navigation
BUG: do not change size 0 description when viewing data - #8971
Conversation
|
Looks good to me, Probably should test the |
0958146 to
3187457
Compare
|
added a test |
3187457 to
ff1b5c0
Compare
There was a problem hiding this comment.
Can we add a assert_equal(xx.ravel().dtype, xx.dtype) too?
There was a problem hiding this comment.
ravel makes a copy here which converts it to 'S1'
There was a problem hiding this comment.
added a test with a simple indexing view
There was a problem hiding this comment.
Are you sure ravel makes a copy? I've found a bunch of places with zeros-sized items that it returns a view, and generally does the right thing.
Either way, the indexing tests the right thing, so no changes needed.
ff1b5c0 to
2103ab1
Compare
There was a problem hiding this comment.
How about eval(repr_str, dict(array=np.array))? I don't think you need any of the line-mangling either
There was a problem hiding this comment.
indeed that is nicer, thanks
|
@juliantaylor Needs release note. |
|
this is a bugfix, no release notes needed |
If the array being viewed is a zero sized array, e.g. 'S0' from structured types, do not change the description to itemsize 1 as this would expose uninitialized data, e.g. in TestStructured.test_zero_width_string
2103ab1 to
6373dc0
Compare
|
My bad, no release note needed. Merged, thanks @juliantaylor @eric-wieser . |
If the array being viewed is a zero sized array, e.g. 'S0' from
structured types, do not change the description to itemsize 1 as this
would expose uninitialized data, e.g. in
TestStructured.test_zero_width_string
See also #6430