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

Code before:
            A string containing the version number of SciPy in which this interface
            is defined. The preferred interface may change in future SciPy versions,
            in which case support for an old interface version may be deprecated
            and eventually removed.
        parameters : dict
            A dictionary describing the parameters of the distribution.
            Each key is the name of a parameter,
            and the corresponding value is itself a dictionary with the following items.

            endpoints : tuple
                A tuple defining the lower and upper endpoints of the domain of the
                parameter; allowable values are floats or the name (string) of another
                parameter.

            inclusive : tuple of bool
                A tuple specifying whether the endpoints are included within the domain
                of the parameter.

        support : tuple or method.
            A tuple defining the lower and upper endpoints of the support of the
            distribution or a callable which calculates such a tuple based on the
            parameter values. If a tuple, values can be floats or the name (string)
            of a parameter. If ``support`` is defined as a method, it must take the
            parameter names as keyword arguments and return a 2-tuple giving the
            numerical lower and upper endpoints of the support for fixed values of
            the parameters.

        The class **must** also define a ``pdf`` method and **may** define methods
        ``logentropy``, ``entropy``, ``median``, ``mode``, ``logpdf``,
        ``logcdf``, ``cdf``, ``logccdf``, ``ccdf``,
        ``ilogcdf``, ``icdf``, ``ilogccdf``, and ``iccdf``.
        If defined, these methods must accept the parameters of the distributions as
        keyword arguments and also accept any positional-only arguments accepted by
        the corresponding method of `ContinuousDistribution`. Methods ``moment_raw``,
        ``moment_central``, ``moment_standardized`` may also be defined; if so,
        they must accept the ``order`` of the moment by position, accept all
        distribution parameters by keyword, and return the raw, central, and
        standardized moments of the distribution, respectively.

    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

Review comment (suggestion):
I need to document that if a `method` is passed for  `support`, it must accept array arguments for the parameters, and in that case return a tuple of arrays.

Code after:
            is defined. The preferred interface may change in future SciPy versions,
            in which case support for an old interface version may be deprecated
            and eventually removed.
        parameters : dict
            A dictionary describing the parameters of the distribution.
            Each key is the name of a parameter,
            and the corresponding value is itself a dictionary with the following items.

            endpoints : tuple
                A tuple defining the lower and upper endpoints of the domain of the
                parameter; allowable values are floats, the name (string) of another
                parameter, or a callable taking parameters as keyword only
                arguments and returning the numerical value of an endpoint for
                given parameter values.

            inclusive : tuple of bool
                A tuple specifying whether the endpoints are included within the domain
                of the parameter.

        support : dict
            A dictionary describing the support of the distribution. It has items
            "endpoints" and "inclusive" with the same structure as the matching
            items in the values of the parameters dict described above.

        The class **must** also define a ``pdf`` method and **may** define methods
        ``logentropy``, ``entropy``, ``median``, ``mode``, ``logpdf``,
        ``logcdf``, ``cdf``, ``logccdf``, ``ccdf``,
        ``ilogcdf``, ``icdf``, ``ilogccdf``, and ``iccdf``.
        If defined, these methods must accept the parameters of the distributions as
        keyword arguments and also accept any positional-only arguments accepted by
        the corresponding method of `ContinuousDistribution`. Methods ``moment_raw``,
        ``moment_central``, ``moment_standardized`` may also be defined; if so,
        they must accept the ``order`` of the moment by position, accept all
        distribution parameters by keyword, and return the raw, central, and
        standardized moments of the distribution, respectively.

    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.