Repository: scipy/scipy
File: scipy/stats/_distribution_infrastructure.py (Python)

Code before:
        support : dict or tuple
            A dictionary describing the support of the distribution or a tuple
            describing the endpoints of the support. This behaves identically to
            the values of the parameters dict described above, except that the key
            ``typical`` is ignored.

        The class **must** also define a ``pdf`` method and **may** define methods
        ``logentropy``, ``entropy``, ``median``, ``mode``, ``logpdf``,
        ``logcdf``, ``cdf``, ``logccdf``, ``ccdf``,
        ``ilogcdf``, ``icdf``, ``ilogccdf``, ``iccdf``,
        ``moment``, and ``sample``.
        If defined, these methods must accept the parameters of the distribution as
        keyword arguments and also accept any positional-only arguments accepted by
        the corresponding method of `ContinuousDistribution`. The ``moment`` method
        must accept the ``order`` and ``kind`` arguments by position or keyword, but
        may return ``None`` if a formula is not available for the arguments; in this
        case, the infrastructure will fall back to a default implementation. The
        ``sample`` method must accept ``shape`` by position or keyword, but contrary
        to the public method of the same name, the argument it receives will be the
        *full* shape of the output array - that is, the shape passed to the public
        method prepended to the broadcasted shape of random variable parameters. If
        multiple parameterizations are defined, these methods must accept all
        parameters from all parameterizations.

        If the class's ``parameters`` attribute contains a ``tuple`` defining multiple
        parameterizations, then the class must also define a ``__process_parameters``
        method for mapping between the parameterizations. It must take all parameters
        from all parameterizations as optional keyword arguments and return a dictionary
        mapping parameters to values, filling in values from other parameterizations
        using values from the supplied parameterization.


    Returns
    -------
    CustomDistribution : `ContinuousDistribution`
        A subclass of `ContinuousDistribution` corresponding with `dist`. The
        initializer requires all shape parameters to be passed as keyword arguments
        (using the same names as the instance of `rv_continuous`).

    Notes
    -----
    The documentation of `ContinuousDistribution` is not rendered. See below for
    an example of how to instantiate the class (i.e. pass all shape parameters of
    `dist` to the initializer as keyword arguments). Documentation of all methods
    is identical to that of `scipy.stats.Normal`. Use ``help`` on the returned
    class or its methods for more information.

    Examples
    --------
    >>> import numpy as np
    >>> import matplotlib.pyplot as plt

Review comment (suggestion):
```suggestion
        parameterizations, then the class must also define a ``_process_parameters``
```
We *could* allow the users to make this a public function (`process_parameters`), instead.

Code after:
            values, filling in values from other parameterizations using values from
            the supplied parameterization. See example.

        support : dict or tuple
            A dictionary describing the support of the distribution or a tuple
            describing the endpoints of the support. This behaves identically to
            the values of the parameters dict described above, except that the key
            ``typical`` is ignored.

        The class **must** also define a ``pdf`` method and **may** define methods
        ``logentropy``, ``entropy``, ``median``, ``mode``, ``logpdf``,
        ``logcdf``, ``cdf``, ``logccdf``, ``ccdf``,
        ``ilogcdf``, ``icdf``, ``ilogccdf``, ``iccdf``,
        ``moment``, and ``sample``.
        If defined, these methods must accept the parameters of the distribution as
        keyword arguments and also accept any positional-only arguments accepted by
        the corresponding method of `ContinuousDistribution`. 
        When multiple parameterizations are defined, these methods must accept
        all parameters from all parameterizations. The ``moment`` method
        must accept the ``order`` and ``kind`` arguments by position or keyword, but
        may return ``None`` if a formula is not available for the arguments; in this
        case, the infrastructure will fall back to a default implementation. The
        ``sample`` method must accept ``shape`` by position or keyword, but contrary
        to the public method of the same name, the argument it receives will be the
        *full* shape of the output array - that is, the shape passed to the public
        method prepended to the broadcasted shape of random variable parameters.

    Returns
    -------
    CustomDistribution : `ContinuousDistribution`
        A subclass of `ContinuousDistribution` corresponding with `dist`. The
        initializer requires all shape parameters to be passed as keyword arguments
        (using the same names as the instance of `rv_continuous`).

    Notes
    -----
    The documentation of `ContinuousDistribution` is not rendered. See below for
    an example of how to instantiate the class (i.e. pass all shape parameters of
    `dist` to the initializer as keyword arguments). Documentation of all methods
    is identical to that of `scipy.stats.Normal`. Use ``help`` on the returned
    class or its methods for more information.

    Examples
    --------
    >>> import numpy as np
    >>> import matplotlib.pyplot as plt
    >>> from scipy import stats
    >>> from scipy import special

    Create a `ContinuousDistribution` from `scipy.stats.loguniform`.