Forum Navigation
You need to log in to create posts and topics.

Progress bars for python scripting work

I find that for my workflow, generating trajectories is far quicker from the python interface. Unfortunately the lack of information regarding progress makes it difficult to tell whether going from loading the file to final render is going to take 5 minutes or 5 hours without just waiting! It also means I have no idea whether the render is taking ages, or has in fact just crashed!

 

Would it be possible to integrate TQDM or a similar progress bar library in such that an approximate run time can be seen?

Dear Matt,

Alex will probably answer in a moment, but isn't it what you are looking for?

https://www.ovito.org/docs/current/python/introduction/custom_modifiers.php#long-running-modifier-functions

Best regards,

Arkadii

Matt,

Thanks for the suggestions. That's in fact something I was planning to add in the near future.

It may not be possible to integrate TQDM though, because OVITO has its own internal progress reporting system on the C++ side. I'm not sure if it can be interfaced with TQDM on the Python side. But at the very least I plan to add an option that will forward the text messages you normally see in the status bar of the GUI to the text terminal when running in Python mode. That would give one at least some indication of what OVITO is currently doing (e.g. importing file data, long-running modifier calculations, rendering an animation frame, etc.).

@Arkadii: The feature you are referring to is something else. You can let long-running Python modifier functions report their progress in the GUI with this. Matt, however, wants to see the progress of built-in modifiers and other OVITO operations in the terminal when running a batch script.

Alex,

thank you for the clarification. Indeed, it would be a nice feature sometimes. I hope it will have a switch for verbosity, though 🙂

 

 

Matt, please take a look at the new OVITO build dev681, where I've added the option to let OVITO print activity messages to the terminal while executing a Python script:

https://www.ovito.org/docs/current/python/modules/ovito.php#ovito.enable_logging

Any feedback is appreciated. This new capability is rather rudimentary, but I think it is a first step and gives us at least a clue what OVITO is doing at any moment.