vincent-maillou / qttools

Quantum Transport Algorithms Toolbox
GNU General Public License v3.0
5 stars 1 forks source link

Package-wide profiling (and maybe logging) #44

Open vetschn opened 3 weeks ago

vetschn commented 3 weeks ago

I had the idea of adding a custom package-wide profiling utility based on a singleton that is imported in all modules that we want to profile. Unfortunately i have not found anything that does this already, but it is also not so hard to implement. I think it's obvious that this could give us several advantages over print statements in the whole code:

I already put together a bare-bones version of this in this gist.

We could follow the same strategy for logging, switching the code into debug mode with some simple flag. This can probably also be done with Python's built-in logging module.

Any thoughts on this?