carlson-lab / lpne-data-analysis

1 stars 0 forks source link

saveFeatures.m error when featureList is specified but not versions #6

Open jackgoffinet opened 3 years ago

jackgoffinet commented 3 years ago

Bug

When you run saveFeatures like this:

opts.featureList = {'power', 'coherence', 'granger'};
saveFeatures('myTestFile.m', opts)

it fails with an error on line 112-113:

if any(ismember('power', options.featureList)) && ...
        ~strcmp(options.version.power, 'caus_saveFeatures_1.5')

because options.version is not a field.

Expected behavior

I think the options.version field should be filled automatically, maybe with a warning message, in fillDefaultOpts. This shouldn't be too bad to implement...

neil-gallagher commented 3 years ago

Yeah, this sounds reasonable. Could you implement the defaults filled by fillDefaultOpts to match the defaults in the GUI?