Open iosonofabio opened 2 years ago
This is the code I used for out CZI EOSS presentation:
import ipywidgets as widgets
import igraph as ig
prog = widgets.FloatProgress(min=0, max=100)
import math
def update_progress(msg, p):
if p < prog.value or p >= math.ceil(prog.value):
prog.value = p
ig.set_progress_handler(update_progress)
display(prog)
g = ig.Graph.Barabasi(100000,m=2)
g.community_fastgreedy()
Note that you need to install ipywidgets before you start the notebook, otherwise it will not display correctly.
I do remember looking into tqdm
, possibly at @vtraag 's suggestion, but ended up not using it. I don't recall why exactly, but I think it only allowed monotonic updates (i.e. increments) instead of setting the progress to arbitrary values, which is required by igraph.
Before looking at this seriously for Python, we should make this improvement in the C core: https://github.com/igraph/igraph/issues/1884 It may require changes to the API.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
What is the feature or improvement you would like to see? There's been a discussion on progress bars in #485 that deserves its own issue.
Use cases for the feature C core, python, ipython, Jupyter notebook, Jupyterlab, Google Colab, Data Bricks, etc.
References
485