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

disable by default the progress bar. Only activate with large samples #28

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cobaya_utilities/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def get_mc_samples(
selected=None,
excluded=None,
select_first=None,
no_progress_bar=True,
):
"""Print MCMC sample size given a set of directories

Expand All @@ -176,6 +177,8 @@ def get_mc_samples(
list of excluded samples
select_fist: str
set the name of the first sample to return
no_progress_bar: bool
either enable or disable progress bar from tqdm
"""
from getdist.plots import loadMCSamples
from tqdm.auto import tqdm
Expand All @@ -197,7 +200,7 @@ def get_mc_samples(

default_prefix = prefix
samples, labels, colors = [], [], []
for name in (pbar := tqdm(selected)):
for name in (pbar := tqdm(selected, disable=no_progress_bar)):
pbar.set_description(f"Loading '{name}'")
value = mcmc_samples[name]
if isinstance(value, str):
Expand Down