Return a string-based progress bar given some parameters Parameters ---------- n : int or float Number of finished iterations. total : int or float The expected total number of iterations. If meaningless (None), only bas
(n, total, elapsed, ncols=None, prefix='', ascii=False, unit='it',
unit_scale=False, rate=None, bar_format=None, postfix=None,
unit_divisor=1000, initial=0, colour=None, **extra_kwargs)
| 463 | |
| 464 | @staticmethod |
| 465 | def format_meter(n, total, elapsed, ncols=None, prefix='', ascii=False, unit='it', |
| 466 | unit_scale=False, rate=None, bar_format=None, postfix=None, |
| 467 | unit_divisor=1000, initial=0, colour=None, **extra_kwargs): |
| 468 | """ |
| 469 | Return a string-based progress bar given some parameters |
| 470 | |
| 471 | Parameters |
| 472 | ---------- |
| 473 | n : int or float |
| 474 | Number of finished iterations. |
| 475 | total : int or float |
| 476 | The expected total number of iterations. If meaningless (None), |
| 477 | only basic progress statistics are displayed (no ETA). |
| 478 | elapsed : float |
| 479 | Number of seconds passed since start. |
| 480 | ncols : int, optional |
| 481 | The width of the entire output message. If specified, |
| 482 | dynamically resizes `{bar}` to stay within this bound |
| 483 | [default: None]. If `0`, will not print any bar (only stats). |
| 484 | The fallback is `{bar:10}`. |
| 485 | prefix : str, optional |
| 486 | Prefix message (included in total width) [default: '']. |
| 487 | Use as {desc} in bar_format string. |
| 488 | ascii : bool, optional or str, optional |
| 489 | If not set, use unicode (smooth blocks) to fill the meter |
| 490 | [default: False]. The fallback is to use ASCII characters |
| 491 | " 123456789#". |
| 492 | unit : str, optional |
| 493 | The iteration unit [default: 'it']. |
| 494 | unit_scale : bool or int or float, optional |
| 495 | If 1 or True, the number of iterations will be printed with an |
| 496 | appropriate SI metric prefix (k = 10^3, M = 10^6, etc.) |
| 497 | [default: False]. If any other non-zero number, will scale |
| 498 | `total` and `n`. |
| 499 | rate : float, optional |
| 500 | Manual override for iteration rate. |
| 501 | If [default: None], uses n/elapsed. |
| 502 | bar_format : str, optional |
| 503 | Specify a custom bar string formatting. May impact performance. |
| 504 | [default: '{l_bar}{bar}{r_bar}'], where |
| 505 | l_bar='{desc}: {percentage:3.0f}%|' and |
| 506 | r_bar='| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, ' |
| 507 | '{rate_fmt}{postfix}]' |
| 508 | Possible vars: l_bar, bar, r_bar, n, n_fmt, total, total_fmt, |
| 509 | percentage, elapsed, elapsed_s, ncols, nrows, desc, unit, |
| 510 | rate, rate_fmt, rate_noinv, rate_noinv_fmt, |
| 511 | rate_inv, rate_inv_fmt, postfix, unit_divisor, |
| 512 | remaining, remaining_s, eta. |
| 513 | Note that a trailing ": " is automatically removed after {desc} |
| 514 | if the latter is empty. |
| 515 | postfix : *, optional |
| 516 | Similar to `prefix`, but placed at the end |
| 517 | (e.g. for additional stats). |
| 518 | Note: postfix is usually a string (not a dict) for this method, |
| 519 | and will if possible be set to postfix = ', ' + postfix. |
| 520 | However other types are supported (#382). |
| 521 | unit_divisor : float, optional |
| 522 | [default: 1000], ignored unless `unit_scale` is True. |
no test coverage detected