Create a progress bar taking into account ``inst.verbose``.
(inst, X, message)
| 776 | |
| 777 | |
| 778 | def _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 | |
| 792 | def _check_verbose(verbose): |
no test coverage detected