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
No way to customize template parameters/units #299
Comments
Can you be more concrete about the changes you made/what kind of data you want to show, and what is missing to support that? |
In short, I want to be able to define a function that can reference the Here are the changes that I have made to support my use case (the code doesn't seem to inline in github for me for whatever reason): https://github.com/redzic/indicatif/blob/7fc8131591e41d1d26edb8f2e6fefec50ff8cdbc/src/style.rs#L264 For my use case, I would like to display the iterations per second with more precision and with a different unit. If you use Using I was thinking that the easiest way to support this is to just have the ability to dynamically add keys that I could take a stab at implementing this if the design is good, otherwise there could be some discussion to be had as to how to achieve this. |
I think it would be okay to have support for custom template keys which get a |
Fixed by #301 ! Thanks |
Thank you for getting it done! |
Currently, I have forked
indicatif
to add an easier way to display the frames per second of an encode. I did this because callingset_message
seems to add significant "flashing" to the progress bar, whereas just using the templates does not seem to cause this issue. Furthermore, I do not want to have to duplicate data structures for keeping track of the frames per second when this is already kept track of by aProgressBar
. For example,tqdm
has a way of specifying the units and using more precision for the iterations per second, which doesn't seem to be currently possible with indicatif, unless the unit you want to use is bytes per second.Maybe there could be some function to be called that adds user-defined functions to the template parser.
The text was updated successfully, but these errors were encountered: