Skip to content

Commit 8c7a47a

Browse files
committed
Standardize docstrings of input dists arguments and add warning about cloning
1 parent 5c39f7e commit 8c7a47a

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

pymc/distributions/censored.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ class Censored(SymbolicDistribution):
4242
4343
Parameters
4444
----------
45-
dist: PyMC unnamed distribution
46-
PyMC distribution created via the `.dist()` API, which will be censored. This
47-
distribution must be univariate and have a logcdf method implemented.
45+
dist: unnamed distribution
46+
Univariate distribution created via the `.dist()` API, which will be censored.
47+
This distribution must have a logcdf method implemented for sampling.
48+
49+
.. warning:: dist will be cloned, rendering it independent of the one passed as input.
50+
4851
lower: float or None
4952
Lower (left) censoring point. If `None` the distribution will not be left censored
5053
upper: float or None

pymc/distributions/mixture.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,15 @@ class Mixture(SymbolicDistribution):
6666
w : tensor_like of float
6767
w >= 0 and w <= 1
6868
the mixture weights
69-
comp_dists : iterable of PyMC distributions or single batched distribution
70-
Distributions should be created via the `.dist()` API. If single distribution is
71-
passed, the last size dimension (not shape) determines the number of mixture
69+
comp_dists : iterable of unnamed distributions or single batched distribution
70+
Distributions should be created via the `.dist()` API. If a single distribution
71+
is passed, the last size dimension (not shape) determines the number of mixture
7272
components (e.g. `pm.Poisson.dist(..., size=components)`)
7373
:math:`f_1, \ldots, f_n`
7474
75+
.. warning:: comp_dists will be cloned, rendering them independent of the ones passed as input.
76+
77+
7578
Examples
7679
--------
7780
.. code-block:: python

pymc/distributions/multivariate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,10 +1271,13 @@ class LKJCholeskyCov:
12711271
larger values put more weight on matrices with few correlations.
12721272
n: int
12731273
Dimension of the covariance matrix (n > 1).
1274-
sd_dist: pm.Distribution
1274+
sd_dist: unnamed distribution
12751275
A positive scalar or vector distribution for the standard deviations, created
12761276
with the `.dist()` API. Should have `shape[-1]=n`. Scalar distributions will be
12771277
automatically resized to ensure this.
1278+
1279+
.. warning:: sd_dist will be cloned, rendering it independent of the one passed as input.
1280+
12781281
compute_corr: bool, default=True
12791282
If `True`, returns three values: the Cholesky decomposition, the correlations
12801283
and the standard deviations of the covariance matrix. Otherwise, only returns

pymc/distributions/timeseries.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,12 @@ class GaussianRandomWalk(distribution.Continuous):
147147
innovation drift, defaults to 0.0
148148
sigma : tensor_like of float, optional
149149
sigma > 0, innovation standard deviation, defaults to 1.0
150-
init : Univariate PyMC distribution
150+
init : unnamed distribution
151151
Univariate distribution of the initial value, created with the `.dist()` API.
152152
Defaults to Normal with same `mu` and `sigma` as the GaussianRandomWalk
153+
154+
.. warning:: init will be cloned, rendering them independent of the ones passed as input.
155+
153156
steps : int
154157
Number of steps in Gaussian Random Walks (steps > 0).
155158
"""

0 commit comments

Comments
 (0)