ilent2 / ott

Optical Tweezers Toolbox (Version 1)
Other
51 stars 30 forks source link

Warnings #13

Closed AStilg closed 6 years ago

AStilg commented 6 years ago

The Warning messages are obtrusive in 1.3.1. It is possible to change a particular warning state (using the tag) to only display a warning once.

ilent2 commented 6 years ago

Should also be looked at for 1.4. Matlab's warning reference page: https://au.mathworks.com/help/matlab/ref/warning.html Is there an option for displaying a warning once per session, or once per function call? Would we have to implement a check ourselves whenever we are calling functions multiple times?

AStilg commented 6 years ago

I don't think it matters as it will display the warning every time matlab is opened. It can be an instruction that the warnings will silence after one time per matlab session (if we don't have enough control)

ilent2 commented 6 years ago

Rather than writing conditions around the individual warnings, we could overload the warning function (and in 1.4 use a function called ott.warning) which checks if a warning has already been displayed.

AStilg commented 6 years ago

Pursuant to previous, octave is very obtuse in the way it treats warnings and doesn't display which file produces the warning. I suggest that the file name is introduced into warnings somewhere. E.g. replacing "This file..." with "xxx.m..."

ilent2 commented 6 years ago

I've just pushed dff474db544324aeb12bd6777f82d904d106064d which should make warnings less intrusive. Not sure if it is the cleanest solution. Any better suggestions or should we go with this for now?