Skip to content

Fix progress output in non-interactive shells#2759

Open
aryasalem09 wants to merge 1 commit into
Parcels-code:mainfrom
aryasalem09:fix-noninteractive-progress
Open

Fix progress output in non-interactive shells#2759
aryasalem09 wants to merge 1 commit into
Parcels-code:mainfrom
aryasalem09:fix-noninteractive-progress

Conversation

@aryasalem09

Copy link
Copy Markdown

Description

Adds automatic TTY detection to the ParticleSet.execute progress bar.

Passing disable=None to tqdm preserves the progress bar in interactive terminals while suppressing it when stdout is redirected to a non-interactive environment, such as a Slurm job log.

The added regression test verifies both interactive and non-interactive stdout behavior without depending on exact progress-bar formatting.

Validation

  • pixi run pytest tests/test_particleset.py -q

    • 26 passed
  • pixi run lint

    • All hooks passed
  • pixi run typing

    • Success: no issues found in 41 source files
  • git diff --check

    • Passed

Checklist

AI Disclosure

  • This PR contains AI-generated content.

    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
    • I used Codex to inspect the relevant code, propose the minimal implementation, and help design the regression test. I manually reviewed and understood every changed line and ran the project’s test, lint, and typing checks.

[This draft pull request was opened by Codex on behalf of @aryasalem09.]

Co-authored-by: Codex <noreply@anthropic.com>
@aryasalem09
aryasalem09 marked this pull request as ready for review July 17, 2026 22:40
@VeckoTheGecko

Copy link
Copy Markdown
Contributor

Hi @aryasalem09, thanks for the PR! I'm not 100% sure if this PR is something that we're willing to accept though. A significant workflow of our users is to monitor SLURM log files and disabling the progressbar for not TTY shells will hide this output and make things confusing for users.

This is unfortunately a low-priority issue with also no real clear solution :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Change progress bar to not print a new line to logs in non-interactive shells

2 participants