Example 1 - Axis summarization
array([[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0]], dtype=uint8)
Example 2 - Padding
array([[255, 255, 255, 255, 255, 255],
[255, 255, 255, 255, 255, 255],
[255, 255, 50, 50, 255, 255],
[0, 0, 50, 50, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0]], dtype=uint8)
Describe the bug
Calling
print(my_array)often does not match standard NumPy output. Multi-dimensional arrays also only summarized (inserted...when the axis is long) along one axis; all other axes get fully printed, resulting in the REPL getting flooded with numbers if a large multi-dimensional array is printed. And there is no padding to align elements, so it can be hard to see what column an element is aligned withulabversion:6.8.0-4D-cTo Reproduce
Some examples:
Expected behavior
Actual behavior
Additional context
There are other minor discrepancies, like ulab wrapping arrays with
array(..., dtype=...)and ulab including parentheses when standard NumPy does not. Although I don't think the print output necessarily needs to be identical to standard NumPy (that would be great!), it would be a lot nicer if summarization worked along all axes, and if padding was added for alignment elements.