Skip to content

Commit

Permalink
Fix issue 61: checking Stan version: brian-lau#61
Browse files Browse the repository at this point in the history
The regex to check the Stan version will be more robust if we:
   1) *match* on the first string of numerals and dots following a "v": '(?<=v)[0-9\.]+'
   2) *split* on "." and cast the chunks to integers as before

 On branch master
 Changes to be committed:
	modified:   StanModel.m
  • Loading branch information
Giles Greenway committed Mar 28, 2023
1 parent 6e4b24e commit 9c708e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions StanModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,8 @@ function diagnose(self)
'pollInterval',0.005);
p.block(0.05);
if p.exitValue == 0
str = regexp(p.stdout{1},'\ ','split');
ver = cellfun(@str2num,regexp(str{3},'\.','split'));
str = regexp(p.stdout{1},'(?<=v)[0-9\.]+', 'match');
ver = cellfun(@str2num,regexp(str{1},'\.','split'));
else
fprintf('%s\n',p.stdout{:});
end
Expand Down

0 comments on commit 9c708e2

Please sign in to comment.