Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify variable naming convention #182

Merged
merged 13 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions 3rdParty/mcmcstat/%runDram.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@

% Pre-processor directives for Matlab Coder.
coder.varsize('problem.ssubs',[Inf 1],[1 0]);
coder.varsize('problem.backgrounds',[Inf 1],[1 0]);
coder.varsize('problem.qshifts',[Inf 1],[1 0]);
coder.varsize('problem.backgroundParams',[Inf 1],[1 0]);
coder.varsize('problem.qzshifts',[Inf 1],[1 0]);
coder.varsize('problem.scalefactors',[Inf 1],[1 0]);
coder.varsize('problem.nbairs',[Inf 1],[1 0]);
coder.varsize('problem.nbsubs',[Inf 1],[1 0]);
coder.varsize('problem.resolutions',[Inf 1],[1 0]);
coder.varsize('problem.bulkIn',[Inf 1],[1 0]);
coder.varsize('problem.bulkOut',[Inf 1],[1 0]);
coder.varsize('problem.resolutionParams',[Inf 1],[1 0]);
coder.varsize('problem.ssubs',[Inf 1],[1 0]);
coder.varsize('problem.calculations.all_chis',[Inf 1],[1 0]);
coder.varsize('problem.calculations.sum_chi',[1 1],[0 0]);
Expand Down
10 changes: 5 additions & 5 deletions API/RATMain.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
preAlloc = zeros(numberOfContrasts,1);

problem = struct('ssubs',preAlloc,...
'backgrounds',preAlloc,...
'qshifts',preAlloc,...
'backgroundParams',preAlloc,...
'qzshifts',preAlloc,...
'scalefactors',preAlloc,...
'nbairs',preAlloc,...
'nbsubs',preAlloc,...
'resolutions',preAlloc,...
'bulkIn',preAlloc,...
'bulkOut',preAlloc,...
'resolutionParams',preAlloc,...
'calculations',struct('all_chis',preAlloc,'sum_chi',0),...
'allSubRough',preAlloc,...
'resample',preAlloc);
Expand Down
12 changes: 6 additions & 6 deletions API/parseClassToStructs.m
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,12 @@
problemDef.contrastBulkIns = inputStruct.contrastBulkIns;
problemDef.contrastBulkOuts = inputStruct.contrastBulkOuts;
problemDef.contrastResolutions = contrastRes;
problemDef.backs = inputStruct.backgroundParamValues; %inputStruct.backgrounds; % **** note backPar workaround (todo) ****
problemDef.shifts = inputStruct.qzshiftValues;
problemDef.sf = inputStruct.scalefactorValues;
problemDef.nba = inputStruct.bulkInValues;
problemDef.nbs = inputStruct.bulkOutValues;
problemDef.res = inputStruct.resolutionParamValues; %inputStruct.resolutions; % **** note resolutionParam workaround (todo) ****
problemDef.backgroundParams = inputStruct.backgroundParamValues; %inputStruct.backgrounds; % **** note backPar workaround (todo) ****
problemDef.qzshifts = inputStruct.qzshiftValues;
problemDef.scalefactors = inputStruct.scalefactorValues;
problemDef.bulkIn = inputStruct.bulkInValues;
problemDef.bulkOut = inputStruct.bulkOutValues;
problemDef.resolutionParams = inputStruct.resolutionParamValues; %inputStruct.resolutions; % **** note resolutionParam workaround (todo) ****
problemDef.params = inputStruct.paramValues;
problemDef.numberOfLayers = inputStruct.numberOfLayers;
problemDef.modelType = inputStruct.modelType;
Expand Down
51 changes: 26 additions & 25 deletions API/parseOutToProjectClass.m
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
function outProblemDef = parseOutToProjectClass(problemDefInput,outProblemStruct)


%Reconstruct the problemDef class as an output
%Using the outputs from the calculation(s)
outProblemDef = problemDefInput;

%(1) Parameters
pars = outProblemStruct.params;
for i = 1:length(pars)
outProblemDef.setParameterValue(i,pars(i));
params = outProblemStruct.params;
for i = 1:length(params)
outProblemDef.setParameterValue(i,params(i));
end

%(2) Backgrounds
backs = outProblemStruct.backs;
for i = 1:length(backs)
outProblemDef.setBackgroundParamValue(i,backs(i));
backgroundParams = outProblemStruct.backgroundParams;
for i = 1:length(backgroundParams)
outProblemDef.setBackgroundParamValue(i,backgroundParams(i));
end

%(3) Scalefactors
scales = outProblemStruct.sf;
for i = 1:length(scales)
outProblemDef.setScalefactor(i,'value',scales(i));
scalefactors = outProblemStruct.scalefactors;
for i = 1:length(scalefactors)
outProblemDef.setScalefactor(i,'value',scalefactors(i));
end

%(4) Qzshifts
% shifts = outProblemStruct.shifts;
% outProblemDef.qzshifts = shifts;
qzshifts = outProblemStruct.qzshifts;
for i = 1:length(qzshifts)
outProblemDef.setQzshift(i,'value',qzshifts(i));
end

%(4) Nbairs
nbairs = outProblemStruct.nba;
for i = 1:length(nbairs)
outProblemDef.setBulkIn(i,'value',nbairs(i));
%(5) Bulk In
bulkIns = outProblemStruct.bulkIn;
for i = 1:length(bulkIns)
outProblemDef.setBulkIn(i,'value',bulkIns(i));
end

%(5) Nbsubs
nbsubs = outProblemStruct.nbs;
for i = 1:length(nbsubs)
outProblemDef.setBulkOut(i,'value',nbsubs(i));
%(6) Bulk Out
bulkOuts = outProblemStruct.bulkOut;
for i = 1:length(bulkOuts)
outProblemDef.setBulkOut(i,'value',bulkOuts(i));
end

%(5) Resolutions
resol = outProblemStruct.res;
for i = 1:length(resol)
outProblemDef.setResolutionParam(i,'value',resol(i));
%(7) Resolutions
resolutionParams = outProblemStruct.resolutionParams;
for i = 1:length(resolutionParams)
outProblemDef.setResolutionParam(i,'value',resolutionParams(i));
end

% (6) Domain ratio
% (8) Domain ratio
if strcmpi(outProblemStruct.TF,'domains')
domainRatios = outProblemStruct.domainRatio;
for i = 1:length(domainRatios)
Expand Down
12 changes: 6 additions & 6 deletions compile/fullCompile/makeCompileArgsFull.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
ARGS_1_1.contrastBulkIns = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.contrastBulkOuts = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.contrastResolutions = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.backs = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.shifts = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.sf = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.nba = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.nbs = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.res = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.backgroundParams = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.qzshifts = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.scalefactors = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.bulkIn = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.bulkOut = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.resolutionParams = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.params = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.numberOfLayers = coder.typeof(0);
ARGS_1_1.modelType = coder.typeof('X',[1 maxArraySize],[0 1]);
Expand Down
12 changes: 6 additions & 6 deletions compile/reflectivityCalculation/makeCompileArgs.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
ARGS_1_1.contrastBulkIns = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.contrastBulkOuts = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.contrastResolutions = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.backs = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.shifts = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.sf = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.nba = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.nbs = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.res = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.backgroundParams = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.qzshifts = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.scalefactors = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.bulkIn = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.bulkOut = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.resolutionParams = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.params = coder.typeof(0,[1 maxArraySize],[0 1]);
ARGS_1_1.numberOfLayers = coder.typeof(0);
ARGS_1_1.modelType = coder.typeof('X',[1 maxArraySize],[0 1]);
Expand Down
2 changes: 1 addition & 1 deletion minimisers/generalUtils/checkBounds.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

fitWhichNbas = problem.fitBulkIn;
fittingNbas = problem.nba(find(fitWhichNbas));
fittingNbaConstr = problem.nbairs_constr(find(fitWhichNbas),:);
fittingNbaConstr = problem.bulkIns_constr(find(fitWhichNbas),:);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the underscore

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll get on it, but we should be removing this file, as per #175.

fittingNbaNames = problem.nbaNames(find(fitWhichNbas));


Expand Down
Loading