# Buggy code
def transform(self, X, y=None):
    """Divide all birth and death values in `X` by :attr:`scale_`.

    Parameters
    ----------
    X : ndarray of shape (n_samples, n_features, 3)
        Input data. Array of persistence diagrams, each a collection of
        triples [b, d, q] representing persistent topological features
        through their birth (b), death (d) and homology dimension (q).
        It is important that, for each possible homology dimension, the
        number of triples for which q equals that homology dimension is
        constants across the entries of X.

    y : None
        There is no need for a target in a transformer, yet the pipeline
        API requires this parameter.

    Returns
    -------
    Xs : ndarray of shape (n_samples, n_features, 3)
        Rescaled diagrams.

    """
    check_is_fitted(self)

    Xs = check_diagrams(X)
    Xs[:, :, :2] /= self.scale_
    return Xs


# Traceback (TypeError)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-5e233492b878> in <module>
----> 1 Amplitude(metric="persistence_image").fit_transform(Xd)

~\Workspace\giotto-tda_ulupo\gtda\utils\_docs.py in fit_transform_wrapper(*args, **kwargs)
104         @wraps(original_fit_transform)
105         def fit_transform_wrapper(*args, **kwargs):
--> 106             return original_fit_transform(*args, **kwargs)
107         fit_transform_wrapper.__doc__ = \
108             make_fit_transform_docs(fit_docs, transform_docs)

~\Anaconda3\envs\gtda-ulupo-py38\lib\site-packages\sklearn\base.py in fit_transform(self, X, y, **fit_params)
688         if y is None:
689             # fit method of arity 1 (unsupervised transformation)
--> 690             return self.fit(X, **fit_params).transform(X)
691         else:
692             # fit method of arity 2 (supervised transformation)

~\Workspace\giotto-tda_ulupo\gtda\diagrams\features.py in fit(self, X, y)
273         if self.metric == 'persistence_image':
274             self.effective_metric_params_['weights'] = \
--> 275                 _calculate_weights(X, **self.effective_metric_params_)
276
277         return self

TypeError: _calculate_weights() missing 1 required positional argument: 'weight_function'

# Fixed code
def transform(self, X, y=None):
    """Divide all birth and death values in `X` by :attr:`scale_`.

    Parameters
    ----------
    X : ndarray of shape (n_samples, n_features, 3)
        Input data. Array of persistence diagrams, each a collection of
        triples [b, d, q] representing persistent topological features
        through their birth (b), death (d) and homology dimension (q).
        It is important that, for each possible homology dimension, the
        number of triples for which q equals that homology dimension is
        constants across the entries of X.

    y : None
        There is no need for a target in a transformer, yet the pipeline
        API requires this parameter.

    Returns
    -------
    Xs : ndarray of shape (n_samples, n_features, 3)
        Rescaled diagrams.

    """
    check_is_fitted(self)

    Xs = check_diagrams(X, copy=True)
    Xs[:, :, :2] /= self.scale_
    return Xs