MDANSE icon indicating copy to clipboard operation
MDANSE copied to clipboard

[ENHANCEMENT] Job progress reporting (in command line)

Open MBartkowiakSTFC opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. Users running the jobs without the GUI would like to receive more information about the progress of their jobs.

This could be combined with timing information https://github.com/ISISNeutronMuon/MDANSE/issues/559

Describe the solution you'd like We can:

  • write information to standard output (for interactive sessions),
  • rely on the log files for progress information (for batch jobs).

Describe alternatives you've considered N/A

Additional context This subject is still open for discussion.

MBartkowiakSTFC avatar Nov 14 '24 15:11 MBartkowiakSTFC

There're several tools available for reporting progress, particularly in CLI environments which provide e.g. progress bars, timing estimates, etc.

  • tqdm is probably the most commonly used. Provides both simple wrappers on iterators and context managers.
  • rich - A more recent entry which is primarily a rich-text engine, but provides progress bars as part of its core features.
  • alive-progress - A primarily decorative progress bar library with spinners which always update to ensure that progress isn't frozen.

I would probably advise on using tqdm, injecting it into the init, run_step and finalise components of MDANSE.Framework.Jobs.IJob.IJob. It may be possible to even use it to provide regular information on progress to the GUI (such as time/iteration and estimated time remaining) automatically which may be useful. tqdm also has plugins which allow it to interface with QTConsole environments and possibly others.

oerc0122 avatar Mar 11 '25 11:03 oerc0122