lenskit.logging.progress#
Classes#
Base class for progress reporting. The default implementations do nothing. |
Functions#
|
Create a progress bar for distinct, counted items. |
Set the progress bar implementation. |
|
|
|
|
Package Contents#
- class lenskit.logging.progress.Progress(*args, uuid=None, total=None, **kwargs)#
Base class for progress reporting. The default implementations do nothing.
- classmethod handle_message(update)#
- Parameters:
update (lenskit.logging.multiprocess._protocol.ProgressMessage)
- update(advance=1, completed=None, total=None, **kwargs)#
Update the progress bar.
- finish()#
Finish and clean up this progress bar. If the progresss bar is used as a context manager, this is automatically called on context exit.
- __enter__()#
- __exit__(*args)#
- Parameters:
args (Any)
- lenskit.logging.progress.item_progress(label, total=None, fields=None)#
Create a progress bar for distinct, counted items.
- Parameters:
label (str) – The progress bar label.
total (int | None) – The total number of items.
fields (collections.abc.Mapping[str, str | None] | None) – Additional fields to report with the progress bar (such as a current loss). These are specified as a dictionary mapping field names to format strings (the pieces inside
{...}instr.format()), and the values come from extra kwargs toProgress.update(); mapping toNoneuse defaultstrformatting.
- Return type:
- lenskit.logging.progress.set_progress_impl(name: Literal['rich', 'notebook', 'none'] | None) None#
- lenskit.logging.progress.set_progress_impl(backend: ProgressBackend, /) None
Set the progress bar implementation.