Open JakeSummers opened 9 months ago
]
:tada: Welcome to PyMC! :tada: We're really excited to have your input into the project! :sparkling_heart:
If you haven't done so already, please make sure you check out our Contributing Guidelines and Code of Conduct.
Workaround from: https://github.com/fastai/fastprogress/issues/105#issuecomment-1939645396
It looks like this is possible like this:
import fastprogress.fastprogress fastprogress.fastprogress.NO_BAR = True
If you also want to disable the output from
master_bar.write
, you can do this:def do_nothing(*args): pass fastprogress.fastprogress.WRITER_FN = do_nothing
I wonder if this should be added to pymc's api so that if/when the fastprogress dependency is switched for something else, that we will keep the same structure.
Not counting on switching that dependency anytime soon
Can we get some discussion going around the interface for this feature? Is a global pm.progress_bar=False
what we want? We don't currently have any high-level configuration settings that work like this. Or maybe we want some sort of logging verbosity setting?
Environment variables feel like a good fit for configuring global things like this, especially when it comes to output. You can also provide Python to helpers for setting these values for folks who want to be able to configure this in Python.
For example the progress bar could check if os.environ.get("PYMC_SHOW_PROGRESS", true)
and you could provide pm.show_process(False)
which would set the variable.
Context for the issue:
Currently the progress bars printed by
pymc
are printed to stdout in my backend service. They often corrupt the structured logs that my service prints.Right now, I need to go through my code to disable all of the progress bars.
Aka I need to, update from:
To:
It would make my code better, if I could do something like:
And that would disable all progress bars in pymc.
This would allow me to make my code easy to use with the backend service we integrate with but also to use in notebooks or IDEs.
Related: https://github.com/fastai/fastprogress/issues/105