From 89f30fd2fb002ed56d8a524cc7c9ca100809fdf1 Mon Sep 17 00:00:00 2001 From: Joanne Sun <1907111+lucentcosmos@users.noreply.github.com> Date: Tue, 10 Oct 2023 03:14:24 -0700 Subject: [PATCH] change CMDSTAN version for Apple M2 (#2497) --- python/prophet/models.py | 2 +- python/prophet/tests/test_prophet.py | 3 ++- python/setup.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/python/prophet/models.py b/python/prophet/models.py index 30293cb..9e02a63 100644 --- a/python/prophet/models.py +++ b/python/prophet/models.py @@ -85,7 +85,7 @@ class IStanBackend(ABC): class CmdStanPyBackend(IStanBackend): - CMDSTAN_VERSION = "2.31.0" + CMDSTAN_VERSION = "2.33.1" def __init__(self): import cmdstanpy # this must be set before super.__init__() for load_model to work on Windows diff --git a/python/prophet/tests/test_prophet.py b/python/prophet/tests/test_prophet.py index 3d6c981..83ea4aa 100644 --- a/python/prophet/tests/test_prophet.py +++ b/python/prophet/tests/test_prophet.py @@ -36,7 +36,8 @@ class TestProphetFitPredictDefault: future = forecaster.make_future_dataframe(test_days, include_history=False) future = forecaster.predict(future) res = rmse(future["yhat"], test["y"]) - assert res == pytest.approx(expected, 0.02), "backend: {}".format(forecaster.stan_backend) + # Higher threshold due to cmdstan 2.33.1 producing numerical differences for macOS Intel (ARM is fine). + assert res == pytest.approx(expected, 0.1), "backend: {}".format(forecaster.stan_backend) @pytest.mark.parametrize( "scaling,expected", diff --git a/python/setup.py b/python/setup.py index b437be9..c31a4f3 100644 --- a/python/setup.py +++ b/python/setup.py @@ -20,7 +20,7 @@ from wheel.bdist_wheel import bdist_wheel MODEL_DIR = "stan" MODEL_TARGET_DIR = os.path.join("prophet", "stan_model") -CMDSTAN_VERSION = "2.31.0" +CMDSTAN_VERSION = "2.33.1" BINARIES_DIR = "bin" BINARIES = ["diagnose", "print", "stanc", "stansummary"] TBB_PARENT = "stan/lib/stan_math/lib"