bugGNU Octave - Bugs: bug #46034, Undo some changes from Changeset...

 
 

bug #46034: Undo some changes from Changeset 564e59f75ef8

Submitter:  Kai Torben Ohlhus <siko1056>
Submitted:  Wed 23 Sep 2015 09:05:13 AM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Duplicate Assigned to:  siko1056
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

Thu 12 Jan 2017 10:19:28 PM UTC, comment #12: 

For the record, Symbolic now uses the new "[format, formatspacing] = format()" call [1] and it works great---thanks.

[1] https://github.com/cbm755/octsympy/commit/deeca1c883bf471a6bde922a8710b7eb6ccdfd06

Colin Macdonald <cbm>
Thu 29 Dec 2016 11:34:26 PM UTC, comment #11: 

Since Matlab no longer "officially" supports this syntax I think it is okay to be different.  Early on TMW made some bad architectural decisions.  They couldn't figure out where to locate various user preferences so they put them in to the root figure, into the userdata property of graphics objects, and eventualy into the addpref mechanism.  I've changed format() and diary() to be sensible and return the current state if called with no arguments.  It is on my list to transform any other properties stored in the root figure in the same manner.

Rik <rik5>
Group administrator
Thu 29 Dec 2016 09:50:39 PM UTC, comment #10: 

Thanks, I just missed comment #9 when I made up a new bug report.
This does work.

We're also deliberately Matlab-incompatible. But as I stated elsewhere TMW doesn't seem to have made up their mind as to really deprecating & removing the relevant root properties query mechanisms.

Philip Nienhuis <philipnienhuis>
Group Member
Thu 29 Dec 2016 04:56:30 PM UTC, comment #9: 

In Octave, these properties are now available from the format() function.  Try 'help format' on the dev branch.

Usage:


[FORMAT, FORMATSPACING] = format
FORMAT =

short

FORMATSPACING =

loose


This won't help for stable unless the change I made in this cset from a few weeks ago is backported.


changeset:   22881:f84aa17075d4
user:        Rik <rik@octave.org>
date:        Sun Dec 11 20:33:24 2016 -0800
summary:     Add Octave-only query mode for format command to find status.



Rik <rik5>
Group administrator
Thu 29 Dec 2016 01:45:05 PM UTC, comment #8: 

In Matlab 2017a prerelease:

>> get (0, 'format')

ans =

    'short'

>> get (0, 'formatspacing')

ans =

    'loose'

>> ver
----------------------------------------------------------------------------------------------------
MATLAB Version: 9.2.0.494151 (R2017a) Prerelease
MATLAB License Number: Prerelease


I hit this when trying the symbolic package (sym-py-bundle 2.4.0) that complains about missing _compactformat_.
The fix in symbolic/@syms/display.m still depends on these root properties.

Philip Nienhuis <philipnienhuis>
Group Member
Sat 26 Sep 2015 11:42:52 PM UTC, comment #7: 

It does seem that Matlab is keeping them around. I was
not as careful as I should have been when checking my
2015a system. get(0) does not list them, but


>> get(0,'format')

ans =

short

>> get(0,'formatspacing')

ans =

loose

>>


Michael Godfrey <godfrey>
Group Member
Fri 25 Sep 2015 12:20:07 PM UTC, comment #6: 

Good catch Kai. Confirmed as well on 2015b prerelease.

So Matlab apparently doesn't want to expose those properties to users but perhaps needs it for some undocumented purpose - or maybe plain backward compatibility as you say.

Philip Nienhuis <philipnienhuis>
Group Member
Thu 24 Sep 2015 10:09:55 PM UTC, comment #5: 

They are gone as graphic root properties, but I expect for compatibility issues, they are still supported. On my University System I get the following:


% matlab2015b -nodesktop -nosplash
MATLAB is selecting SOFTWARE OPENGL rendering.

                                                               < M A T L A B (R) >
                                                     Copyright 1984-2015 The MathWorks, Inc.
                                                     R2015b (8.6.0.267246) 64-bit (glnxa64)
                                                                 August 20, 2015


To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.


        This is a Classroom License for instructional use only.
        Research and commercial use is prohibited.

>> get(0)
         CallbackObject: [0x0 GraphicsPlaceholder]
               Children: [0x0 GraphicsPlaceholder]
          CurrentFigure: [0x0 GraphicsPlaceholder]
     FixedWidthFontName: 'Courier New'
       HandleVisibility: 'on'
       MonitorPositions: [1 1 1024 768]
                 Parent: [0x0 GraphicsPlaceholder]
        PointerLocation: [25862 -20384]
            ScreenDepth: 32
    ScreenPixelsPerInch: 72
             ScreenSize: [1 1 1024 768]
      ShowHiddenHandles: 'off'
                    Tag: ''
                   Type: 'root'
                  Units: 'pixels'
               UserData: []

>> get(0,'format')

ans =

short

>> get(0,'formatspacing')

ans =

loose


Kai Torben Ohlhus <siko1056>
Group Member
Thu 24 Sep 2015 04:15:54 PM UTC, comment #4: 

Yep, I see the same in r2015b prerelease.

However, in bug #46000 comment #5 Kai claims that he still found them in r2015b (final release?).

Philip Nienhuis <philipnienhuis>
Group Member
Wed 23 Sep 2015 11:36:41 PM UTC, comment #3: 

I tried matlab R2015a and find that they are gone...


>> get(ppphf)
         CallbackObject: []
               Children: [1x1 Figure]
          CurrentFigure: [1x1 Figure]
     FixedWidthFontName: 'Courier New'
       HandleVisibility: 'on'
       MonitorPositions: [1 1 1920 1080]
                 Parent: []
        PointerLocation: [368 304]
            ScreenDepth: 24
    ScreenPixelsPerInch: 96
             ScreenSize: [1 1 1920 1080]
      ShowHiddenHandles: 'off'
                    Tag: ''
                   Type: 'root'
                  Units: 'pixels'
               UserData: []

>>


Michael Godfrey <godfrey>
Group Member
Wed 23 Sep 2015 12:15:31 PM UTC, comment #2: 

In Matlab r2014a:

>> hf = plot ([0 1])

hf =

  174.0026

>> phf = get (hf, 'Parent')

phf =

  173.0021

>> pphf = get (phf, 'Parent')

pphf =

     1

>> ppphf = get (pphf, 'Parent')

ppphf =

     0

>> get (ppphf)
        CallbackObject = []
        CommandWindowSize = [108 29]
        CurrentFigure = [1]
        Diary = off
        DiaryFile = diary
        Echo = off
        FixedWidthFontName = Courier New
        Format = short
        FormatSpacing = loose
        Language = en_us
        MonitorPositions = [ (2 by 4) double array]
        More = off
        PointerLocation = [1233 166]
        RecursionLimit = [500]
        ScreenDepth = [32]
        ScreenPixelsPerInch = [96]
        ScreenSize = [1 1 1920 1080]
        ShowHiddenHandles = off
        Units = pixels

        BeingDeleted = off
        ButtonDownFcn =
        Children = [1]
        Clipping = on
        CreateFcn =
        DeleteFcn =
        BusyAction = queue
        HandleVisibility = on
        HitTest = on
        Interruptible = on
        Parent = []
        Selected = off
        SelectionHighlight = on
        Tag =
        Type = root
        UIContextMenu = []
        UserData = []
        Visible = on

>>


...so indeed they're still there.
The full output for each step is attached for reference (for if there's discussion about other properties).

At home I can try with r2015b prerelease (if not expired); r2015b is out but I haven't been able to get it installed at work.


(file #34962)

Philip Nienhuis <philipnienhuis>
Group Member
Wed 23 Sep 2015 09:29:18 AM UTC, comment #1: 

This bug depends on bug #46000.  The question asked on that report is which Matlab documentation is correct?  The root properties are not documented to have "Format" and "FormatSpacing".  If someone has access to Matlab and can verify that they still exist in a new version of Matlab then we can re-instate these two properties.

Rik <rik5>
Group administrator
Wed 23 Sep 2015 09:05:13 AM UTC, original submission:  

In changeset http://hg.savannah.gnu.org/hgweb/octave/rev/564e59f75ef8 two graphics root properties:

- format
- formatspacing

have been removed, due to depreciation in MATLAB. According to their documentation https://www.mathworks.com/help/matlab/ref/format.html they still exists without obvious deprecation.

Any obligations in reintroducing these properties again, as I use them via get(0,'formatspacing'). A dirty hack around it for me currently is checking the size of PI

length (int32 (disp (pi)))

Or are there different ways to query for 'compact' or 'loose'?

Regards,
Kai

Kai Torben Ohlhus <siko1056>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #34962:  getParentML.txt added by philipnienhuis (6KiB - text/plain)

 

Depends on the following items

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cbm (Posted a comment)
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by siko1056 (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-09-23 philipnienhuis Attached File- Added getParentML.txt, #34962
    2015-09-23 siko1056 StatusNeed Info Duplicate
        Open/ClosedOpen Closed
    2015-09-23 rik5 Dependencies- Depends on bugs #46000
    2015-09-23 siko1056 Assigned torik5 siko1056

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code