Skip to content

Commit 1fb5e37

Browse files
authored
Enable rich's auto-refresh for live displays. (#139)
1 parent ebb748d commit 1fb5e37

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

docs/source/changes.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ all releases are available on `PyPI <https://pypi.org/project/pytask>`_ and
77
`Anaconda.org <https://anaconda.org/conda-forge/pytask>`_.
88

99

10-
0.1.1 - 2021-xx-xx
10+
0.1.1 - 2021-08-25
1111
------------------
1212

1313
- :gh:`138` changes the default verbosity to ``1`` which displays the live table during
1414
execution and ``0`` display the symbols for outcomes (e.g. ``.``, ``F``, ``s``).
15+
- :gh:`139` enables rich's auto-refresh mechanism for live objects which causes almost
16+
no performance penalty for the live table compared to the symbolic output.
1517

1618

1719
0.1.0 - 2021-07-20

src/_pytask/live.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class LiveManager:
3333
3434
"""
3535

36-
_live = Live(renderable=None, console=console, auto_refresh=False)
36+
_live = Live(renderable=None, console=console, auto_refresh=True)
3737

3838
def start(self):
3939
self._live.start()
@@ -56,9 +56,6 @@ def resume(self):
5656
def update(self, *args, **kwargs):
5757
self._live.update(*args, **kwargs)
5858

59-
def refresh(self):
60-
self._live.refresh()
61-
6259
@property
6360
def is_started(self):
6461
return self._live.is_started
@@ -105,7 +102,6 @@ def _generate_table(self):
105102
def _update_table(self):
106103
table = self._generate_table()
107104
self._live_manager.update(table)
108-
self._live_manager.refresh()
109105

110106
def update_running_tasks(self, new_running_task):
111107
reduced_task_name = reduce_node_name(new_running_task, self._paths)
@@ -160,7 +156,6 @@ def _update_statistics(self, reports):
160156
def _update_status(self):
161157
status = self._generate_status()
162158
self._live_manager.update(status)
163-
self._live_manager.refresh()
164159

165160
def _generate_status(self):
166161
msg = f"Collected {self._n_collected_tasks} tasks."

0 commit comments

Comments
 (0)