@@ -182,9 +182,9 @@ def cmdstan_path() -> str:
182182 return cmdstan
183183
184184
185- def cmdstan_version_at (major : int , minor : int ) -> bool :
185+ def cmdstan_version_before (major : int , minor : int ) -> bool :
186186 """
187- Check that CmdStan version is at or above Major.minor version.
187+ Check that CmdStan version is less than Major.minor version.
188188 Parses version string out of CmdStan makefile variable CMDSTAN_VERSION.
189189
190190 If CmdStan installation is found but cannot parse version from makefile
@@ -200,18 +200,18 @@ def cmdstan_version_at(major: int, minor: int) -> bool:
200200 try :
201201 makefile = os .path .join (cmdstan_path (), 'makefile' )
202202 except ValueError :
203- get_logger ().warning (
203+ get_logger ().info (
204204 'No CmdStan installation found, '
205- 'cannot check that Cmdstan version is at or above %d.%d.' ,
205+ 'cannot assert version is less than %d.%d.' ,
206206 major ,
207207 minor ,
208208 )
209209 return False
210210
211211 if not os .path .exists (makefile ):
212- get_logger ().warning (
212+ get_logger ().info (
213213 'CmdStan installation %s missing makefile, '
214- 'cannot check that Cmdstan version is at or above %d.%d.' ,
214+ 'cannot assert version is less than %d.%d.' ,
215215 cmdstan_path (),
216216 major ,
217217 minor ,
@@ -223,9 +223,9 @@ def cmdstan_version_at(major: int, minor: int) -> bool:
223223
224224 start_idx = contents .find ('CMDSTAN_VERSION := ' )
225225 if start_idx < 0 :
226- get_logger ().warning (
226+ get_logger ().info (
227227 'Cannot parse version from makefile: %s,'
228- 'cannot check that Cmdstan version is at or above %d.%d.' ,
228+ 'cannot assert version is less than %d.%d.' ,
229229 makefile ,
230230 major ,
231231 minor ,
@@ -237,9 +237,9 @@ def cmdstan_version_at(major: int, minor: int) -> bool:
237237
238238 version = contents [start_idx :end_idx ]
239239 if version is None or len (version ) < 3 or len (version .split ('.' )) < 2 :
240- get_logger ().warning (
240+ get_logger ().info (
241241 'Cannot parse version from makefile: %s,'
242- 'cannot check that Cmdstan version is at or above %d.%d.' ,
242+ 'cannot assert version is less than %d.%d.' ,
243243 makefile ,
244244 major ,
245245 minor ,
@@ -249,7 +249,7 @@ def cmdstan_version_at(major: int, minor: int) -> bool:
249249 splits = version .split ('.' )
250250 cur_major = int (splits [0 ])
251251 cur_minor = int (splits [1 ])
252- if cur_major > major or (cur_major == major and cur_minor >= minor ):
252+ if cur_major < major or (cur_major == major and cur_minor < minor ):
253253 return True
254254 return False
255255
0 commit comments