From b5fa48864e606564d3f0a61fa6e45c8ee158246d Mon Sep 17 00:00:00 2001 From: Shreyas Singh Date: Sun, 12 Mar 2023 03:40:08 +0530 Subject: [PATCH 1/4] Remove auto argument from Deterministic --- pymc/model.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pymc/model.py b/pymc/model.py index 6be9dd69fe..b42670434d 100644 --- a/pymc/model.py +++ b/pymc/model.py @@ -2012,9 +2012,6 @@ def Deterministic(name, var, model=None, dims=None): ---------- name: str var: PyTensor variables - auto: bool - Add automatically created deterministics (e.g., when imputing missing values) - to a separate model.auto_deterministics list for filtering during sampling. Returns From dfa25999568572e3b2a5ab0be0adb9a1646ff40b Mon Sep 17 00:00:00 2001 From: Shreyas Singh Date: Sun, 12 Mar 2023 21:42:37 +0530 Subject: [PATCH 2/4] Add missing arguments in the deterministic docstring as per numpydoc style guide --- pymc/model.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/pymc/model.py b/pymc/model.py index b42670434d..595782fd47 100644 --- a/pymc/model.py +++ b/pymc/model.py @@ -1967,6 +1967,25 @@ def Deterministic(name, var, model=None, dims=None): they don't add randomness to the model. They are generally used to record an intermediary result. + Parameters + ---------- + name: str + Name of the deterministic variable to be registered in the model. + var: tensor_like + Expression for the calculation of the variable. + model : Model, optional + The model object to which the Deterministic function is added. + If ``None`` is provided, the current model in the context stack is used. + dims : str or tuple of str, optional + Dimension names for the variable. + + Returns + ------- + var: tensor_like + The registered, named variable wrapped in Deterministic. + + Examples + -------- Indeed, PyMC allows for arbitrary combinations of random variables, for example in the case of a logistic regression @@ -2007,16 +2026,6 @@ def Deterministic(name, var, model=None, dims=None): of times during a NUTS step, the Deterministic quantities are just computeed once at the end of the step, with the final values of the other random variables. - - Parameters - ---------- - name: str - var: PyTensor variables - - - Returns - ------- - var: var, with name attribute """ model = modelcontext(model) var = var.copy(model.name_for(name)) From 605e2e75dc008ee90f12412d301d8e2ef9b5944a Mon Sep 17 00:00:00 2001 From: Shreyas Singh Date: Sun, 12 Mar 2023 21:44:00 +0530 Subject: [PATCH 3/4] Add missing arguments in the Potential docstring --- pymc/model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pymc/model.py b/pymc/model.py index 595782fd47..c66026650e 100644 --- a/pymc/model.py +++ b/pymc/model.py @@ -2065,7 +2065,9 @@ def Potential(name, var, model=None, dims=None): Expression to be added to the model joint logp. model : Model, optional The model object to which the potential function is added. - If ``None`` is provided, the current model is used. + If ``None`` is provided, the current model in the context stack is used. + dims : str or tuple of str, optional + Dimension names for the variable. Returns ------- From 3298083816b3edc145ebad65810fc9ea96aed64c Mon Sep 17 00:00:00 2001 From: Michael Osthege Date: Mon, 13 Mar 2023 00:08:42 +0100 Subject: [PATCH 4/4] Add spaces around colons --- pymc/model.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymc/model.py b/pymc/model.py index c66026650e..3bcdaa8d3c 100644 --- a/pymc/model.py +++ b/pymc/model.py @@ -1969,19 +1969,19 @@ def Deterministic(name, var, model=None, dims=None): Parameters ---------- - name: str + name : str Name of the deterministic variable to be registered in the model. - var: tensor_like + var : tensor_like Expression for the calculation of the variable. model : Model, optional - The model object to which the Deterministic function is added. + The model object to which the Deterministic variable is added. If ``None`` is provided, the current model in the context stack is used. dims : str or tuple of str, optional Dimension names for the variable. Returns ------- - var: tensor_like + var : tensor_like The registered, named variable wrapped in Deterministic. Examples