Back to the main page.

Bug 1373 - Search for old-style cfg renaming

Status CLOSED FIXED
Reported 2012-03-14 15:27:00 +0100
Modified 2012-06-20 15:03:19 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 minor
Assigned to: Boris Reuderink
URL:
Tags:
Depends on:
Blocks:
See also:

Jörn M. Horschig - 2012-03-14 15:27:17 +0100

In a short meeting with Robert, we encountered several small things to be changed (all with low priority): - make regular expression grep for if isfield(cfg, 'oldstyle'), cfg.newstyle = cfg.oldstyle; end; - replace those with ft_checkconfig(cfg, 'renamed', {'oldstyle', 'newstyle'})


Boris Reuderink - 2012-06-06 20:59:20 +0200

Okay, I found instances using: $ find . -name "*.m" | xargs egrep -n -C 3 "if isfield\(cfg, ('.+')\),[:space:]*" Actually, there were not so many hits; lots of matches do error reporting or handle very special cases. The few valid matches were replaced in SVN revision r5927. Some matches were of special interest, since they don't remove the original fields; I don't know if the code will keep working if the 'oldfield' is removed: -- ./private/clusterstat.m-182-% first do the clustering on the observed data ./private/clusterstat.m-183-if needpos, ./private/clusterstat.m-184- if issource ./private/clusterstat.m:185: if isfield(cfg, 'origdim'), cfg.dim = cfg.origdim; end %this snippet is to support correct clustering of N-dimensional data, not fully tested yet ./private/clusterstat.m-186- tmp = zeros(cfg.dim); ./private/clusterstat.m-187- tmp(cfg.inside) = postailobs; ./private/clusterstat.m-188- -- ./ft_sourcedescriptives.m-152-end ./ft_sourcedescriptives.m-153- ./ft_sourcedescriptives.m-154-% this is required for backward compatibility with an old version of sourcedescriptives ./ft_sourcedescriptives.m:155:if isfield(cfg, 'singletrial'), cfg.keeptrials = cfg.singletrial; end ./ft_sourcedescriptives.m-156- ./ft_sourcedescriptives.m-157-% do a validity check on the input data and specified options ./ft_sourcedescriptives.m-158-if strcmp(cfg.resolutionmatrix, 'yes')


Boris Reuderink - 2012-06-20 15:03:19 +0200

Changed my resolved bugs to closed.