From cd32e02b833bd50393c3384c34660c9f76ebf1dd Mon Sep 17 00:00:00 2001 From: Ricardo Date: Fri, 18 Mar 2022 13:40:09 +0100 Subject: [PATCH] Do not make transforms module accessible at root level --- RELEASE-NOTES.md | 1 + docs/source/api/distributions/transforms.rst | 2 +- pymc/__init__.py | 1 - pymc/distributions/transforms.py | 6 +++--- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 3548518785c..09326a4fe47 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -38,6 +38,7 @@ All of the above apply to: - `pm.sample_prior_predictive`, `pm.sample_posterior_predictive` and `pm.sample_posterior_predictive_w` now return an `InferenceData` object by default, instead of a dictionary (see [#5073](https://github.com/pymc-devs/pymc/pull/5073)). - `pm.sample_prior_predictive` no longer returns transformed variable values by default. Pass them by name in `var_names` if you want to obtain these draws (see [4769](https://github.com/pymc-devs/pymc/pull/4769)). - `pm.sample(trace=...)` no longer accepts `MultiTrace` or `len(.) > 0` traces ([see 5019#](https://github.com/pymc-devs/pymc/pull/5019)). +- `transforms` module is no longer accessible ta the root level. It is accessible at `pymc.distributions.transforms` (see[#5347](https://github.com/pymc-devs/pymc/pull/5347)). - `logpt`, `logpt_sum`, `logp_elemwiset` and `nojac` variations were removed. Use `Model.logpt(jacobian=True/False, sum=True/False)` instead. - `dlogp_nojact` and `d2logp_nojact` were removed. Use `Model.dlogpt` and `d2logpt` with `jacobian=False` instead. - `logp`, `dlogp`, and `d2logp` and `nojac` variations were removed. Use `Model.compile_logp`, `compile_dlgop` and `compile_d2logp` with `jacobian` keyword instead. diff --git a/docs/source/api/distributions/transforms.rst b/docs/source/api/distributions/transforms.rst index ffccd979889..904ee19ea5c 100644 --- a/docs/source/api/distributions/transforms.rst +++ b/docs/source/api/distributions/transforms.rst @@ -2,7 +2,7 @@ Transformations *************** -.. currentmodule:: pymc.transforms +.. currentmodule:: pymc.distributions.transforms Transform Instances ~~~~~~~~~~~~~~~~~~~ diff --git a/pymc/__init__.py b/pymc/__init__.py index 9c4419c623c..0982b3edc6e 100644 --- a/pymc/__init__.py +++ b/pymc/__init__.py @@ -55,7 +55,6 @@ def __set_compiler_flags(): from pymc.blocking import * from pymc.data import * from pymc.distributions import * -from pymc.distributions import transforms from pymc.exceptions import * from pymc.func_utils import find_constrained_prior from pymc.math import ( diff --git a/pymc/distributions/transforms.py b/pymc/distributions/transforms.py index d74ce2c62d2..a7bd4a3a2a5 100644 --- a/pymc/distributions/transforms.py +++ b/pymc/distributions/transforms.py @@ -262,12 +262,12 @@ def bounds_fn(*rv_inputs): log_exp_m1 = LogExpM1() log_exp_m1.__doc__ = """ -Instantiation of :class:`pymc.transforms.LogExpM1` +Instantiation of :class:`pymc.distributions.transforms.LogExpM1` for use in the ``transform`` argument of a random variable.""" ordered = Ordered() ordered.__doc__ = """ -Instantiation of :class:`pymc.transforms.Ordered` +Instantiation of :class:`pymc.distributions.transforms.Ordered` for use in the ``transform`` argument of a random variable.""" log = LogTransform() @@ -277,7 +277,7 @@ def bounds_fn(*rv_inputs): sum_to_1 = SumTo1() sum_to_1.__doc__ = """ -Instantiation of :class:`pymc.transforms.SumTo1` +Instantiation of :class:`pymc.distributions.transforms.SumTo1` for use in the ``transform`` argument of a random variable.""" circular = CircularTransform()