Back to the main page.

Bug 2366 - Use consistent terminology in fprintf / warning /error messages

Status NEW
Reported 2013-11-06 13:35:00 +0100
Modified 2017-06-23 15:46:08 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to:
URL:
Tags:
Depends on:
Blocks:
See also:

Jan-Mathijs Schoffelen - 2013-11-06 13:35:56 +0100

e.g. the use of dipole grid may be replaced with sourcemodel - Start with inventorizing what's there, i.e. grep warning / error / fprintf - Order it - Take it from there.........


Robert Oostenveld - 2013-11-06 15:04:05 +0100

the following can be used on the fieldtrip main functions grep -h warning\( *.m | sed 's/^ *//' | sort | uniq or like this for 2 levels deeper grep -h warning\( *.m */*.m */*/*.m | sed 's/^ *//' | sort | uniq it removes the starting whitespace from the line with sed, then sorts in an attempt to move similar warnings after each other. If you have found one that you want to address, you can do grep 'here goes the warning text inside quotes' *.m to find the m file(s) that contain it.


Robert Oostenveld - 2015-02-11 10:08:49 +0100

Regarding warning and error messages: most functions in external/mne do it like this ---- function .... me='MNE:fiff_write_float_sparse_ccs'; % at the start, after the help if nargin ~= 3 error(me,'Incorrect number of arguments'); end ---- we now have a line like revision = '$Id: ft_volumewrite.m 9654 2014-06-21 07:24:04Z roboos $'; at the start of every high-level function, which is used by ft_preamble_provenance. We could add a line me = 'FieldTrip:ft_volumewrite'; to each function.


Robert Oostenveld - 2017-06-23 15:46:08 +0200

Note that with https://github.com/fieldtrip/fieldtrip/pull/445 it is now possible to use automatic message identifiers.