bugGNU Octave - Bugs: bug #46603, add or document a way to determine...

 
 

bug #46603: add or document a way to determine whether format is "compact" or "loose"

Submitter:  Mike Miller <mtmiller>
Submitted:  Fri 04 Dec 2015 04:38:00 PM UTC
   
 
Category:  Interpreter Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 30 Dec 2016 12:42:15 AM UTC, comment #11: 
Mike Miller <mtmiller>
Group Member
Tue 05 Jan 2016 12:11:01 AM UTC, comment #10: 

Unofficial response from a rep is that Matlab currently has no alternative way to query those properties, so the get(0,property) form will continue to work for them until an alternative becomes available.

My suggestion is we leave this in until someone reports it as an incomparability with a current version of MATLAB, and then debate whether to deprecate or not.

Nicholas Jankowski <nrjank>
Group Member
Thu 10 Dec 2015 08:14:18 PM UTC, comment #9: 

FTR, just installed Matlab r2016a prerelease and tried:

>> format compact
>> isoctave
ans =
     0
>> ver
----------------------------------------------------------------------------------------------------
MATLAB Version: 9.0.0.307022 (R2016a) Prerelease
<snip>

>> get (0, 'FormatSpacing')
ans =
compact
>> get (0, 'Format')
ans =
short
>>


On Matlab's format reference documentation page (http://nl.mathworks.com/help/matlab/ref/format.html), the above calls are clearly referenced w/o any mention of deprecation.

Apparently TMW's release notes team and web page contents team could improve their mutual communication :-)

Philip Nienhuis <philipnienhuis>
Group Member
Tue 08 Dec 2015 06:20:11 AM UTC, comment #8: 

Seems better to me to either modify format to return this information or create a separate function that can do it.

John W. Eaton <jwe>
Group administrator
Fri 04 Dec 2015 09:22:36 PM UTC, comment #7: 

Agreed, it is odd. I guess get(0) stores a bunch of info for the command window, and they stuck the Format property in there... The release notes mention they're pulling a lot of that stuff, and to 'use proper root properties instead'.  but no mention of it on the Root Properties help page, either the current one or the 2014 page that the release notes link to.

can it be documented or implemented with a warning that deprecation 'is imminent... at the will of Mathworks'?  it's not quite 'undocumented'...

Nicholas Jankowski <nrjank>
Group Member
Fri 04 Dec 2015 08:50:33 PM UTC, comment #6: 

The release notes clearly say that those things are no longer root figure properties.  Plus, that is just a weird place to store this info.

John W. Eaton <jwe>
Group administrator
Fri 04 Dec 2015 08:50:00 PM UTC, comment #5: 

Sorry for any confusion. The "Format" and "FormatSpacing" properties are both still in 4.0, I was wrong there, it's in the default branch that will become 4.2 that they have been removed.

I agree, the properties are still listed on Matlab's help for format, but not in the help for get, and not listed when get() is called with no arguments.

Maybe consensus is too strong, the bugs were marked as won't fix without much objection and haven't been reopened.

So should we revert that change, keep those properties, and document them in the help for format and get?

Mike Miller <mtmiller>
Group Member
Fri 04 Dec 2015 08:27:57 PM UTC, comment #4: 

ok, I just read the linked bugs.  Both of those commands are listed on the Matlab help page for format [1], and I don't see any notes there about planned deprecation or anything.  Just tried in Matlab 2015a and both do work. So, Matlab does have a documented method of getting the current settings, and that method works in Octave... do we just need to document it here?

[1] http://www.mathworks.com/help/matlab/ref/format.html


Nicholas Jankowski <nrjank>
Group Member
Fri 04 Dec 2015 08:22:07 PM UTC, comment #3: 

I was wondering about compatibility, so checked if Matlab has a method to query current format.  apparently


get(0,'Format')

and

get(0,'FormatSpacing')


work there. Tried it in Octave 4.0.0 (Windows) and they both worked fine. Or am I misunderstanding what you were looking for?

Nicholas Jankowski <nrjank>
Group Member
Fri 04 Dec 2015 08:16:25 PM UTC, comment #2: 

Hmmm, I coudn't sense much consensus in bug #46034 and bug #46000; if any, it would be merely that Format and FormatSpacing were still around in contemporary Matlab as root properties that can be queried,

I didn't know about _compactformat_(), but just noted that it is able to query the FormatSpacing status. Calling it directly seems less of a hack than Kai's suggestion (that as I read it, is for Format rather than FormatSpacing). A thin wrapper around it wouldn't hurt I suppose.

FWIW I do use "format compact" at times in Octave (I've put the FormatSpacing property back into my own builds) and at work it is in my Matlab (r2014a) startup file.

Philip Nienhuis <philipnienhuis>
Group Member
Fri 04 Dec 2015 05:12:51 PM UTC, comment #1: 

That should be bug #46000 and bug #46034.

Mike Miller <mtmiller>
Group Member
Fri 04 Dec 2015 04:38:00 PM UTC, original submission:  

The "format" command allows selecting between "compact" and "loose" as in Matlab, but there is no documented way to determine what the current setting is. Compiled code can use the global variable "Vcompact_format".

In 3.8 and earlier versions, the root handle property "FormatSpacing" could be queried, but this has been removed in version 4.0 since it became deprecated in recent versions of Matlab. In bug #46000 and bug #46599, the consensus seems to be to keep that property out of Octave from now on.

There is an undocumented internal function called "__compactformat__" that was added in 4.0, but this probably shouldn't be relied on either. It doesn't seem to be used anywhere. But thanks to me it is now used by the Forge symbolic package.

Should there be a documented way to query the current compact vs loose format setting? Should it be a new dedicated function? Or should it be a hack as suggested by Kai in bug #46000?

Mike Miller <mtmiller>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by mtmiller (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-30 mtmiller StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2016-01-04 siko1056 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code