octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Experimental matrix editor patch


From: PhilipNienhuis
Subject: Re: Experimental matrix editor patch
Date: Sun, 5 May 2013 10:57:34 -0700 (PDT)

John W. Eaton wrote
> I've uploaded a patch to implement an experimental spreadsheet-like
> matrix editor for the GUI here:
> 
>    https://savannah.gnu.org/patch/index.php?8039
> 
> This is a very bare-bones proof-of-concept implementation.

Thank you for this development. 
I have played a bit with the last few days.


> <snip>
> There are many things left to do, and many decisions to be made about
> what exactly we would want from something like this.  For example,
> 
>   * it currently only handles double precision values (should we be
>     able to edit arbitrary Octave data structures, or just numeric
>     data?)

2D cell arrays (incl. mixed cell arrays) and char arrays would be an obvious
next step. With that in place most of my own needs would be served.

More complicated data types:
- ND arrays,
- Struct arrays,
and especially:
- Nested arrays (e.g., cell arrays in structs, or double arrays in cells),
- (once classdef is working OK:) Data objects
would probably need some clever data slicing strategy to make them amenable
for editing in some 2D view.


>   * it doesn't preserve full precision (moving data in and out is done
>     by converting to/from text)

Preserving full precision can probably only be done with copy-paste
operations. Until that is (ever) implemented, I see little problem in
conversion from/to text.

How does Matlab handle this?


>   * resizing the matrix isn't possible
> 
>   * inserting rows or columns isn't possible
> 
>   * applying functions or performing arithmetic on the data (or
>     regions) is not possible
> 
>   * editing is possible, but normal spreadsheet operations like filling
>     a region is not possible

For those functions, spreadsheets are much better suited. Why duplicate that
in Octave?

With the spreadsheet I/O functions in the OF io package it is very easy to
delegate more involved data surgery to programs that are meant to do just
that. (Just write data in question to file, process them, read back from
file.) 
Even w/o io package, csvwrite and csvread can help here.

My POV is that a variable editor is primarily useful when debugging scripts
and m-files.
It also makes for much handier inspection of 2D data than displaying it in
the terminal (no clobbering up of the terminal window).


>   * you are not prevented from inserting non-numeric data
> 
>   * things like "Inf" and "NaN" aren't recognized
> 
>   * only 2D arrays are handled properly
> 
>   * only one variable may be edited at a time (I guess we could use a
>     tabbed editor, or some other way of managing multiple matrix edit
>     windows)

Indeed, a tabbed data editor would be very handy.


>   * we don't keep track of the original scope of the variable, so if
>     you start editing a variable, then use the debugger and step into a
>     function, then click "done" in the matrix editor, the variable will
>     be inserted into the current scope, which is the one the debugger
>     is visiting
> 
>   * and many other things, I'm sure...

... like updating variable values after commands in the terminal are
finished.

The patch as it stands prohibits editing scalar variables (in an MXE build).


> So clearly this patch is not ready to be committed, but I wanted to
> see if I could get a relatively simple structure in place for doing
> this job.

IMO with that "relatively simple structure" you've already accomplished the
larger part of a very useful add-on.

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Experimental-matrix-editor-patch-tp4652536p4652647.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]