lenskit.logging.progress#

Classes#

Progress

Base class for progress reporting. The default implementations do nothing.

Functions#

item_progress(label[, total, fields])

Create a progress bar for distinct, counted items.

set_progress_impl(…)

Set the progress bar implementation.

item_progress_handle(*args, **kwargs)

pbh_update(h[, incr])

Package Contents#

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 {...} in str.format()), and the values come from extra kwargs to Progress.update(); mapping to None use default str formatting.

Return type:

lenskit.logging.progress._base.Progress

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.

lenskit.logging.progress.item_progress_handle(*args, **kwargs)#
Parameters:
  • args (lenskit.logging.progress._dispatch.item_progress.args)

  • kwargs (lenskit.logging.progress._dispatch.item_progress.kwargs)

Return type:

Generator[str, None, None]

lenskit.logging.progress.pbh_update(h, incr=1)#
Parameters:
Return type:

None