Skip to content
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

ENH: Disable all progress bars #7151

Open
JakeSummers opened this issue Feb 12, 2024 · 3 comments
Open

ENH: Disable all progress bars #7151

JakeSummers opened this issue Feb 12, 2024 · 3 comments

Comments

@JakeSummers
Copy link

JakeSummers commented Feb 12, 2024

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:

pm.sample(samples, random_seed=random_seed)

To:

pm.sample(samples, random_seed=random_seed, progressbar=False)

It would make my code better, if I could do something like:

pm.progress_bar(False)

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: fastai/fastprogress#105

Copy link

welcome bot commented Feb 12, 2024

Welcome Banner]
🎉 Welcome to PyMC! 🎉 We're really excited to have your input into the project! 💖

If you haven't done so already, please make sure you check out our Contributing Guidelines and Code of Conduct.

@JakeSummers
Copy link
Author

JakeSummers commented Feb 12, 2024

Workaround from: fastai/fastprogress#105 (comment)

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.

@ricardoV94
Copy link
Member

Not counting on switching that dependency anytime soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants