EASY refactor

This commit is contained in:
2024-07-27 03:14:39 -04:00
orang tua bce30095aa
melakukan d77711acb7
2 mengubah file dengan 13 tambahan dan 18 penghapusan

Melihat File

@@ -52,13 +52,8 @@ end
% localscansDir=scansDir;
% end
expNm=scansDir(max(strfind(scansDir,'\'))+1:end);
drivePos=min(strfind(scansDir,'\'));
elseif (isunix || ismac)
expNm=scansDir(max(strfind(scansDir,'/'))+1:end);
drivePos=min(strfind(scansDir,'/'));
end
expNm=scansDir(max(strfind(scansDir,'/'))+1:end);
drivePos=min(strfind(scansDir,'/'));
drive=scansDir(1:(drivePos-1));
DBupload=fullfile(drive,'EZdbFiles','DBupLOADfiles');

Melihat File

@@ -50,7 +50,7 @@ function varargout = EASYconsole(varargin)
scansDir=sortedDirs{1};
disp('Beginning in newest project scans directory');
disp(strcat('Using scans directory: ', scansDir, ' from hardcoded default'));
disp('This usually indicates that we are in stand-alone mode');
disp('This usually indicates that we are in stand-alone mode without PROJECT or SCANS_DIR environment variables');
end
% If we don't have the EASY_SUFFIX from the module, generate it from scansDir
@@ -93,22 +93,22 @@ function varargout = EASYconsole(varargin)
disp(strcat('Using EASY script directory: ', easyDir, ' from hardcoded default'));
end
if exist('EASY_RESULTS_DIR', 'env') && ~isempty(getenv('EASY_RESULTS_DIR'))
easyResultsDir=fullfile(get_env('EASY_RESULTS_DIR'));
disp(strcat('Using project prefix: ', easyResultsDir, ' from environment variable EASY_RESULTS_DIR'))
else
easyResultsDirName=strcat('Results_',todayStr,'_',easySuffix);
easyResultsDir=fullfile(scansDir,easyResultsDirName);
scansDir=fullfile(parent_dir,'ExpJobs'); % relative to easy script dir
disp(strcat('Using project prefix: ', PROJECT_PREFIX, ' from environment variable PROJECT_PREFIX'))
end
if exist('PROJECT_USER', 'env') && ~isempty(getenv('PROJECT_USER'))
if get_env('PROJECT_USER') ~= userName % sanity check
disp("WARNING: PROJECT_USER does not match the current namespace");
end
end
if exist('EASY_RESULTS_DIR', 'env') && ~isempty(getenv('EASY_RESULTS_DIR'))
easyResultsDir=fullfile(get_env('EASY_RESULTS_DIR'));
disp(strcat('Using output directory: ', easyResultsDir, ' from environment variable EASY_RESULTS_DIR'))
else
easyResultsDirName=strcat('Results_',todayStr,'_',userName,'_',easySuffix);
easyResultsDir=fullfile(scansDir,easyResultsDirName);
disp(strcat('Using output directory: ', PROJECT_PREFIX, ' from environment variable PROJECT_PREFIX'))
end
if exist('MASTER_PLATE_FILE', 'env') && ~isempty(getenv('MASTER_PLATE_FILE'))
masterPlateFile=fullfile(get_env('MASTER_PLATE_FILE'));
disp(strcat('Using drug media file: ', masterPlateFile, ' from environment variable MASTER_PLATE_FILE'))