Well, we would have to customize each function/method call to
calculate its own percentage complete as it progressed. In this case
we could add a method parameter called 'callback' and the agreement is
that the function you pass as the parameter would be called
periodically with a value.
implementation example:
In your class:
def myfunc(status):
statusbar.pct = status # or whatever does your UI update
calculate_metric([params], callback=self.myfunc)
In networkx:
def calculate_metric([the usual params], callback=None):
# do some stuff ...
if callback:
callback(0.5)
# do more stuff ...
if callback:
callback(1)
Percentage complete estimates should not be too difficult when we know
things like the number of edges that will be calculated and the number
that have already been calculated for a given metric...