bugGNU Octave - Bugs: bug #65637, `short_disp` doesn't show ellipsis...

 
 

bug #65637: `short_disp` doesn't show ellipsis at end of long arrays

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Wed 24 Apr 2024 05:22:56 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Ready For Test Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  10.1.0 (current default)
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 17 May 2024 01:16:16 PM UTC, comment #6: 

I went ahead, added a commit message, and pushed your patch to the default branch:
https://hg.savannah.gnu.org/hgweb/octave/rev/976638dd9021

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Thu 25 Apr 2024 03:53:02 PM UTC, comment #5: 

I agree. It looks nicer with your changes.

I tested with your example classdef. The output looks nice and much more informative that before.
A also checked with a series of short and long variables of different types and how they are display in the "Value" column of the workspace panel in the GUI. That also looks good to me.

I don't have any strong feelings of whether this should go on the default or stable branch (maybe slightly leaning towards the default branch now).

Markus Mützel <mmuetzel>
Group administrator
Wed 24 Apr 2024 07:24:13 PM UTC, comment #4: 

I don't think your latest change is the right thing for printing "]".  Maybe the attached change instead?  But now this is not such a trivial change and I'm not sure of the best way to indicate that a character array has been truncated.

I tested with


classdef boolmxcls
  properties
    x01 = reshape (1:9, 1, 9);
    x02 = reshape (1:10, 1, 10);
    x03 = reshape (1:11, 1, 11);
    x04 = reshape (1:8, 2, 4)';
    x05 = reshape (1:10, 2, 5)';
    x06 = reshape (1:12, 2, 6)';
    x07 = reshape (1:9, 9, 1);
    x08 = reshape (1:10, 10, 1);
    x09 = reshape (1:11, 11, 1);
    x10 = reshape (1:8, 4, 2)';
    x11 = reshape (1:10, 5, 2)';
    x12 = reshape (1:12, 6, 2)';
    x20 = @sin;
    x21 = 13;
    x22 = {1, 2, 3, "foobar"};
    x23 = 1:2:200;
    x24 = struct ('a', {1, 2, 3}, 'b', {4, 5, 6});
    x25 = "this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string this is a very long string";
  endproperties
endclassdef



(file #55971)

John W. Eaton <jwe>
Group administrator
Wed 24 Apr 2024 05:41:21 PM UTC, comment #3: 

Good point. An updated patch is attached.

The changes are pretty minor and might avoid confusion for some users. Is it worth applying them on the stable branch? (It doesn't fix any real issue. Just a cosmetic change...)


(file #55970)

Markus Mützel <mmuetzel>
Group administrator
Wed 24 Apr 2024 05:37:25 PM UTC, comment #2: 

Maybe it should also add a final "]" character so that it displays


[1 2 3 ...]


instead of


[1 2 3 ...


?

John W. Eaton <jwe>
Group administrator
Wed 24 Apr 2024 05:27:43 PM UTC, comment #1: 

The attached patch adds three dots if some elements aren't shown in the output of `short_disp`.


(file #55969)

Markus Mützel <mmuetzel>
Group administrator
Wed 24 Apr 2024 05:22:56 PM UTC, original submission:  

As noted in bug #62432, `short_disp` doesn't indicate that an array was truncated when it has more than a (hard-coded) number of elements.

It would probably ideal if `short_disp`

  • would append an ellipsis to truncated arrays,
  • had a configurable number of maximum elements to display,
  • had a notion of line length of the console output.


I have a patch for the first item almost ready.

Markus Mützel <mmuetzel>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mmuetzel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-05-17 mmuetzel StatusPatch Submitted Ready For Test
        Planned ReleaseNone 10.1.0 (current default)
    2024-04-29 rik5 StatusNone Patch Submitted
    2024-04-24 jwe Attached File- Added bug65637-short_disp-ellipsis-v3.patch, #55971
    2024-04-24 mmuetzel Attached File- Added bug65637-short_disp-ellipsis-v2.patch, #55970
    2024-04-24 mmuetzel Attached File- Added bug65637-short_disp-ellipsis.patch, #55969

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code