diff --git a/pymc3/distributions/continuous.py b/pymc3/distributions/continuous.py index 56d50b5f28..08102d2022 100644 --- a/pymc3/distributions/continuous.py +++ b/pymc3/distributions/continuous.py @@ -478,7 +478,6 @@ class Normal(Continuous): def __init__(self, mu=0, sigma=None, tau=None, sd=None, **kwargs): if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) tau, sigma = get_tau_sigma(tau=tau, sigma=sigma) self.sigma = self.sd = tt.as_tensor_variable(sigma) self.tau = tt.as_tensor_variable(tau) @@ -640,7 +639,6 @@ def __init__( ): if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) tau, sigma = get_tau_sigma(tau=tau, sigma=sigma) self.sigma = self.sd = tt.as_tensor_variable(sigma) self.tau = tt.as_tensor_variable(tau) @@ -835,7 +833,6 @@ class HalfNormal(PositiveContinuous): def __init__(self, sigma=None, tau=None, sd=None, *args, **kwargs): if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) super().__init__(*args, **kwargs) tau, sigma = get_tau_sigma(tau=tau, sigma=sigma) @@ -1218,7 +1215,6 @@ def __init__(self, alpha=None, beta=None, mu=None, sigma=None, sd=None, *args, * super().__init__(*args, **kwargs) if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) alpha, beta = self.get_alpha_beta(alpha, beta, mu, sigma) self.alpha = alpha = tt.as_tensor_variable(floatX(alpha)) self.beta = beta = tt.as_tensor_variable(floatX(beta)) @@ -1724,7 +1720,6 @@ def __init__(self, mu=0, sigma=None, tau=None, sd=None, *args, **kwargs): super().__init__(*args, **kwargs) if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) tau, sigma = get_tau_sigma(tau=tau, sigma=sigma) @@ -1884,11 +1879,9 @@ class StudentT(Continuous): """ def __init__(self, nu, mu=0, lam=None, sigma=None, sd=None, *args, **kwargs): - super().__init__(*args, **kwargs) super().__init__(*args, **kwargs) if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) self.nu = nu = tt.as_tensor_variable(floatX(nu)) lam, sigma = get_tau_sigma(tau=lam, sigma=sigma) self.lam = lam = tt.as_tensor_variable(lam) @@ -2397,7 +2390,6 @@ def __init__(self, alpha=None, beta=None, mu=None, sigma=None, sd=None, *args, * super().__init__(*args, **kwargs) if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) alpha, beta = self.get_alpha_beta(alpha, beta, mu, sigma) self.alpha = alpha = tt.as_tensor_variable(floatX(alpha)) @@ -2545,7 +2537,6 @@ def __init__(self, alpha=None, beta=None, mu=None, sigma=None, sd=None, *args, * if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) alpha, beta = InverseGamma._get_alpha_beta(alpha, beta, mu, sigma) self.alpha = alpha = tt.as_tensor_variable(floatX(alpha)) @@ -2902,7 +2893,6 @@ def __init__(self, nu=1, sigma=None, lam=None, sd=None, *args, **kwargs): super().__init__(*args, **kwargs) if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) self.mode = tt.as_tensor_variable(0) lam, sigma = get_tau_sigma(lam, sigma) @@ -3041,7 +3031,6 @@ def __init__(self, mu=0.0, sigma=None, nu=None, sd=None, *args, **kwargs): if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) self.mu = mu = tt.as_tensor_variable(floatX(mu)) self.sigma = self.sd = sigma = tt.as_tensor_variable(floatX(sigma)) @@ -3317,7 +3306,6 @@ def __init__(self, mu=0.0, sigma=None, tau=None, alpha=1, sd=None, *args, **kwar if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) tau, sigma = get_tau_sigma(tau=tau, sigma=sigma) self.mu = mu = tt.as_tensor_variable(floatX(mu)) @@ -3721,7 +3709,6 @@ def __init__(self, nu=None, sigma=None, b=None, sd=None, *args, **kwargs): super().__init__(*args, **kwargs) if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) nu, b, sigma = self.get_nu_b(nu, b, sigma) self.nu = nu = tt.as_tensor_variable(floatX(nu)) @@ -3994,7 +3981,6 @@ class LogitNormal(UnitContinuous): def __init__(self, mu=0, sigma=None, tau=None, sd=None, **kwargs): if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) self.mu = mu = tt.as_tensor_variable(floatX(mu)) tau, sigma = get_tau_sigma(tau=tau, sigma=sigma) self.sigma = self.sd = tt.as_tensor_variable(sigma) diff --git a/pymc3/distributions/mixture.py b/pymc3/distributions/mixture.py index 51b35812a7..75471d1822 100644 --- a/pymc3/distributions/mixture.py +++ b/pymc3/distributions/mixture.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import warnings - from collections.abc import Iterable import numpy as np @@ -632,7 +630,6 @@ class NormalMixture(Mixture): def __init__(self, w, mu, sigma=None, tau=None, sd=None, comp_shape=(), *args, **kwargs): if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) _, sigma = get_tau_sigma(tau=tau, sigma=sigma) self.mu = mu = tt.as_tensor_variable(mu) diff --git a/pymc3/distributions/timeseries.py b/pymc3/distributions/timeseries.py index e20b301f7f..5174851547 100644 --- a/pymc3/distributions/timeseries.py +++ b/pymc3/distributions/timeseries.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import warnings - import numpy as np import theano.tensor as tt @@ -116,7 +114,6 @@ def __init__( super().__init__(*args, **kwargs) if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) tau, sigma = get_tau_sigma(tau=tau, sigma=sigma) self.sigma = self.sd = tt.as_tensor_variable(sigma) @@ -211,7 +208,6 @@ def __init__(self, tau=None, init=Flat.dist(), sigma=None, mu=0.0, sd=None, *arg raise TypeError("GaussianRandomWalk must be supplied a non-zero shape argument!") if sd is not None: sigma = sd - warnings.warn("sd is deprecated, use sigma instead", DeprecationWarning) tau, sigma = get_tau_sigma(tau=tau, sigma=sigma) self.tau = tt.as_tensor_variable(tau) sigma = tt.as_tensor_variable(sigma) diff --git a/pymc3/tests/test_glm.py b/pymc3/tests/test_glm.py index 493be99d5d..dfd24a006e 100644 --- a/pymc3/tests/test_glm.py +++ b/pymc3/tests/test_glm.py @@ -46,9 +46,9 @@ def setup_class(cls): super().setup_class() cls.intercept = 1 cls.slope = 3 - cls.sd = 0.05 + cls.sigma = 0.05 x_linear, cls.y_linear = generate_data(cls.intercept, cls.slope, size=1000) - cls.y_linear += np.random.normal(size=1000, scale=cls.sd) + cls.y_linear += np.random.normal(size=1000, scale=cls.sigma) cls.data_linear = pd.DataFrame(dict(x=x_linear, y=cls.y_linear)) x_logistic, y_logistic = generate_data(cls.intercept, cls.slope, size=3000) @@ -73,7 +73,7 @@ def test_linear_component(self): assert round(abs(np.mean(trace["Intercept"]) - self.intercept), 1) == 0 assert round(abs(np.mean(trace["x"]) - self.slope), 1) == 0 - assert round(abs(np.mean(trace["sigma"]) - self.sd), 1) == 0 + assert round(abs(np.mean(trace["sigma"]) - self.sigma), 1) == 0 def test_glm(self): with Model() as model: @@ -83,7 +83,7 @@ def test_glm(self): assert round(abs(np.mean(trace["Intercept"]) - self.intercept), 1) == 0 assert round(abs(np.mean(trace["x"]) - self.slope), 1) == 0 - assert round(abs(np.mean(trace["sd"]) - self.sd), 1) == 0 + assert round(abs(np.mean(trace["sd"]) - self.sigma), 1) == 0 def test_glm_offset(self): offset = 1.0 diff --git a/pymc3/tests/test_models_linear.py b/pymc3/tests/test_models_linear.py index 9fb02f69b3..e02a7dc365 100644 --- a/pymc3/tests/test_models_linear.py +++ b/pymc3/tests/test_models_linear.py @@ -33,9 +33,9 @@ def setup_class(cls): super().setup_class() cls.intercept = 1 cls.slope = 3 - cls.sd = 0.05 + cls.sigma = 0.05 x_linear, cls.y_linear = generate_data(cls.intercept, cls.slope, size=1000) - cls.y_linear += np.random.normal(size=1000, scale=cls.sd) + cls.y_linear += np.random.normal(size=1000, scale=cls.sigma) cls.data_linear = dict(x=x_linear, y=cls.y_linear) x_logistic, y_logistic = generate_data(cls.intercept, cls.slope, size=3000) @@ -59,7 +59,7 @@ def test_linear_component(self): assert round(abs(np.mean(trace["lm_Intercept"]) - self.intercept), 1) == 0 assert round(abs(np.mean(trace["lm_x0"]) - self.slope), 1) == 0 - assert round(abs(np.mean(trace["sigma"]) - self.sd), 1) == 0 + assert round(abs(np.mean(trace["sigma"]) - self.sigma), 1) == 0 assert vars_to_create == set(model.named_vars.keys()) def test_linear_component_from_formula(self): @@ -75,7 +75,7 @@ def test_linear_component_from_formula(self): assert round(abs(np.mean(trace["Intercept"]) - self.intercept), 1) == 0 assert round(abs(np.mean(trace["x"]) - self.slope), 1) == 0 - assert round(abs(np.mean(trace["sigma"]) - self.sd), 1) == 0 + assert round(abs(np.mean(trace["sigma"]) - self.sigma), 1) == 0 def test_glm(self): with Model() as model: @@ -88,7 +88,7 @@ def test_glm(self): ) assert round(abs(np.mean(trace["glm_Intercept"]) - self.intercept), 1) == 0 assert round(abs(np.mean(trace["glm_x0"]) - self.slope), 1) == 0 - assert round(abs(np.mean(trace["glm_sd"]) - self.sd), 1) == 0 + assert round(abs(np.mean(trace["glm_sd"]) - self.sigma), 1) == 0 assert vars_to_create == set(model.named_vars.keys()) def test_glm_from_formula(self): @@ -103,7 +103,7 @@ def test_glm_from_formula(self): assert round(abs(np.mean(trace["%s_Intercept" % NAME]) - self.intercept), 1) == 0 assert round(abs(np.mean(trace["%s_x" % NAME]) - self.slope), 1) == 0 - assert round(abs(np.mean(trace["%s_sd" % NAME]) - self.sd), 1) == 0 + assert round(abs(np.mean(trace["%s_sd" % NAME]) - self.sigma), 1) == 0 def test_strange_types(self): with Model():