diff --git a/source/isaaclab_tasks/changelog.d/mataylor-fix-tqdm-ci-logs.rst b/source/isaaclab_tasks/changelog.d/mataylor-fix-tqdm-ci-logs.rst new file mode 100644 index 000000000000..a67a9ed5fcdd --- /dev/null +++ b/source/isaaclab_tasks/changelog.d/mataylor-fix-tqdm-ci-logs.rst @@ -0,0 +1,8 @@ +Fixed +^^^^^ + +* Fixed the "Prefilling reset buffer" progress bar in + :func:`~isaaclab_tasks.core.lift.mdp.events` rendering as garbled block + characters in GitHub Actions logs. The :class:`tqdm` bar is now disabled when + ``stderr`` is not a TTY; a plain :mod:`logging` message is emitted at the + start and on completion so CI logs still show meaningful progress. diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/mdp/events.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/mdp/events.py index cc4f86a2a3ef..6822301dd724 100644 --- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/mdp/events.py +++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/mdp/events.py @@ -7,6 +7,8 @@ from __future__ import annotations +import logging +import sys from typing import TYPE_CHECKING import numpy as np @@ -14,6 +16,8 @@ import warp as wp from tqdm import tqdm +_log = logging.getLogger(__name__) + import isaaclab.sim as sim_utils from isaaclab import cloner from isaaclab.managers import EventTermCfg, ManagerTermBase, ManagerTermBaseCfg, SceneEntityCfg @@ -368,11 +372,13 @@ def roll_once(roll_ids: torch.Tensor) -> torch.Tensor: # not cover all groups, and a group with no rolled envs could never fill all_ids = torch.arange(env.num_envs, device=env.device) + _log.info("Prefilling reset buffer: 0/%d states", num_groups * harvest_size) with tqdm( total=num_groups * harvest_size, desc="Prefilling reset buffer", unit="state", dynamic_ncols=True, + disable=not sys.stderr.isatty(), ) as progress: while not bool((self._fill >= harvest_size).all()): if max_prefill_iters is not None and iteration >= max_prefill_iters: @@ -414,6 +420,7 @@ def roll_once(roll_ids: torch.Tensor) -> torch.Tensor: self._descriptor[row : row + len(take)] = feature self._fill[group] += len(take) progress.update(len(take)) + _log.info("Prefilling reset buffer: done (%d states)", num_groups * harvest_size) if diversity_feature is not None: self._keep_most_spread(num_groups, harvest_size, buffer_size_per_group) if success_monitor is not None: