bugGNU Octave - Bugs: bug #56690, gui: variable editor should...

 
 

bug #56690: gui: variable editor should support display of lazy_index

Submitter:  Mike Miller <mtmiller>
Submitted:  Sun 28 Jul 2019 07:28:01 PM UTC
   
 
Category:  GUI Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Release: 
Operating System:  * Any Fixed Release:  10.1.0
Planned Release:  10.1.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 24 Jan 2025 02:26:39 PM UTC, comment #12: 

Thank you for pushing that fix.
The affected variables are displayed correctly in the variable editor for me now.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Fri 24 Jan 2025 03:37:12 AM UTC, comment #11: 

I pushed the following changeset:

https://hg.savannah.gnu.org/hgweb/octave/rev/9e9f68f41770

Marking as ready for test.

John W. Eaton <jwe>
Group administrator
Tue 21 Jan 2025 12:30:06 PM UTC, comment #10: 

[OT, yet correcting s/th minor]

In response to comment #5:
Savannah bug no. 111167 turned out to be for savannah.nongnu.org/support/ rather than savannah.gnu.org/bug/ to which my somewhat naive bug reference in comment #5 got expanded.
Proper URL is:
https://savannah.nongnu.org/support/?111167

Philip Nienhuis <philipnienhuis>
Group Member
Tue 21 Jan 2025 11:19:32 AM UTC, comment #9: 

@jwe: Your proposed change in comment #6 looks good to me.
Would you like to add a commit message and push?

Markus Mützel <mmuetzel>
Group administrator
Wed 01 Jan 2025 04:17:03 PM UTC, comment #8: 

Works OK in Windows as well.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 01 Jan 2025 11:34:00 AM UTC, comment #7: 

Thanks for the patch, building now.

IIRC the previous patch (from 2019; see also patch #9854) had side-issues but I cannot remember what it was.

Update: a few simple tests work fine on Linux, will build for Windows soon.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 31 Dec 2024 01:57:58 PM UTC, comment #6: 

Try this change:


diff --git a/libinterp/octave-value/ov-lazy-idx.h b/libinterp/octave-value/ov-lazy-idx.h
--- a/libinterp/octave-value/ov-lazy-idx.h
+++ b/libinterp/octave-value/ov-lazy-idx.h
@@ -143,6 +143,10 @@ public:
   void print (std::ostream& os, bool pr_as_read_syntax = false)
   { make_value ().print (os, pr_as_read_syntax); }

+  std::string edit_display (const float_display_format& fmt,
+                            octave_idx_type i, octave_idx_type j) const
+  { return make_value ().edit_display (fmt, i, j); }
+
   void print_info (std::ostream& os, const std::string& prefix) const
   { make_value ().print_info (os, prefix); }


The patch posted previously might also work but the change above seems simpler and is also consistent with the way the other functions in the lazy index class work by just converting and forwarding.

John W. Eaton <jwe>
Group administrator
Tue 31 Dec 2024 10:18:43 AM UTC, comment #5: 

Savannah download bug #111167 has been fixed in less than 12 hours :-)
download works again.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 30 Dec 2024 11:53:33 PM UTC, comment #4: 

In turn I came here from bug #66577.

I couldn't download the attached patch, I guess because of a hash in the file name. I entered a bug report for that:
https://savannah.nongnu.org/support/index.php?111167

I might have that patch on my other box at home, I can check Jan. 2nd at the earliest.

Philip Nienhuis <philipnienhuis>
Group Member
Fri 09 Sep 2022 06:10:42 AM UTC, comment #3: 

I'm coming here from bug #63025.

It seems reasonable to me to allow display of lazy index values.  Editing them already works but may convert them to matrix objects.   Something similar already happens with diagonal and permutation matrices.  For example:


[u, s, v] = svd (rand (4))
typeinfo (s)  ## returns "diagonal matrix"
openvar s
## edit an element on the diagonal
typeinfo (s)  ## still returns "diagonal matrix"
## edit an element NOT on the diagonal
typeinfo (s)  ## now returns "matrix"


If I remember correctly, this works because the variable editor is just executing indexing commands that would have the same effect if they were executed at the command line.

Also note that if you do


a = [1,2,3,4];
y = find (a > 2);
openvar y


and then change one of the elements that is displayed as "#VAL" in the variable editor so that the type of the object changes from "lazy_index" to "matrix", the array values will appear in the editor because elements of "matrix" objects can be displayed in the variable editor.

Can someone update the provided patch so that it applies to the current sources?  If not, I can try to take a look at doing that.

John W. Eaton <jwe>
Group administrator
Tue 10 Sep 2019 04:49:25 PM UTC, comment #2: 

Hi - I would like to submit a patch for this issue: please see file 'suggested_fix_for_bug_#56690.patch'. Thanks.

ImadES <ies>
Tue 20 Aug 2019 10:53:04 PM UTC, comment #1: 

A fix for this is likely to look like d2467914ce33, adding the appropriate methods to the octave_lazy_index type. This would be a good small task for a new contributor familiar with C++.

Mike Miller <mtmiller>
Group Member
Sun 28 Jul 2019 07:28:01 PM UTC, original submission:  

The `lazy_index` type isn't handled by the variable editor, it shows `#VAL` for each element.

Example


x = rand (10, 1);
[y, idx] = sort (x);
openvar idx


Originally reported at https://github.com/flathub/org.octave.Octave/issues/71

Mike Miller <mtmiller>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by ies (Posted a comment)
  •  

    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 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-01-24 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2025-01-24 jwe StatusPatch Submitted Ready For Test
        Fixed ReleaseNone 10.1.0
        Planned ReleaseNone 10.1.0
    2025-01-01 philipnienhuis Operating SystemGNU/Linux Any
    2024-12-30 philipnienhuis Dependencies- bugs #66577 is dependent
    2019-09-13 mtmiller StatusConfirmed Patch Submitted
    2019-09-13 mtmiller Dependencies- patch #9854 is dependent
    2019-09-10 ies Attached File- Added suggested_fix_for_bug_#56690.patch, #47477
    2019-08-20 mtmiller Priority5 - Normal 3 - Low
    2019-07-28 mtmiller Carbon-CopyRemoved 80942 -

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code