Skip to content

Commit

Permalink
Unifies default parameters (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrPaulSharp authored Jul 18, 2024
1 parent 2825111 commit be78284
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions API/projectClass/parametersClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,17 @@
% for 8 inputs, all parameter properties are provided
%
% params.addParameter('Tails Roughness');

% Set the default parameters
values = [0.0, 0.0, 0.0];
fit = false;
priorType = priorTypes.Uniform.value;
priorValues = [0, Inf];

if isempty(varargin)
% No input parameter
% Add an empty parameter row
% No input parameter - create name and add defaults
name = sprintf('new parameter %d',obj.autoNameCounter);
newRow = {name,0,0,0,false,priorTypes.Uniform.value,0,Inf};
newRow = {name, values(1), values(2), values(3), fit, priorType, priorValues(1), priorValues(2)};
obj.addRow(newRow{:});
end

Expand All @@ -72,10 +78,6 @@
% If length is 1, assume name only
% and fill in the rest with defaults
name = inputCell{1};
values = [1, 2, 3];
fit = false;
priorType = priorTypes.Uniform.value;
priorValues = [0, Inf];

switch length(inputCell)
case 1
Expand Down Expand Up @@ -126,9 +128,10 @@
if ~isnumeric(priorValues)
throw(exceptions.invalidType('Prior values must be numeric'));
end

newRow = {name, values(1), values(2), values(3), fit, priorType, priorValues(1), priorValues(2)};
obj.addRow(newRow{:});

end
end

Expand Down
2 changes: 1 addition & 1 deletion minimisers/generalUtils/makeEmptyBayesResultsStruct.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
'adaptPCR', false,...
'thinning', 1,...
'ABC', false,...
'epsilon', 0.0250,...
'epsilon', 0.0250,...
'IO', false,...
'storeOutput', false,...
'R', R);
Expand Down

0 comments on commit be78284

Please sign in to comment.