bugGNU Octave - Bugs: bug #62829, "quiet" warning state is...

 
 

bug #62829: "quiet" warning state is undocumented

Submitter:  None
Submitted:  Thu 28 Jul 2022 11:32:56 AM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Need Info Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open 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 28 Jul 2022 03:49:59 PM UTC, comment #6: 

That looks like we should retain the behavior of "quiet" (always ensure that lastwarn gets the data) even with "off", and remove "quiet" as input.

It turns out this is a near-retread of an old bug report from 2013 where the user wanted lastwarn to record it even with "warning off".

Bug #41028

There were some patches listed in that thread but there are some blockers to their adoption that I am not familiar with.

Arun Giridhar <arungiridhar>
Group Member
Thu 28 Jul 2022 03:23:47 PM UTC, comment #5: 

In Matlab R2022a:

>> nchoosek (100, 50)
Warning: Result may not be exact. Coefficient has a maximum relative error of 1.6875e-14, corresponding to absolute error 1702580784238102.
> In nchoosek (line 121)

ans =

   1.0089e+29

>> lastwarn

ans =

    'Result may not be exact. Coefficient has a maximum relative error of 1.6875e-14, corresponding to absolute error 1702580784238102.'

>> lastwarn('test')
>> lastwarn

ans =

    'test'

>> warning off;
>> nchoosek (100, 50)

ans =

   1.0089e+29

>> lastwarn

ans =

    'Result may not be exact. Coefficient has a maximum relative error of 1.6875e-14, corresponding to absolute error 1702580784238102.'

>> lastwarn('test')
>> warning on quiet
Error using warning
Unknown setting or incorrect message identifier 'quiet'.


So, it looks like `warning off` in Matlab behaves like `warning on quiet` in Octave.
Matlab doesn't understand `warning on quiet`.

Markus Mützel <mmuetzel>
Group administrator
Thu 28 Jul 2022 02:40:40 PM UTC, comment #4: 

Could someone test the code in comment #3 on current Matlab to see what it does? (Please use a fresh instance for each test, or clear lastwarn somehow between trials.)

In particular, if Matlab distinguishes between saving it for lastwarn and displaying it on screen, we should emulate that (and "quiet" would become redundant) but if Matlab does the same lumping as Octave, then "quiet" is useful and should be retained.

Arun Giridhar <arungiridhar>
Group Member
Thu 28 Jul 2022 02:35:22 PM UTC, comment #3: 

Here is a demo with Octave 8. Default behavior:

$ octave -f --eval "nchoosek (100, 50), lastwarn"
warning: nchoosek: possible loss of precision
warning: called from
    nchoosek at line 150 column 7

ans = 1.0089e+29
ans = nchoosek: possible loss of precision


Warning off silences lastwarn also:

$ octave -f --eval "warning off; nchoosek (100, 50), lastwarn"
ans = 1.0089e+29
ans =


Warning on quiet silences display but allows lastwarn:

$ octave -f --eval "warning on quiet; nchoosek (100, 50), lastwarn"
ans = 1.0089e+29
ans = nchoosek: possible loss of precision


It's useful because of that difference if the user wants to do fine-grained warning message control, but is not fully Matlab-compatible. Since Octave is generally a superset of Matlab, it's probably better to retain it and document it.

Arun Giridhar <arungiridhar>
Group Member
Thu 28 Jul 2022 02:22:06 PM UTC, comment #2: 

I recall this discussion. As I remember, "quiet" is Octave-only, not in Matlab, hence was never documented. Setting it to "quiet" suppresses the display of the warning but still records the warning for use in related functions like lastwarn. This is different from plain "warning off" which will suppress the display and the recording of the warning.

Because of that fine-grain control, the "quiet" option has some use for custom-display of warnings in user code, but because Matlab does not have it, there was some debate as to whether Octave should include it or not. I thought it was resolved but apparently it never was.

Arun Giridhar <arungiridhar>
Group Member
Thu 28 Jul 2022 01:53:02 PM UTC, comment #1: 

looking at the code for warning, it does appear that there is an undocumented "quiet" warning state. 

the state can be set on/off with the command style call to warning mentioned in comment #0, or by the function style syntax


>> warning("on", "quiet")
>> warning("off", "quiet")


and can be queried like any other warning state by

>> warning("query", "quiet")
"quiet" warning state is "on"



I don't know if this was added for matlab compatibility, as a quick search doesn't turn up anything there. We don't always document things that are added just for that reason. but it would be good to know what this state actually changes and to document it if it's useful.

updating report title and changing to "Need info" from someone more for familiar with the warning function.

Nicholas Jankowski <nrjank>
Group Member
Thu 28 Jul 2022 11:32:56 AM UTC, original submission:  

A code used "warning on quiet" and "warning off quiet" but the help for warning does not mention "quiet". Missing help text.

Anonymous

 

(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 mmuetzel (Posted a comment)
  • -email is unavailable- added by arungiridhar (Posted a comment)
  • -email is unavailable- added by nrjank (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-07-28 nrjank StatusNone Need Info
        Release6.4.0 dev
        Summaryhelp missing text for warning "quiet" warning state is undocumented

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code