Skip to content

Commit 8ab279c

Browse files
sstuckerjayd1860sreekanthkura7jayd1860mayucel
authored
Development sync ahead of Nov course (#90)
* v1.32.4 -- Fix some bugs in path utils functions -- More improvements in build/installation process * Update probe class to save and load 3D landmarks * Update probe class to work with old SD files * v1.32.4 -- Copy versoin number for Homer3 from AV * -- Fix small bug in setpaths(0) paths removal * CCA shrinkage back on * Update hmrR_PreprocessIntensity_Negative.m quick fix on negative value check * v1.32.5 -- Fix issue with tCCA user functions not being loaded into function registry -- Set data tree structure display in MainGUI to include the group name display unconditionally. In some instances the group name did not show if the all subjects had only one run. * Update hmrR_PreprocessIntensity_Negative.m Function to include zero values. * v1.32.5 -- Sync DataTree and Utils with AtlasViewer * v1.32.7 -- Add more robust error checking to exclude .snirf files that can't load DataClass.m -- Add better error checking to DataClass and MeasListClass * Create shared code and submodule references to DataTree and Utils (#74) * -- Move DataTree and some Utils functions to independent submodules used by AtlasViewer and Homer3 * Add config file to DataTree and ability to load mutiple config files to config utility Add config file to DataTree and ability to load mutiple config files to config utility * Relink submodule references from jayd1860 to BUNPC * Fix submodule download not working on linux when initializing repo with setpaths. Needed to disable git certificate verification when executing 'git submodule update' from matlab * -- Add tool to setpaths to be able to download submodules without having git installed. * -- Change code to setpaths not to initialize submodules every toime it is run. Add option to 'update' submodules to get latest changes. * ISSUE_TEMPLATE folder (#77) * Fix setpaths issue on MAC where the initialization of submodules causes setpaths to hang waiting for user to press ENTER because the system command running 'git branch' executes in its own shell. Setting the TERM=ansi seems to fix this issue. * -- Add .gitignore file to simplify and clatrify git status output * -- In previous commit didn't entirely fix issue with setpaths waiting for user input on MAC. Need to parse and remove garbage output correctly too * Just use Snirf style GetAux to display aux data (#75) * -- Set origin of submodules to be same as parent repo to follow paradigm of submodules and parent repo being one code (#78) -- Fix submodule download in setpaths without git not working because setpaths options are not parsed correctly. -- Clean up and remove obsolete files * -- Fix issue in setpaths when attempting to download submodules using the non-git method. Assumtion that Github creates empty folder as placeholders for submodules when downloading using the "Download ZIP" option is not always true. Sometimes it creates empty folder, somtimes it doesn't. So isemptyFolder doesn't work when folder is not created. Added code to create empty submodule folder placeholder when it is missing. -- Clean up: remove more obsolete files * -- Fix typo * -- Fix issue with setpaths submodules when there's a partial submodules download because of a previous error then need to clean uo submodule folders so there's no garbage in there then retry downloading. * -- Greatly simplify and make it more straighfoward the setpaths process. -- Add .numberfiles to submodules and check during setpaths process to make sure an incomplete download is detected and triggers a clean download. * -- Fix setpaths error exception on linux and mac because ls([pathname, '*.m']) works differently on those platform than on Windows when there are NO files matching the specified pattern. Use dir instead of ls to fix this. -- Fix multiple issues in submodule downloading using non-git method. -- When user click cancel in response to download fail dialog, quit rather than retry. -- Add search paths ONLY for the submodules that were successfully installed -- Fix typos in dialog failed download message * -- a) Fix setpaths bug in removeFolderContents.m on linux and MAC because the delimiter for path string is ':' not ';' as it is on Winodws. b) On linux the gitSetBranch.m used to get latest branch revis * Fix setpaths('update') not working. * -- Fix problems in setpaths with creating new submodule branches -- Fix issue in setpaths with non-git submodule download and install. a) Fix some bugs and typos preventing correct download. b) Clean up and delete downloaded submodules files which are no longer needed after installation like the zip file and initial unzipped folder c) Clarify input dialog message and try to guess and or suggest the correct branch that matches parent repo -- Add exception handling to setpaths. in case of error return to original folder -- Add comprehensive help comments to setpaths describing it's use * -- Don't add current app twice. Check app include list to see if it already has been added to search paths * Glm fixes (#80) - GLM docs fixes - Convolve HRFs with stim duration before export * -- In setpaths exclude more folders to avoid problems and headaches with unexpected matlab behavior because of inclusion of weird .m files from a build of AV. So for instance exclude *.app and *_install folders which contain a large amount of files which should never be included in matlab search paths. -- Add ability to findDotMFolders to exclude folders based on wildcard patterns rather than only explicit names. This allows exclusion of many folders that fit a pattern without having to explicitly list ALL of them -- Fix several bugs in the build for MAC -- Finally fixed the requirement that you have to run MAC installation specifically from ~/Downloads/homer3_install. Added code to makesetup.pl to create a more intelligent setup.command which does not depend on execution from a specific folder. * -- Fix build not working because need to copy ALL config files to installation folder -- Improve launch performance by changing config file access to global variable * -- Change setpath submodule download without git, to not ask questions about which branch to download. Instead derive the branch name from root folder name of parent app and default to master of it cannot be determined. This change somehow did not make it earlier into repo * -- Update submodule references to latest development branch rev * -- Change unit test to use global config variable rather than opening/closing ConfigFileClass objects -- Update getVernum to match AV -- Update submodule references * DataTree submodule reference update and Mac support fixes (#89) -- Update DataTree submodule reference to latest change containing fix for errors when there are no data files (because all have errors that prevent loading) -- Fix more issues with install executable on MAC Co-authored-by: jayd1860 <[email protected]> Co-authored-by: sreekanthkura7 <[email protected]> Co-authored-by: jayd1860 <[email protected]> Co-authored-by: Meryem Ayse Yucel <[email protected]> Co-authored-by: jayd1860 <[email protected]> Co-authored-by: Jay Dubb <[email protected]> Co-authored-by: Jay Dubb <[email protected]>
1 parent df7477f commit 8ab279c

File tree

7 files changed

+56
-42
lines changed

7 files changed

+56
-42
lines changed

DataTree

Install/setup.m

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ function setup()
66

77
try
88

9+
setNamespace('Homer3');
10+
911
currdir = filesepStandard(pwd);
1012

1113
h = waitbar(0,'Installation Progress ...');
@@ -55,15 +57,15 @@ function main()
5557
iStep = 1;
5658

5759
fprintf('dirnameSrc = %s\n', dirnameSrc)
58-
fprintf('dirnameDst = %s\n\n', dirnameDst)
60+
fprintf('dirnameDst = %s\n', dirnameDst)
5961

6062
logger = Logger([dirnameSrc, 'Setup']);
6163

6264
[~, exename] = getAppname();
6365

6466
v = getVernum();
6567
logger.Write('==========================================\n');
66-
logger.Write('Setup script for %s v%s.%s,%s:\n', exename, v{1}, v{2}, v{3});
68+
logger.Write('Setup script for %s v%s.%s.%s:\n', exename, v{1}, v{2}, v{3});
6769
logger.Write('==========================================\n\n');
6870

6971
logger.Write('Platform params:\n');
@@ -118,9 +120,12 @@ function main()
118120
function err = cleanup()
119121
global dirnameSrc
120122
global dirnameDst
123+
global logger
121124

122125
err = 0;
123126

127+
logger = [];
128+
124129
% Uninstall old installation
125130
try
126131
if exist(dirnameDst,'dir')
@@ -137,27 +142,30 @@ function main()
137142
end
138143

139144
% Change source dir if not on PC
140-
if ~ispc() && ~isdeployed()
141-
dirnameSrc0 = dirnameSrc;
142-
145+
if ~ispc()
143146
dirnameSrc = sprintf('~/Downloads/%s_install/', lower(getAppname));
144147
fprintf('SETUP: current folder is %s\n', pwd);
145-
rmdir_safe(sprintf('~/Desktop/%s_install/', lower(getAppname())));
146-
rmdir_safe(dirnameSrc);
147-
rmdir_safe('~/Desktop/Test/');
148148

149-
if ispathvalid(dirnameSrc)
150-
err = -1;
151-
end
152-
if ispathvalid('~/Desktop/%s_install/')
153-
err = -1;
154-
end
155-
if ispathvalid('~/Desktop/Test/')
156-
err = -1;
149+
if ~isdeployed()
150+
rmdir_safe(sprintf('~/Desktop/%s_install/', lower(getAppname())));
151+
if ~pathscompare(dirnameSrc, dirnameSrc0)
152+
rmdir_safe(dirnameSrc);
153+
if ispathvalid(dirnameSrc)
154+
err = -1;
155+
end
156+
copyFile(dirnameSrc0, dirnameSrc);
157+
end
158+
rmdir_safe('~/Desktop/Test/');
159+
160+
if ispathvalid('~/Desktop/%s_install/')
161+
err = -1;
162+
end
163+
if ispathvalid('~/Desktop/Test/')
164+
err = -1;
165+
end
166+
167+
cd(dirnameSrc);
157168
end
158-
159-
copyFile(dirnameSrc0, dirnameSrc);
160-
cd(dirnameSrc);
161169
end
162170

163171

@@ -197,7 +205,13 @@ function copyFile(src, dst, type)
197205
end
198206

199207
% Copy file from source to destination folder
200-
logger.Write('Copying %s to %s\n', src, dst);
208+
209+
logmsg = sprintf('Copying %s to %s\n', src, dst);
210+
if isempty(logger)
211+
fprintf(logmsg);
212+
else
213+
logger.Write(logmsg);
214+
end
201215
copyfile(src, dst);
202216

203217
if ~isempty(iStep)

UnitTests/CleanUp.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ function CleanUp(standalone, start)
44
global procStreamStyle
55
global testidx;
66
global logger
7+
global cfg
78
global maingui
89

910
if ~exist('standalone','var') || isempty(standalone)
@@ -52,11 +53,10 @@ function CleanUp(standalone, start)
5253
fclose all;
5354

5455
% Create or restore config file
55-
c = ConfigFileClass();
56-
if c.BackupExists()
57-
c.Restore()
56+
if cfg.BackupExists()
57+
cfg.Restore()
5858
else
59-
c.Save('backup');
59+
cfg.Save('backup');
6060
end
6161

6262
if ~start

UnitTests/UnitTestsAll.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function UnitTestsAll()
22
global logger
3-
3+
global cfg
44
t_local = tic;
55

66
setNamespace('Homer3')
@@ -10,17 +10,17 @@ function UnitTestsAll()
1010
cleanupObj = onCleanup(@()userInterrupt_Callback(true));
1111

1212
logger = Logger('UnitTestsAll');
13+
cfg = ConfigFileClass();
1314

14-
c = ConfigFileClass();
15-
c.SetValue('Regression Test Active','true');
15+
cfg.SetValue('Regression Test Active','true');
1616

17-
c.SetValue('Include Archived User Functions','Yes');
18-
c.SetValue('Default Processing Stream Style','NIRS');
19-
c.Save();
17+
cfg.SetValue('Include Archived User Functions','Yes');
18+
cfg.SetValue('Default Processing Stream Style','NIRS');
19+
cfg.Save();
2020
% UnitTestsAll_Nirs(false);
2121

22-
c.SetValue('Default Processing Stream Style','SNIRF');
23-
c.Save();
22+
cfg.SetValue('Default Processing Stream Style','SNIRF');
23+
cfg.Save();
2424
UnitTestsAll_Snirf(false);
2525
UnitTestsAll_MainGUI(false)
2626

UnitTests/UnitTestsAll_MainGUI.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ function userInterrupt_Callback(standalone)
5050

5151
% ---------------------------------------------------
5252
function configureAppSettings()
53-
c = ConfigFileClass();
54-
c.SetValue('Regression Test Active','true');
55-
c.SetValue('Default Processing Stream Style','SNIRF');
56-
c.Save();
53+
global cfg
54+
cfg.SetValue('Regression Test Active','true');
55+
cfg.SetValue('Default Processing Stream Style','SNIRF');
56+
cfg.Save();
5757

UnitTests/UnitTestsAll_Snirf.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function userInterrupt_Callback(standalone)
6666

6767
% ---------------------------------------------------
6868
function configureAppSettings()
69-
c = ConfigFileClass();
70-
c.SetValue('Regression Test Active','true');
71-
c.SetValue('Default Processing Stream Style','SNIRF');
72-
c.Save();
69+
global cfg
70+
cfg.SetValue('Regression Test Active','true');
71+
cfg.SetValue('Default Processing Stream Style','SNIRF');
72+
cfg.Save();

Utils/Shared

0 commit comments

Comments
 (0)