Basic Progress Bar for Mojo
Based on a discussion we had here on Discord, I implemented a basic progress bar in Mojo and put it on Github
https://github.com/dorjeduck/mopro
Just when i published it, @Ryulord pointed out another progress bar implementation to me, which he is about to introduce here. His implementation looks for sure more advanced, so look out for it (i leave it to him to post the link here .when he is ready) Nevertheless, I wiill keep my implementation on github for the time being, may it benefit.
GitHub
GitHub - dorjeduck/mopro: Progress Bar for Mojo
Progress Bar for Mojo. Contribute to dorjeduck/mopro development by creating an account on GitHub.
7 Replies
should that be the default setting? 😉
![No description](https://cdn.answeroverflow.com/1244658357264978050/example2.png)
Today it dawned on me that the usage of
progress_bar
is quite similar to Mojo's vectorize
. Feeling a burst of creativity, I decided to combine them into one function: vectorize_bar
The vectorized progress bar increases less smoothly since it is updated in width
steps after each function call—nothing comes for free, right? 😉vectorization rocks 🚀 well we know this already but having both
progress_bar
and vectorize_bar
available, visualizes this nicely ... 😉
(output of https://github.com/dorjeduck/progressbar.mojo/blob/main/example_vectorizebar_2.mojo)![No description](https://cdn.answeroverflow.com/1245062760924971088/Screenshot_2024-05-28_at_22.40.26.png)
To wrap up this project, I added the possibility for runtime customization today. For instance, you can now display additional information, like the current value of the loss function, alongside the progress bar. (as we know it from tqdm)
Any feedback, feature suggestions, or pull requests are most welcome!
![No description](https://cdn.answeroverflow.com/1245204329410068582/done.png)
Wow epic @Martin Dudek, we should use this for the official installer 🔥
Thanks, @Jack Clayton! Of course feel free to modify and improve it to fit specific needs if you really want to use it for the installer
Currently, the customization options are quite basic, and I'm unsure how it performs across different systems, as console output can be tricky. I'm looking forward to community feedback and PRs to help make it stable and useful for a variety of use cases.
Congrats @Martin Dudek, you just advanced to level 12!