Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Change tqdm import so it automatically detects whether it is rendering within a notebook #390

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

melisande-c
Copy link
Member

Description

Note

tldr: tqdm has functionality to automatically detect whether it is rendering from within a notebook or not, but it has to be imported from tqdm.auto. Doing this will improve the rendering of progress bars within notebooks. See tqdm docs

Background - why do we need this PR?

Progress bar rendering was pretty ugly within notebooks, especially when using jupyter directly.

Overview - what changed?

tqdm import.

Implementation - how did you implement the changes?

Do from tqdm.auto import tqdm instead of import tqdm.

Changes Made

Modified features or files

  • import in careamics/lightning/callbacks/progress_bar_callback.py

How has this been tested?

  • Looked at progress bar outputs in a notebook. (But haven't checked normal script).

Please ensure your PR meets the following requirements:

  • Code builds and passes tests locally, including doctests
  • New tests have been added (for bug fixes/features)
  • Pre-commit passes
  • PR to the documentation exists (for bug fixes / features)

@melisande-c melisande-c merged commit 9f0e818 into main Feb 4, 2025
18 checks passed
@melisande-c melisande-c deleted the mc/fix/tqdm-import branch February 4, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants