From 27cecf354ac687c88a6889351a572f730679ce53 Mon Sep 17 00:00:00 2001 From: Till Hoffmann Date: Wed, 11 Dec 2024 15:26:28 -0500 Subject: [PATCH] Add warning if cmdstan version is below 2.36.0. --- stan/gptools/stan/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/stan/gptools/stan/__init__.py b/stan/gptools/stan/__init__.py index 33406dc..1cee65b 100644 --- a/stan/gptools/stan/__init__.py +++ b/stan/gptools/stan/__init__.py @@ -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__)