isetbio / UnitTestToolbox

A toolbox for validating the data and execution of scripts for any project.
1 stars 1 forks source link

listingScript not found ... #20

Open wandell opened 7 years ago

wandell commented 7 years ago

Hi @npcottaris

I am trying to set up my isetbio preferences for the UnitTestToolbox. (I want to run an ieValidateXXX) test.

I edited the critical struct in UnitTestPreferencesTemplate and it seemed to work OK ...

% Specify root directory.  This is the top level director of the
    % project.
    theProjectRootDir = isetbioRootPath;

    % Specify project-specific preferences
    p = struct(...
            'projectName',           'isetbio', ...                                                                                 % The project's name (also the preferences group name)
            'validationRootDir',     fullfile(theProjectRootDir, 'validation'), ...                                                    % Directory location where the 'scripts' subdirectory resides.
            'alternateFastDataDir',  '',  ...                                                                                          % Alternate FAST (hash) data directory location. Specify '' to use the default location, i.e., $validationRootDir/data/fast
            'alternateFullDataDir',  '', ... % fullfile(filesep,'Users', 'Shared', 'Dropbox', 'theProjectFullValidationData'), ...          % Alternate FULL data directory location. Specify '' to use the default location, i.e., $validationRootDir/data/full
            'clonedWikiLocation',    fullfile(theProjectRootDir,'wiki'), ... % Local path to the directory where the wiki is cloned. Only relevant for publishing tutorials.
            'clonedGhPagesLocation', fullfile(filesep,'Users',  'Shared', 'Matlab', 'Toolboxes', 'theProject_GhPages', 'theProject'), ...   % Local path to the directory where the gh-pages repository is cloned. Only relevant for publishing tutorials.
            'githubRepoURL',         'http://isetbio.github.io/isetbio', ...                                                           % Github URL for the project. This is only used for publishing tutorials.
            'generateGroundTruthDataIfNotFound',   false ...                                                                                % Flag indicating whether to generate ground truth if one is not found
        );

Running ieValidateFullAll I get this error about a preference listingScript

Error using prefutils>getFieldRequired (line 69)
preference listingScript does not exist in group isetbio

Error in prefutils (line 10)
[varargout{1:nargout}] = feval(varargin{:});

Error in getpref (line 85)
     retval{i} = prefutils('getFieldRequired',Group,prefCell{i},...

Error in UnitTest.getPref (line 8)
    preferenceValue = getpref(theProjectName, preferenceName);

Error in ieValidateFullAll (line 88)
listingScript = UnitTest.getPref('listingScript');

What goofy thing have I done now?

Thanks,

npcottaris commented 7 years ago

Hi Brian,

You p-struct is missing an entry for the listingScript, the script which lists the directories for the various validation files. It should look like the following, adapted to your environment. If you want to upload validation data, the generateGroundTruthDataIfNotFound flag should be set to true.

Please let me know if the issue persists after this correction.

Best, Nicolas

p = struct(...
            'projectName',           'isetbio', ...                                                                                   % The project's name (also the preferences group name)
            'validationRootDir',     fullfile(isetbioRootPath, 'validation'), ...                                                     % Directory location where the 'scripts' subdirectory resides.
            'alternateFastDataDir',  '',  ...                                                                                         % Alternate FAST (hash) data directory location. Specify '' to use the default location, i.e., $validationRootDir/data/fast
            'alternateFullDataDir',  '', ...                                                                                          % Alternate FULL data directory location. Specify '' to use the default location, i.e., $validationRootDir/data/full
            'useRemoteDataToolbox',  true, ...                                                                                        % If true use Remote Data Toolbox to fetch full validation data on demand.
            'remoteDataToolboxConfig', 'isetbio', ...                                                                                 % Struct, file path, or project name with Remote Data Toolbox configuration.
            'clonedWikiLocation',    fullfile(filesep,'Users',  'Shared', 'Matlab', 'Toolboxes', 'ISETBIO_Wiki', 'isetbio.wiki'), ... % Local path to the directory where the wiki is cloned. Only relevant for publishing tutorials.
            'clonedGhPagesLocation', fullfile(filesep,'Users',  'Shared', 'Matlab', 'Toolboxes', 'ISETBIO_GhPages', 'isetbio'), ...   % Local path to the directory where the gh-pages repository is cloned. Only relevant for publishing tutorials.
            'githubRepoURL',         'http://isetbio.github.io/isetbio', ...                                                          % Github URL for the project. This is only used for publishing tutorials.
            'generateGroundTruthDataIfNotFound',   false, ...                                                                         % Flag indicating whether to generate ground truth if one is not found
            'listingScript',         'ieValidateListAllValidationDirs', ...    
            'coreListingScript',     'ieValidateListCoreValidationFiles', ...
            'numericTolerance',      1e-11 ...                                                                                        % Numeric tolerance for comparisons with validation data.
        );
wandell commented 7 years ago

I made a kind of dopey error in configuring. I am going to leave this issue open for a while, edit the wiki/Readme and try to prevent myself from doing what I did this time in the future.

Will close this when I am doing with the new documentation.