Back to the main page.

Bug 1136 - ft_checkconfig could support 'custom' error messages

Status CLOSED WONTFIX
Reported 2011-11-10 16:01:00 +0100
Modified 2011-11-23 12:08:10 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 normal
Assigned to: Eelke Spaak
URL:
Tags:
Depends on:
Blocks:
See also:

Eelke Spaak - 2011-11-10 16:01:31 +0100


Eelke Spaak - 2011-11-10 16:05:02 +0100

While editing ft_componentanalysis (bug 1126), I found myself adding a check for the presence of cfg.topo, which should be deprecated. However, the default error message for ft_checkconfig would not be very informative; ideally we would like to inform the user that specifying cfg.unmixing is now the preferred way to estimate component timecourses in a specified data set. I could imagine something like: cfg = ft_checkconfig(cfg,'deprecated',{'topo'},'Specifying cfg.unmixing is now the preferred way to estimate component timecourses in specified data.'); I can easily implement this, but would like to have Robert's opinion on this. It could of course also apply to forbidden etc. options.


Robert Oostenveld - 2011-11-10 16:53:26 +0100

in this case it would be cfg = ft_checkconfig(cfg,'renamed',{'topo' 'unmixing'}) right? If you have cfg.checkconfig=loose or pedantic, it will give do warning('use cfg.%s=''%s'' instead of cfg.%s=''%s', ...) It can be made more informative by allowing cfg = ft_checkconfig(cfg,'renamed',{'topo' 'unmixing') % gives the default message or cfg = ft_checkconfig(cfg,'renamed',{'topo' 'unmixing', 'Here is the specific message'}) Important is that the ft_checkconfig function call remains as ft_checkconfig(cfg, key1, value1, key2, value2)


Eelke Spaak - 2011-11-10 16:56:47 +0100

Well it's not quite renamed, since they are inversely related. Since this is the case, there needs to be a check in componentanalysis anyway, so I will give the more informative warning there and leave this for now.


Robert Oostenveld - 2011-11-11 11:19:45 +0100

I closed all bugs that were recently resolved.