Skip to content

Commit

Permalink
Add warning if cmdstan version is below 2.36.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
tillahoffmann committed Dec 11, 2024
1 parent c3bc4d8 commit 27cecf3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions stan/gptools/stan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ def get_include() -> str:
"""
Get the include directory for the library.
"""
version = cmdstanpy.cmdstan_version()
if version and version < (2, 36): # pragma: no cover
logging.warning(
"cmdstan<2.36.0 had a bug in the evaluation of Matern 3/2 kernels "
"with different length scales for different dimensions; see "
"https://github.com/stan-dev/math/pull/3084 for details. Your "
"model may yield unexpected results or crash if you use "
"nearest-neighbor Gaussian processes with Matern 3/2 kernels. Your "
"cmdstan version is %d.%d; consider upgrading.",
*version,
)
return os.path.dirname(__file__)


Expand Down

0 comments on commit 27cecf3

Please sign in to comment.