bugGNU Octave - Bugs: bug #65971, Issue function warnings in a...

 
 

bug #65971: Issue function warnings in a namespace for easy suppression

Submitter:  Glenn Groeschel <glenn>
Submitted:  Wed 10 Jul 2024 02:57:03 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Glenn Groeschel Open/Closed:  * Open
Release:  * 9.2.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 10 Jul 2024 02:57:03 PM UTC, original submission:  

Would it be possible to have the interp1 function return warnings in its own namespace to make suppressing these warnings easier?
When reviewing logs of large data analysis, these warnings can be repetitive and distracting.  I can disable all warnings, but this seems like overkill and more granularity would be helpful.


x=[1 1 1 2 3 4];
y=[10 9 12 15 17 18];
interp1(x,y, [1 1.1 1.2 2.1 3.1 3.9])


Returns:

warning: interp1: multiple discontinuities at the same X value
warning: called from
    interp1 at line 242 column 11

ans =

   12.000   12.300   12.600   15.200   17.100   17.900


It would be nice to be able disable this warning with a command like:

warning("off","interp1:badInput")


I think this can be done just by changing line 242 of interp1.m
from:

warning ("interp1: multiple discontinuities at the same X value");

to:

warning ("interp1:badInput","interp1: multiple discontinuities at the same X value");


This likely could be applied to other functions like interp2 as well.  Is there a reason that these functions shouldn't use their own namespace for warnings?

Glenn Groeschel <glenn>

 

(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 glenn (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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code