Skip to content

Commit 1cec794

Browse files
Add Elapsed and Remaining columns
1 parent 4945153 commit 1cec794

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

pymc/sampling/parallel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def __iter__(self):
523523
self._desc.format(self),
524524
completed=0,
525525
draws=0,
526-
total=self._total_draws,
526+
total=self._total_draws - 1,
527527
chain_idx=chain_idx,
528528
sampling_speed=0,
529529
speed_unit="draws/s",

pymc/util.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@
3232
from pytensor.graph.utils import ValidatingScratchpad
3333
from rich.box import SIMPLE_HEAD
3434
from rich.console import Console
35-
from rich.progress import BarColumn, Progress, Task, TextColumn
35+
from rich.progress import (
36+
BarColumn,
37+
Progress,
38+
Task,
39+
TextColumn,
40+
TimeElapsedColumn,
41+
TimeRemainingColumn,
42+
)
3643
from rich.style import Style
3744
from rich.table import Column, Table
3845
from rich.theme import Theme
@@ -59,6 +66,8 @@ def __getattr__(name):
5966
{
6067
"bar.complete": "#1764f4",
6168
"bar.finished": "green",
69+
"progress.remaining": "none",
70+
"progress.elapsed": "none",
6271
}
6372
)
6473

@@ -700,7 +709,9 @@ def create_progress_bar(step_columns, init_stat_dict, progressbar, progressbar_t
700709
TextColumn(
701710
"{task.fields[sampling_speed]:0.2f} {task.fields[speed_unit]}",
702711
table_column=Column("Sampling Speed", ratio=1),
703-
)
712+
),
713+
TimeElapsedColumn(table_column=Column("Elapsed", ratio=1)),
714+
TimeRemainingColumn(table_column=Column("Remaining", ratio=1)),
704715
]
705716

706717
return CustomProgress(

0 commit comments

Comments
 (0)