File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1458,6 +1458,7 @@ def show(
14581458 # it's always the second row (after the array)
14591459 type_line = rows .pop (0 )
14601460 out_io .write (type_line )
1461+ out_io .write ("\n " )
14611462
14621463 # the rest of the rows we sort by the length of their '<prefix>:'
14631464 # but we sort it from shortest to longest contrary to _repr_mimebundle_
@@ -2408,6 +2409,7 @@ def show(
24082409 # it's always the second row (after the array)
24092410 type_line = rows .pop (0 )
24102411 out_io .write (type_line )
2412+ out_io .write ("\n " )
24112413
24122414 # the rest of the rows we sort by the length of their '<prefix>:'
24132415 # but we sort it from shortest to longest contrary to _repr_mimebundle_
Original file line number Diff line number Diff line change @@ -487,6 +487,9 @@ def highlevel_array_show_rows(
487487 array .type .show (stream = typeio )
488488 type_line = "type: "
489489 type_line += typeio .getvalue ().removesuffix ("\n " )
490+ # crop type line if too long
491+ if len (type_line ) > limit_cols :
492+ type_line = type_line [: limit_cols - 3 ] + "..."
490493 rows .append (type_line )
491494
492495 # other info
@@ -495,6 +498,9 @@ def highlevel_array_show_rows(
495498 named_axis_line += _prettify_named_axes (
496499 array .named_axis , delimiter = ", " , maxlen = None
497500 )
501+ # crop named axis line if too long
502+ if len (named_axis_line ) > limit_cols :
503+ named_axis_line = named_axis_line [: limit_cols - 3 ] + "..."
498504 rows .append (named_axis_line )
499505 if nbytes :
500506 if array .nbytes is unknown_length :
You can’t perform that action at this time.
0 commit comments