8000 Extra space in printout of arrays with long items · Issue #10181 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
8000

Extra space in printout of arrays with long items #10181

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

Closed
eric-wieser opened this issue Dec 9, 2017 · 3 comments
Closed

Extra space in printout of arrays with long items #10181

eric-wieser opened this issue Dec 9, 2017 · 3 comments

Comments

@eric-wieser
Copy link
Member

Looks like we missed one - oops:

>>> a = np.zeros(1, 'V20')
array([ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
       b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'],
      dtype='|V20')
@eric-wieser eric-wieser added this to the 1.14.0 release milestone Dec 9, 2017
@eric-wieser
Copy link
Member Author
eric-wieser commented Dec 9, 2017

Cause here is line-wrapping trying to wrap before the first element, and then .rstrip() erroneously consuming a newline.

@seberg
Copy link
Member
seberg commented Dec 9, 2017

Btw. random throwing in, but I wondered about it a bit ago, does this bother anyone (i.e. should it switch to breaking the first line and indenting only a few spaces?):

In [1]: class MyVeryLongNamedSubclassOfNDArray(np.ndarray):
   ...:     pass
   ...: 

In [2]: arr = np.arange(50)
In [3]: arr = np.arange(50).view(MyVeryLongNamedSubclassOfNDArray)
In [4]: arr
Out[4]: 
MyVeryLongNamedSubclassOfNDArray([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
                                  10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
                                  20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
                                  30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
                                  40, 41, 42, 43, 44, 45, 46, 47, 48, 49])

With absurdly long names things get a bit wonky, not sure it bothers me or not though.

@eric-wieser
Copy link
Member Author

@seberg: do you want to open a new issue about that, so it's not lost to time?

guyer added a commit to guyer/fipy that referenced this issue Jan 16, 2018
numpy 1.14 [changed the print formatting of arrays](numpy/numpy#10181)
which breaks our doctests
< 5CBC div class="TimelineItem" >
guyer added a commit to guyer/fipy that referenced this issue Jan 17, 2018
numpy 1.14 [changed the print formatting of arrays](numpy/numpy#10181)
which breaks our doctests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0