From 8d2a5971409611af6e218bd7d54bab0e6ad4eb90 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 24 Nov 2026 09:48:59 -0500 Subject: [PATCH 1/6] Try against cmdstanpy 2.0 RC --- python/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 8d28f128c..40b1b2622 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools>=64", "wheel", - "cmdstanpy>=1.3.2,<2", + "cmdstanpy==2.0.0rc1", ] build-backend = "setuptools.build_meta" @@ -13,7 +13,7 @@ description = "Automatic Forecasting Procedure" readme = "README.md" requires-python = ">=3.10" dependencies = [ - "cmdstanpy>=1.3.2,<2", + "cmdstanpy==2.0.0rc1", "numpy>=1.21.6", "matplotlib>=3.5.3", "pandas>=1.3.5", From 8c23a9737d7c8f4541cfed8c85500057c29f93d7 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 24 Nov 2026 10:15:48 -0500 Subject: [PATCH 2/6] Remove references to runset --- python/prophet/models.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/python/prophet/models.py b/python/prophet/models.py index 59cde26e3..a70b54016 100644 --- a/python/prophet/models.py +++ b/python/prophet/models.py @@ -228,12 +228,17 @@ def cleanup(self) -> None: if hasattr(self, "stan_fit") and self.stan_fit is not None: fit_result: cmdstanpy.CmdStanMLE | cmdstanpy.CmdStanMCMC = self.stan_fit - to_remove = ( - fit_result.runset.csv_files + - fit_result.runset.diagnostic_files + - fit_result.runset.stdout_files + - fit_result.runset.profile_files - ) + to_remove = [] + + for attr in fit_result._FILE_ATTRS: + val = getattr(fit_result, attr) + if val is None: + continue + if isinstance(val, list): + to_remove.extend(val) + else: + to_remove.append(val) + for fpath in to_remove: if pathlib.Path(fpath).is_file(): pathlib.Path(fpath).unlink() From ec361df4de781642f4d34fa7a68affe5f420dc5b Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 24 Nov 2026 10:43:17 -0500 Subject: [PATCH 3/6] Support either version in cleanup() --- python/prophet/models.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/python/prophet/models.py b/python/prophet/models.py index a70b54016..1a7959d67 100644 --- a/python/prophet/models.py +++ b/python/prophet/models.py @@ -230,14 +230,22 @@ def cleanup(self) -> None: fit_result: cmdstanpy.CmdStanMLE | cmdstanpy.CmdStanMCMC = self.stan_fit to_remove = [] - for attr in fit_result._FILE_ATTRS: - val = getattr(fit_result, attr) - if val is None: - continue - if isinstance(val, list): - to_remove.extend(val) - else: - to_remove.append(val) + if hasattr(fit_result, "runset"): # 1.x + to_remove = [ + fit_result.runset.csv_files + + fit_result.runset.diagnostic_files + + fit_result.runset.stdout_files + + fit_result.runset.profile_files + ] + else: # 2.0 + for attr in fit_result._FILE_ATTRS: + val = getattr(fit_result, attr) + if val is None: + continue + if isinstance(val, list): + to_remove.extend(val) + else: + to_remove.append(val) for fpath in to_remove: if pathlib.Path(fpath).is_file(): From 940153f5b1ddc8915c164604fd31d3ad2013bb32 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 24 Nov 2026 10:49:51 -0500 Subject: [PATCH 4/6] Ignore types for cross-version compat --- python/prophet/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/prophet/models.py b/python/prophet/models.py index 1a7959d67..b455be75e 100644 --- a/python/prophet/models.py +++ b/python/prophet/models.py @@ -232,13 +232,13 @@ def cleanup(self) -> None: if hasattr(fit_result, "runset"): # 1.x to_remove = [ - fit_result.runset.csv_files - + fit_result.runset.diagnostic_files - + fit_result.runset.stdout_files - + fit_result.runset.profile_files + fit_result.runset.csv_files # type: ignore + + fit_result.runset.diagnostic_files # type: ignore + + fit_result.runset.stdout_files # type: ignore + + fit_result.runset.profile_files # type: ignore ] else: # 2.0 - for attr in fit_result._FILE_ATTRS: + for attr in fit_result._FILE_ATTRS: # type: ignore val = getattr(fit_result, attr) if val is None: continue From eaec6643c416a5e123b667afa9e06ba28b4519ad Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 24 Nov 2026 10:50:07 -0500 Subject: [PATCH 5/6] Remove upper bound on cmdstanpy 2.0 --- python/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 40b1b2622..025b35b82 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools>=64", "wheel", - "cmdstanpy==2.0.0rc1", + "cmdstanpy>=1.3.2", ] build-backend = "setuptools.build_meta" @@ -13,7 +13,7 @@ description = "Automatic Forecasting Procedure" readme = "README.md" requires-python = ">=3.10" dependencies = [ - "cmdstanpy==2.0.0rc1", + "cmdstanpy>=1.3.2", "numpy>=1.21.6", "matplotlib>=3.5.3", "pandas>=1.3.5", From a3f82adebaf025d0b6aa1a8b2a4755fd40b2cf04 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 24 Nov 2026 11:58:12 -0500 Subject: [PATCH 6/6] Fix type on 1.x --- python/prophet/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/prophet/models.py b/python/prophet/models.py index b455be75e..e4d7b34d2 100644 --- a/python/prophet/models.py +++ b/python/prophet/models.py @@ -231,12 +231,12 @@ def cleanup(self) -> None: to_remove = [] if hasattr(fit_result, "runset"): # 1.x - to_remove = [ + to_remove = ( fit_result.runset.csv_files # type: ignore + fit_result.runset.diagnostic_files # type: ignore + fit_result.runset.stdout_files # type: ignore + fit_result.runset.profile_files # type: ignore - ] + ) else: # 2.0 for attr in fit_result._FILE_ATTRS: # type: ignore val = getattr(fit_result, attr)