sisl
sisl copied to clipboard
Enabling/disabling progress bars globally
Do you think it could make sense that all progress bars shown in sisl could be disabled/enabled with just one parameter?
E.g. with an env variable SISL_PROGRESSBARS
or some global switch like sisl.progress_bars()
.
Since the plots in sisl.viz
might be a bit of a black box I want to give the option to the user to show the progress bars for some calculations to understand if the code is working or infinitely stuck. However, I don't want to create an extra setting just for that in every case where there may be a progress bar.
Therefore I thought a global switch could be a neat solution.
Sounds like a good idea. However, it may be a bit excessive with progress bars all the time.
I think it would be ideal to have a context manager that globally sets this, this would make it a bit more flexible I think.
And the env-variable, perhaps SISL_SHOW_PROGRESS
? makes it clear that this is a visible thing?
Sure, the only true proposal here was the concept, not the specifics. However you prefer to implement it is fine for me!
Also it sure seems better to include SHOW
in the env variable name. SISL_SHOW_PROGRESS
sounds good to me!
I'll have a go at this asap
Fixed in bba363b1c, note this doesn't allow dynamic control. I.e. it is defined at import of sisl
.
Still needing a context manager. But that should be rather trivially solved.
Nice! Thank you very much, this solves my request already :+1:
I'm curious though, you deliberately made it non dynamic from what I understand reading the code (I mean it could have very easily been dynamic). Is this because of efficiency?
I'm curious though, you deliberately made it non dynamic from what I understand reading the code (I mean it could have very easily been dynamic). Is this because of efficiency?
Yeah both efficiency, which shouldn't do much since the routines having eta
are heavy by them-selves. But rather making sure that users requests are obeyed. I don't know... ;)