progress_monitor#

Progress monitor for pipeline execution.

Provides a context manager that runs a PipelineProgressApp Textual TUI in a daemon thread, polling the SQLite database for live progress updates.

Classes#

LogProgressMonitor

Simple timestamped log-line progress monitor.

ProgressMonitor

Context manager that runs a Textual TUI in a daemon thread.

Functions#

start_progress_monitor(...)

Create and return a progress monitor for pipeline execution.

Module Contents#

class physicsnemo_curator.run.progress_monitor.LogProgressMonitor(store: Any, poll_interval: float = 5.0)[source]#

Simple timestamped log-line progress monitor.

Prints progress percentage with timestamps to stdout. Suitable for notebooks, scripts, and non-interactive environments where the full-screen Textual TUI is not appropriate.

Also prints log entries from worker processes that were written to the database.

Parameters:
  • store (PipelineStore) – Pipeline store instance (used for read-only polling).

  • poll_interval (float) – Seconds between progress polls (default 5.0).

  • monitor. (Initialise the log progress)

start() None[source]#

Start the polling thread.

stop() None[source]#

Signal the thread to stop and wait for it.

class physicsnemo_curator.run.progress_monitor.ProgressMonitor(
store: Any,
n_workers: int,
invocation_id: str | None = None,
)[source]#

Context manager that runs a Textual TUI in a daemon thread.

The TUI polls the pipeline’s SQLite database and displays an overall progress bar plus per-worker progress tiles.

Parameters:
  • store (PipelineStore) – Pipeline store instance (used for read-only polling).

  • n_workers (int) – Number of parallel workers.

  • invocation_id (str | None) – If set, filter workers by this invocation ID.

  • monitor. (Initialise the progress)

start() None[source]#

Start the Textual TUI in a daemon thread.

stop() None[source]#

Signal the TUI to exit and wait for the thread to finish.

physicsnemo_curator.run.progress_monitor.start_progress_monitor(
pipeline: physicsnemo_curator.core.base.Pipeline[Any],
config: physicsnemo_curator.run.base.RunConfig,
) ProgressMonitor | LogProgressMonitor[source]#

Create and return a progress monitor for pipeline execution.

Returns a ProgressMonitor that runs a Textual TUI in a daemon thread, or a LogProgressMonitor that prints timestamped progress lines to the console.

Parameters:
  • pipeline (Pipeline) – The pipeline being executed.

  • config (RunConfig) – Execution configuration.

Returns:

An active progress monitor (TUI or log-based).

Return type:

ProgressMonitor | LogProgressMonitor