-
Notifications
You must be signed in to change notification settings - Fork 25
feat: Add tqdm progress bar with Rust callback support (fixes #25) #71
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
feat: Add tqdm progress bar with Rust callback support (fixes #25) #71
Conversation
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
|
Thank you for opening this PR! Our automated system is currently verifying the PR requirements. |
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
1 similar comment
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
- Allow deprecated with_gil (temporary fix) - Allow unused train method in model.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a tqdm-based training progress bar by introducing a Rust→Python progress callback, keeping the epoch loop in Rust while updating progress display in Python.
Changes:
- Extend the PyO3
EtnaModel.train()binding to accept an optionalprogress_callback. - Add
SimpleNN::train_with_callback()to invoke a callback after each epoch. - Update Python
Model.train()to use tqdm + callback, add tqdm dependency, and add a mock-based test.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
etna_core/src/lib.rs |
Adds progress_callback parameter to the PyO3 train() binding and invokes a Python callback from Rust. |
etna_core/src/model.rs |
Introduces train_with_callback() to run training while reporting per-epoch progress. |
etna/api.py |
Wraps training with a tqdm progress bar and passes a callback into Rust. |
tests/test_tqdm_progress.py |
Adds a mock-based test ensuring train() is called once and a callback is passed. |
setup.py |
Adds tqdm to install requirements. |
requirements.txt |
Adds tqdm dependency. |
pyproject.toml |
Adds tqdm to project dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
- Use py argument directly instead of with_gil (fixes deprecation and syntax error) - Ensure closure captures py correctly for safe callback execution
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
1 similar comment
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
debug-soham
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested Actions:
- Update
api.pyto include the actualtqdmlogic (imports and progress bar handling). - Restore the
hidden_layers: listarchitecture inapi.pyto prevent system crashes. - Clean up
model.rsby refactoring thetrainmethod to reuse the callback logic.
The test_tqdm_progress.py script is a great addition. Once the api.py regressions are fixed, re-submit for approval.
Validation Successful!This pull request has been verified and linked to issue #25. The system is now synchronizing metadata from the referenced issue. Kindly await maintainer review of your changes. |
|
@debug-soham SummaryAddresses all suggested actions from the previous review. Closes #25 Suggested Actions Addressed
Testing38/38 Python tests passed Screenshot
|
Aamod007
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@verdhanyash Good work, Approved!
|
This PR has been successfully merged. We appreciate your effort in improving the library and look forward to your future contributions to the Etsi AI ecosystem. |


Summary
Implements a tqdm progress bar for training using a Rust-to-Python callback mechanism. This preserves performance by keeping the training loop entirely in Rust while providing live progress updates to Python.
Closes #25
Changes
Rust Core
progress_callbackparameter totrain()train_with_callback()method that calls the provided closure after each epochPython API
epochs=100passed directly)Dependencies
tqdm>=4.64.0to requirementsTesting
train()is called once for all epochsScreenShot