Back to the main page.

Bug 1804 - check whether ft_defaults respects existing path-order

Status CLOSED FIXED
Reported 2012-10-31 13:18:00 +0100
Modified 2013-06-05 12:15:40 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Roemer van der Meij
URL:
Tags:
Depends on:
Blocks:
See also:

Jan-Mathijs Schoffelen - 2012-10-31 13:18:22 +0100

Roemer knows what to do...


Roemer van der Meij - 2012-11-08 12:27:24 +0100

Fixed for now, but let's discuss implementation. For several sub-folder/modules, there was a call to ft_hastoolbox in ft_defaults, but there was no actual check being performed by ft_hastoolbox. This resulted to several sub-dirs always being added to the path, regardless of whether they were already on it. Hence, they're always at the top of the path. The sub-dirs/modules in question: - trunk/preproc - trunk/inverse - trunk/realtime - trunk/specest - trunk/statfun - trunk/trialfun The first 4 are actual modules (as documented on the wiki), the last two are more a kind of 'utilities' The current structure of ft_hastoolbox distinguishes toolboxes from 'other (sub)directories in fieldtrip'. Modules are considered toolboxes. For a toolbox, an existence-on-the-path check is performed by testing the existence of several files on the path, usually 2 or more ft_ functions. For a 'other (sub)directory in fieldtrip', an existence-on-the-path check is performed by checking whether the dir in question is on the current matlab path (by parsing the output of 'path'). For now, I have added the above modules/dir to the path in way identical to the last situation. Even though some of them are modules. To discuss: For modules, what is the rationale for checking the existence of an arbitrary set of main-functions instead of the sub-directory. Checking for sub-directories seems safer, as it is more stable. PS: A part of the cause for all fieldtrip-dirs being put on the top path everytime ft_defaults was called, is that their existence was only checked for the trunk folder being named 'fieldtrip'. I changed this so that it used the actual trunk (like fieldtrip-XXX; sensitive to \ and / of course) Also, there was a typo in the case for FORWARD(was FORMWARD). Also, I updated some of the urls to all modules supported in ft_hastoolbox. (multivariate and qsub are not supported in hastoolbox, and spike is missing on the wiki)


Roemer van der Meij - 2013-06-05 12:15:40 +0200

Closing time