bugGNU Octave - Bugs: bug #50327, New graphics properties...

 
 

bug #50327: New graphics properties deprecation mechanism

Submitter:  Pantxo Diribarne <pantxo>
Submitted:  Thu 16 Feb 2017 01:13:49 PM UTC
   
 
Category:  Plotting 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 24 Mar 2017 05:22:06 PM UTC, comment #14: 

Changing status to fixed.

Avinoam Kalma <avinoam>
Group Member
Mon 13 Mar 2017 12:07:30 AM UTC, comment #13: 

Great.  I pushed your patch here http://hg.savannah.gnu.org/hgweb/octave/rev/a921b6b772f3.

In the process I found a bug with clf ("reset") and FLTK which I will file separately.

Rik <rik5>
Group administrator
Sun 12 Mar 2017 08:51:57 PM UTC, comment #12: 

I attached a patch.

(file #39983)

Pantxo Diribarne <pantxo>
Group Member
Sun 12 Mar 2017 06:22:25 AM UTC, comment #11: 

Actually, it can be any toolkit.

Rik <rik5>
Group administrator
Sun 12 Mar 2017 06:20:24 AM UTC, comment #10: 

I'm re-opening the bug report.  With the gnuplot toolkit I get warnings whenever reset is used explicitly.

Sample Code:


close all
graphics_toolkit gnuplot
figure
clf ("reset")



warning: 'doublebuffer' is deprecated and will be removed from a future version of Octave
warning: called from
    clf at line 75 column 5
warning: 'mincolormap' is deprecated and will be removed from a future version of Octave
warning: called from
    clf at line 75 column 5
warning: 'wvisual' is deprecated and will be removed from a future version of Octave
warning: called from
    clf at line 75 column 5
warning: 'wvisualmode' is deprecated and will be removed from a future version of Octave
warning: called from
    clf at line 75 column 5
warning: 'xdisplay' is deprecated and will be removed from a future version of Octave
warning: called from
    clf at line 75 column 5
warning: 'xvisual' is deprecated and will be removed from a future version of Octave
warning: called from
    clf at line 75 column 5
warning: 'xvisualmode' is deprecated and will be removed from a future version of Octave
warning: called from
    clf at line 75 column 5


Here is another example.


octave:4> reset (gcf)
warning: 'doublebuffer' is deprecated and will be removed from a future version of Octave
warning: 'mincolormap' is deprecated and will be removed from a future version of Octave
warning: 'wvisual' is deprecated and will be removed from a future version of Octave
warning: 'wvisualmode' is deprecated and will be removed from a future version of Octave
warning: 'xdisplay' is deprecated and will be removed from a future version of Octave
warning: 'xvisual' is deprecated and will be removed from a future version of Octave
warning: 'xvisualmode' is deprecated and will be removed from a future version of Octave



Rik <rik5>
Group administrator
Thu 23 Feb 2017 06:44:40 PM UTC, comment #9: 

I finally opted for disabling warnings directly in F__get__:

http://hg.savannah.gnu.org/hgweb/octave/rev/a88575e87481

Pantxo Diribarne <pantxo>
Group Member
Wed 22 Feb 2017 05:56:04 PM UTC, comment #8: 

I just noticed that when using gnuplot graphics toolkit we get a warning each time an axes is redrawn:


warning: 'drawmode' is deprecated and will be removed from a future version of Octave
warning: called from
    __gnuplot_draw_axes__ at line 32 column 14
    __gnuplot_draw_figure__ at line 172 column 17
    __gnuplot_drawnow__ at line 86 column 5


This is because _gnuplot_draw_axes_ uses the special "__get__" function to obtain hidden properties, which triggers the warning.
It seems to be in one place only so silencing the warning there should be enough. I'll prepare a cset ASAP

Pantxo Diribarne <pantxo>
Group Member
Mon 20 Feb 2017 05:30:50 AM UTC, comment #7: 

I pushed the patch here http://hg.savannah.gnu.org/hgweb/octave/rev/5d9d756724cc.  Re-closing report.

Rik <rik5>
Group administrator
Sun 19 Feb 2017 08:23:59 PM UTC, comment #6: 

Confirmed. I attached a patch in which I disabled the warning as suggested by Markus.

(file #39793)

Pantxo Diribarne <pantxo>
Group Member
Sun 19 Feb 2017 06:53:43 PM UTC, comment #5: 

"test imshow" now fails. The actual issue originates in reset where the deprecated properties raise a warning when they are set to their default value (graphics.cc @ line 5001).
Maybe that could be solved by turning that particular warning off at the beginning of the reset function and re-setting it to its previous setting afterwards (@ around line 10228).
Re-opening for this issue.

Markus Mützel <mmuetzel>
Group administrator
Sun 19 Feb 2017 01:04:05 AM UTC, comment #4: 

I pushed your patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/239a9fed80de).  Only two small changes, in the .tst file I used '##' rather than '%%' to start comment lines and I found there were some lines that were missing semicolons.

Thanks.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Fri 17 Feb 2017 12:15:53 PM UTC, comment #3: 

May I push the patch?

Pantxo Diribarne <pantxo>
Group Member
Thu 16 Feb 2017 05:16:07 PM UTC, comment #2: 


>> How does Matlab handle this?


I don't really know but I am under the impression (see comments in bug #50227) that they first hide the property, eventually announce the change in the release notes (not sure), and remove it later if needed.

I think the addition of a warning is much cle

Pantxo Diribarne <pantxo>
Group Member
Thu 16 Feb 2017 04:21:43 PM UTC, comment #1: 

Deprecation is definitely a nice way to handle obsolescence.  How does Matlab handle this?  Do they just remove properties, and then people fix their scripts when Matlab produces an error?

Rik <rik5>
Group administrator
Thu 16 Feb 2017 01:13:49 PM UTC, original submission:  

We currently don't have a way to deprecate properties as we do for built-in functions.

The attached patch is a first attempt to do so:

  • add a way to mark a property as deprecated (new "d" flag for genprop.awk) so that users are automatically warned when they us it
  • add a .tst file in which we can check that a given property has disappeared from a given version.
Pantxo Diribarne <pantxo>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #39983:  silence_deprecated2.patch added by pantxo (4KiB - text/x-patch)
file #39793:  nodeprec.patch added by pantxo (3KiB - application/x-download)
file #39763:  deprecate2.patch added by pantxo (10KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (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 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-03-24 avinoam StatusPatch Submitted Fixed
    2017-03-12 pantxo Attached File- Added silence_deprecated2.patch, #39983
        StatusConfirmed Patch Submitted
    2017-03-12 rik5 StatusFixed Confirmed
    2017-02-20 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2017-02-19 pantxo Attached File- Added nodeprec.patch, #39793
    2017-02-19 mmuetzel StatusFixed In Progress
        Open/ClosedClosed Open
    2017-02-19 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2017-02-16 pantxo Severity3 - Normal 1 - Wish
    2017-02-16 pantxo Attached File- Added deprecate2.patch, #39763

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code