Update summary.

        The new summary is a weighted average of reviews i.e.

        .. math::

            \\frac{\\sum_{r \\in R} \\mbox{weight}(r) \\times \\mbox{review}(r)}
                {\\sum_{r \\in R} \\mbox{weight}(r)},

        where :math:`R` is a set of reviewers reviewing this product,
        :math:`\\mbox{review}(r)` and :math:`\\mbox{weight}(r)` are
        the review and weight of the reviewer :math:`r`, respectively.

        Args:
          w: A weight function.

        Returns:
          absolute difference between old summary and updated one.

def update_summary(self, w):
        """Update summary.

        The new summary is a weighted average of reviews i.e.

        .. math::

            \\frac{\\sum_{r \\in R} \\mbox{weight}(r) \\times \\mbox{review}(r)}
                {\\sum_{r \\in R} \\mbox{weight}(r)},

        where :math:`R` is a set of reviewers reviewing this product,
        :math:`\\mbox{review}(r)` and :math:`\\mbox{weight}(r)` are
        the review and weight of the reviewer :math:`r`, respectively.

        Args:
          w: A weight function.

        Returns:
          absolute difference between old summary and updated one.
        """
        old = self.summary.v  # pylint: disable=no-member

        reviewers = self._graph.retrieve_reviewers(self)
        reviews = [self._graph.retrieve_review(
            r, self).score for r in reviewers]
        weights = [w(r.anomalous_score) for r in reviewers]
        if sum(weights) == 0:
            self.summary = np.mean(reviews)
        else:
            self.summary = np.average(reviews, weights=weights)
        return abs(self.summary.v - old)