progress_app#
Textual TUI application for pipeline progress display.
Renders a compact full-screen terminal UI with an overall progress bar, a 2x4 grid of single-line per-worker status indicators (paginated for >8 workers), and a live log panel. Polls the SQLite database every 0.5 seconds for live updates.
Classes#
Compact full-screen Textual app for pipeline progress monitoring. |
Module Contents#
- class physicsnemo_curator.run.progress_app.PipelineProgressApp(
- store: physicsnemo_curator.core.pipeline_store.PipelineStore,
- n_workers: int,
- stop_event: threading.Event,
- invocation_id: str | None = None,
Bases:
textual.app.App[None]Compact full-screen Textual app for pipeline progress monitoring.
Displays an overall progress bar, a 2x4 grid of single-line per-worker status indicators with pagination for >8 workers, and a scrolling log panel that captures
print()output and Pythonloggingmessages.- Parameters:
store (PipelineStore) – Pipeline store instance for polling progress data.
total (int) – Total number of indices to process.
n_workers (int) – Number of expected workers.
stop_event (Event) – Threading event signalling pipeline completion.
invocation_id (str | None) – If set, only show workers from this invocation.
app. (Initialise the progress)
- append_log(text: str) None[source]#
Append a line of text to the log panel.
- Parameters:
text (str) – Text to write.
- on_print(event: textual.events.Print) None[source]#
Handle captured print() output by writing it to the log panel.
- Parameters:
event (Print) – Textual event containing the captured text.
- BINDINGS = [('q', 'quit', 'Quit'), ('[', 'prev_page', 'Prev'), (']', 'next_page', 'Next')]#
The default key bindings.
- CSS = Multiline-String#
Show Value
""" #overall-container { height: auto; padding: 0 2; } #overall-label { margin-bottom: 0; color: $text-muted; } #worker-grid { grid-size: 2; grid-gutter: 0 2; padding: 0 2; height: auto; max-height: 6; } #page-nav { height: 1; padding: 0 2; color: $text-muted; } #log-panel { height: 1fr; min-height: 6; border: solid $accent; margin: 0 2 0 2; } """
Inline CSS, useful for quick scripts. This is loaded after CSS_PATH, and therefore takes priority in the event of a specificity clash.
- TITLE = 'PhysicsNeMo Curator — Pipeline Progress'#
A class variable to set the default title for the application.
To update the title while the app is running, you can set the [title][textual.app.App.title] attribute. See also [the Screen.TITLE attribute][textual.screen.Screen.TITLE].