def recalculate_modularity(self):
    'Recalculates the stored modularity value.\n\n        This method must be called before querying the modularity score of the\n        clustering through the class member C{modularity} or C{q} if the\n        graph has been modified (edges have been added or removed) since the\n        creation of the L{VertexClustering} object.\n\n        @return: the new modularity score\n        '
    self._modularity = self._graph.modularity(self._membership, **self._modularity_params)
    self._modularity_dirty = False
    return self._modularity
Recalculates the stored modularity value.

This method must be called before querying the modularity score of the
clustering through the class member C{modularity} or C{q} if the
graph has been modified (edges have been added or removed) since the
creation of the L{VertexClustering} object.

@return: the new modularity score
def recalculate_modularity(self):
    'Recalculates the stored modularity value.\n\n        This method must be called before querying the modularity score of the\n        clustering through the class member C{modularity} or C{q} if the\n        graph has been modified (edges have been added or removed) since the\n        creation of the L{VertexClustering} object.\n\n        @return: the new modularity score\n        '
    self._modularity = self._graph.modularity(self._membership, **self._modularity_params)
    self._modularity_dirty = False
    return self._modularity