dendrograms / astrodendro

Generate a dendrogram from a dataset
https://dendrograms.readthedocs.io/
Other
37 stars 36 forks source link

replace progressbar with tqdm or astropy progressbar #170

Open GiantMolecularCloud opened 3 years ago

GiantMolecularCloud commented 3 years ago

The current implementation of a progress bar generates way too much output when calculating dendrograms for a fairly standard cube (~1000x1000x100). In Terminals this is not so much of an issue (depending on the history settings) but in Jupyter it is: There are so many lines generated that the browser displaying jupyter runs out of memory and halts the browser tab.

The progress bar implementations in astropy or tqdm are much better here since they overwrite the current line. They also provide a more or less accurate extrapolation of the run time.

Working demonstration of the replacement (but not full implementation) in GiantMolecularCloud/astrodendro

keflavich commented 3 years ago

This is definitely a good thing to submit as as PR; indeed, progressbars don't always interact well w/jupyter notebooks, but the tqdm/astropy ones designed for that purpose do.

GiantMolecularCloud commented 3 years ago

I don't have the time right now to fully test this before submitting a PR. In the current version of my fork I seem to have lost one or two outputs (or maybe there never were any and I just misremembered). When I have some more time I will work on it.

What would be the preferred option? tqdm or astropy? I personally like tqdm more but there is little difference in most cases.