hnn-core icon indicating copy to clipboard operation
hnn-core copied to clipboard

WIP: Replace simulation time with progress bar

Open ntolley opened this issue 3 years ago • 6 comments

After messing with #77, I think it'd be great to rethink how simulation time is updated on screen. It gets pretty unwieldy with all the print statements and is particularly rough for jupyter notebooks. I've drafted a pretty quick solution using tqdm image

This works well for single core simulations, but will require some more thought with MPI/joblib (new progress bars get printed on every update which defeats the purpose).

Let me know what you guys think! If you're ok with this solution (and adding a dependency or new code in externals) then I'll keep at this.

ntolley avatar Jul 06 '21 03:07 ntolley

I think tqdm is great but I have one concern. The incremental output in a progressbar depends on the characters for carriage return and newline (\r and \n) working properly. I know some terminals (like for some CIs) don't support this and it can lead to an overly verbose output (the opposite of the intended effect)

It might be worth having verbosity levels first. In MNE, you can have 'info', 'debug', 'warning' etc as verbose levels. In scikit-learn, verbose can be an int. A very simple start might be to add verbose=True or verbose=False. It might already solve some of your issues ...

Take a look here: https://docs.python.org/3/howto/logging.html

jasmainak avatar Jul 06 '21 04:07 jasmainak

Great suggestion, I'll start with that. Let's push this to 0.3, mainly opened this PR as a reminder once I finish my 0.2 work.

ntolley avatar Jul 06 '21 04:07 ntolley

@ntolley I think it would be good to revive this PR. I was thinking that this would be useful as well. Maybe tqdm should be an optional dependency though

jasmainak avatar Mar 22 '22 13:03 jasmainak

Played around with this a bit more but it's not clear to me how to resolve the printing issue in the MPI case. Are you guys aware of any packages that print progress bars in parallel applications?

ntolley avatar Mar 26 '22 21:03 ntolley

Tricky … do you think we could update the progressbar only in rank = 0 assuming a similar processing time in other ranks?

On Sat 26 Mar 2022 at 17:20, Nicholas Tolley @.***> wrote:

Played around with this a bit more but it's not clear to me how to resolve the printing issue in the MPI case. Are you guys aware of any packages that print progress bars in parallel applications?

— Reply to this email directly, view it on GitHub https://github.com/jonescompneurolab/hnn-core/pull/388#issuecomment-1079776723, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADY6FIWHK5DZ22TE5BDQ3T3VB55QBANCNFSM473WZMDA . You are receiving this because you commented.Message ID: @.***>

-- Sent from my iPhone

jasmainak avatar Mar 26 '22 22:03 jasmainak

@ntolley looking at your jupyter-notebook on the alpha-beta tutorial made me come back to this PR. Do you think you could rebase so I can check how the doc builds look?

jasmainak avatar Jul 24 '22 09:07 jasmainak