Skip to content

Commit

Permalink
sstValidateFull now actually validates something.
Browse files Browse the repository at this point in the history
It calls ReceptorIsolateDemo with appropriate key/value pairs and this causes a check of some computed values against what they are today.

Will elaborate checks and extend the same scheme to SSTReceptorDemo soon enough.
  • Loading branch information
DavidBrainard committed Oct 17, 2018
1 parent 320aa8f commit 70f7184
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ReceptorIsolate/ReceptorIsolateDemo.m
Expand Up @@ -32,6 +32,8 @@
% - 'basichuman' Basic human validation
% 'whichDirectionNumber' - Number (default 1). Which preset direction
% to validate, when 'validate' is not 'none'
% 'validationFractionTolerance' - Number (default 0.001). Fractional
% tolerance for validation check, when validating.
%
% See also:
%
Expand All @@ -56,6 +58,7 @@
p = inputParser;
p.addParameter('validate','none',@ischar);
p.addParameter('whichDirectionNumber',1,@isnumeric);
p.addParameter('validationFractionTolerance',0.001,@isnumeric)
p.parse(varargin{:});

%% Set status to OK
Expand Down Expand Up @@ -555,6 +558,14 @@
% set this up.
switch p.Results.whichDirectionNumber
case 1
receptorsCheck = sum(T_receptors(:));
if (abs(max(receptorsCheck - 189.39))/189.39 > p.Results.validationFractionTolerance)
status = 0;
end
modulationPrimaryCheck = sum(modulationPrimary(:));
if (abs(max(modulationPrimaryCheck - 47.553))/47.553 > p.Results.validationFractionTolerance)
status = 0;
end
end
otherwise
error('Unknown value for validate type passed.')
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 70f7184

Please sign in to comment.