From 7e2d9e2f584ce76ad27087da7c3401ae2886ff1a Mon Sep 17 00:00:00 2001 From: Virgile Andreani Date: Thu, 10 Oct 2024 10:23:39 +0200 Subject: [PATCH] Remove deprecated arguments in smc/sampling.py --- pymc/smc/sampling.py | 36 ------------------------------------ tests/smc/test_smc.py | 34 ---------------------------------- 2 files changed, 70 deletions(-) diff --git a/pymc/smc/sampling.py b/pymc/smc/sampling.py index 155d531647..a81d34d553 100644 --- a/pymc/smc/sampling.py +++ b/pymc/smc/sampling.py @@ -15,7 +15,6 @@ import logging import multiprocessing import time -import warnings from collections import defaultdict from concurrent.futures import ProcessPoolExecutor, wait @@ -150,41 +149,6 @@ def sample_smc( `link `__ """ - if isinstance(kernel, str) and kernel.lower() in ("abc", "metropolis"): - warnings.warn( - f'The kernel string argument "{kernel}" in sample_smc has been deprecated. ' - f"It is no longer needed to distinguish between `abc` and `metropolis`", - FutureWarning, - stacklevel=2, - ) - kernel = IMH - - if kernel_kwargs.pop("save_sim_data", None) is not None: - warnings.warn( - "save_sim_data has been deprecated. Use pm.sample_posterior_predictive " - "to obtain the same type of samples.", - FutureWarning, - stacklevel=2, - ) - - if kernel_kwargs.pop("save_log_pseudolikelihood", None) is not None: - warnings.warn( - "save_log_pseudolikelihood has been deprecated. This information is " - "now saved as log_likelihood in models with Simulator distributions.", - FutureWarning, - stacklevel=2, - ) - - parallel = kernel_kwargs.pop("parallel", None) - if parallel is not None: - warnings.warn( - "The argument parallel is deprecated, use the argument cores instead.", - FutureWarning, - stacklevel=2, - ) - if parallel is False: - cores = 1 - if cores is None: cores = _cpu_count() diff --git a/tests/smc/test_smc.py b/tests/smc/test_smc.py index 84a5369558..3aa687459e 100644 --- a/tests/smc/test_smc.py +++ b/tests/smc/test_smc.py @@ -236,40 +236,6 @@ def test_convergence_checks(self, caplog): pm.sample_smc(draws=99, progressbar=not _IS_WINDOWS) assert "The number of samples is too small" in caplog.text - def test_deprecated_parallel_arg(self): - with self.fast_model: - with pytest.warns( - FutureWarning, - match="The argument parallel is deprecated", - ): - pm.sample_smc(draws=10, chains=1, parallel=False) - - def test_deprecated_abc_args(self): - with self.fast_model: - with pytest.warns( - FutureWarning, - match='The kernel string argument "ABC" in sample_smc has been deprecated', - ): - pm.sample_smc(draws=10, chains=1, kernel="ABC") - - with pytest.warns( - FutureWarning, - match='The kernel string argument "Metropolis" in sample_smc has been deprecated', - ): - pm.sample_smc(draws=10, chains=1, kernel="Metropolis") - - with pytest.warns( - FutureWarning, - match="save_sim_data has been deprecated", - ): - pm.sample_smc(draws=10, chains=1, save_sim_data=True) - - with pytest.warns( - FutureWarning, - match="save_log_pseudolikelihood has been deprecated", - ): - pm.sample_smc(draws=10, chains=1, save_log_pseudolikelihood=True) - def test_ordered(self): """ Test that initial population respects custom initval, especially when applied