MCPcopy
hub / github.com/mne-tools/mne-python / _create_progressbar_context

Function _create_progressbar_context

mne/decoding/search_light.py:778–789  ·  view source on GitHub ↗

Create a progress bar taking into account ``inst.verbose``.

(inst, X, message)

Source from the content-addressed store, hash-verified

776
777
778def _create_progressbar_context(inst, X, message):
779 """Create a progress bar taking into account ``inst.verbose``."""
780 multiply = len(inst.estimators_) if isinstance(inst, GeneralizingEstimator) else 1
781 n_steps = X.shape[-1] * max(1, multiply)
782 mesg = f"{message} {inst.__class__.__name__}"
783
784 which_tqdm = "off" if not _check_verbose(inst.verbose) else None
785 context = ProgressBar(
786 n_steps, mesg=mesg, position=inst.position, which_tqdm=which_tqdm
787 )
788
789 return context
790
791
792def _check_verbose(verbose):

Callers 4

fitMethod · 0.85
_transformMethod · 0.85
_transformMethod · 0.85
scoreMethod · 0.85

Calls 2

_check_verboseFunction · 0.85
ProgressBarClass · 0.85

Tested by

no test coverage detected