(transformermixin_cls)
return transformermixin_cls
Class decorator changing the docstring for :meth:`fit_transform`.

    Fetches the :meth:`fit` and :meth:`transform` docstrings of a class
    implementing :meth:`fit_transform`, creates adapted docstring using
    :func:`gtda.utils._docs.make_fit_transform_docs`, and
    wraps the original :meth:`fit_transform` implementation with one with
    the new docstring.

    This is particularly useful for classes inheriting from
    :class:`sklearn.base.TransformerMixin`, when the standard docstring is
    inadequate because of exotic input shapes or types.

    Parameters
    ----------
    transformermixin_cls : type
        A class containing a method :meth:`fit_transform`.

    Returns
    -------
    transformermixin_cls : type
        Input class in which the :meth:`fit_transform` method has been
        replaced by a version with a modified docstring but otherwise identical
        behaviour.
Class decorator changing the docstring for :meth:`fit_transform`.
Class decorator changing the docstring for : meth : fit_transform .
def adapt_fit_transform_docs(transformermixin_cls):
    """Class decorator changing the docstring for :meth:`fit_transform`.

    Fetches the :meth:`fit` and :meth:`transform` docstrings of a class
    implementing :meth:`fit_transform`, creates adapted docstring using
    :func:`gtda.utils._docs.make_fit_transform_docs`, and
    wraps the original :meth:`fit_transform` implementation with one with
    the new docstring.

    This is particularly useful for classes inheriting from
    :class:`sklearn.base.TransformerMixin`, when the standard docstring is
    inadequate because of exotic input shapes or types.

    Parameters
    ----------
    transformermixin_cls : type
        A class containing a method :meth:`fit_transform`.

    Returns
    -------
    transformermixin_cls : type
        Input class in which the :meth:`fit_transform` method has been
        replaced by a version with a modified docstring but otherwise identical
        behaviour.

    """

    fit_docs = getdoc(getattr(transformermixin_cls, 'fit'))
    transform_docs = getdoc(getattr(transformermixin_cls, 'transform'))

    def make_new_fit_transform(original_fit_transform):
        @wraps(original_fit_transform)
        def fit_transform_wrapper(*args, **kwargs):
            return original_fit_transform(*args, **kwargs)
        fit_transform_wrapper.__doc__ = \
            make_fit_transform_docs(fit_docs, transform_docs)
        return fit_transform_wrapper

    new_fit_transform = make_new_fit_transform(
        getattr(transformermixin_cls, 'fit_transform'))
    setattr(transformermixin_cls, 'fit_transform', new_fit_transform)
    return transformermixin_cls
def adapt_fit_transform_docs ( transformermixin_cls ) : fit_docs = getdoc ( getattr ( transformermixin_cls , 'fit' ) ) transform_docs = getdoc ( getattr ( transformermixin_cls , 'transform' ) ) def make_new_fit_transform ( original_fit_transform ) : @ wraps ( original_fit_transform ) def fit_transform_wrapper ( * args , * * kwargs ) : return original_fit_transform ( * args , * * kwargs ) fit_transform_wrapper . __doc__ = make_fit_transform_docs ( fit_docs , transform_docs ) return fit_transform_wrapper new_fit_transform = make_new_fit_transform ( getattr ( transformermixin_cls , 'fit_transform' ) ) setattr ( transformermixin_cls , 'fit_transform' , new_fit_transform ) return transformermixin_cls