documentation fixes and improvements

This commit is contained in:
Casper da Costa-Luis 2015-11-09 12:25:11 +00:00
parent 370780a74a
commit 18c0111e6a
1 changed files with 64 additions and 60 deletions

View File

@ -71,67 +71,71 @@ Documentation
def __init__(self, iterable=None, desc=None, total=None, leave=False,
file=sys.stderr, ncols=None, mininterval=0.1,
miniters=None, ascii=None, disable=False,
unit='it', unit_scale=False, gui=False, dynamic_ncols=False):
"""
Parameters
----------
iterable : iterable, optional
Iterable to decorate with a progressbar.
Leave blank [default: None] to manually manage the updates.
desc : str, optional
Prefix for the progressbar [default: None].
total : int, optional
The number of expected iterations. If not given, len(iterable) is
used if possible. As a last resort, only basic progress
statistics are displayed (no ETA, no progressbar). If `gui` is
True and this parameter needs subsequent updating, specify an
initial arbitrary large positive integer, e.g. int(9e9).
leave : bool, optional
If [default: False], removes all traces of the progressbar
upon termination of iteration.
file : `io.TextIOWrapper` or `io.StringIO`, optional
Specifies where to output the progress messages
[default: sys.stderr]. Uses `file.write(str)` and `file.flush()`
methods.
ncols : int, optional
The width of the entire output message. If specified, dynamically
resizes the progressbar to stay within this bound. If
[default: None], attempts to use environment width. The fallback
is a meter width of 10 and no limit for the counter and
statistics. If 0, will not print any meter (only stats).
mininterval : float, optional
Minimum progress update interval, in seconds [default: 0.1].
miniters : int, optional
Minimum progress update interval, in iterations [default: None].
If specified, will set `mininterval` to 0.
ascii : bool, optional
If [default: None] or false, use unicode (smooth blocks) to fill
the meter. The fallback is to use ASCII characters `1-9 #`.
disable : bool
Whether to disable the entire progressbar wrapper [default: False].
unit : str, optional
String that will be used to define the unit of each iteration
[default: 'it'].
unit_scale : bool, optional
If set, the number of iterations will be reduced/scaled
automatically and a metric prefix following the
International System of Units standard will be added
(kilo, mega, etc.) [default: False].
gui : bool, optional
If set, will attempt to use matplotlib animations for a
graphical output [default: false].
dynamic_ncols : bool, optional
If set, constantly alters `ncols` to the environment (allowing
for window resizes) [default: False].
smoothing : float
Exponential moving average smoothing factor for speed estimates
(ignored in GUI mode). Ranges from 0 (initial speed) to 1
(current/instantaneous speed) [default: 0.7].
unit='it', unit_scale=False, gui=False, dynamic_ncols=False,
smoothing=0.7):
Returns
-------
out : decorated iterator.
"""
Parameters
~~~~~~~~~~
* iterable : iterable, optional
Iterable to decorate with a progressbar.
Leave blank [default: None] to manually manage the updates.
* desc : str, optional
Prefix for the progressbar [default: None].
* total : int, optional
The number of expected iterations. If not given, len(iterable) is
used if possible. As a last resort, only basic progress
statistics are displayed (no ETA, no progressbar). If `gui` is
True and this parameter needs subsequent updating, specify an
initial arbitrary large positive integer, e.g. int(9e9).
* leave : bool, optional
If [default: False], removes all traces of the progressbar
upon termination of iteration.
* file : `io.TextIOWrapper` or `io.StringIO`, optional
Specifies where to output the progress messages
[default: sys.stderr]. Uses `file.write(str)` and `file.flush()`
methods.
* ncols : int, optional
The width of the entire output message. If specified, dynamically
resizes the progressbar to stay within this bound. If
[default: None], attempts to use environment width. The fallback
is a meter width of 10 and no limit for the counter and
statistics. If 0, will not print any meter (only stats).
* mininterval : float, optional
Minimum progress update interval, in seconds [default: 0.1].
* miniters : int, optional
Minimum progress update interval, in iterations [default: None].
If specified, will set `mininterval` to 0.
* ascii : bool, optional
If [default: None] or false, use unicode (smooth blocks) to fill
the meter. The fallback is to use ASCII characters `1-9 #`.
* disable : bool
Whether to disable the entire progressbar wrapper [default: False].
* unit : str, optional
String that will be used to define the unit of each iteration
[default: 'it'].
* unit_scale : bool, optional
If set, the number of iterations will be reduced/scaled
automatically and a metric prefix following the
International System of Units standard will be added
(kilo, mega, etc.) [default: False].
* gui : bool, optional
If set, will attempt to use matplotlib animations for a
graphical output [default: false].
* dynamic_ncols : bool, optional
If set, constantly alters `ncols` to the environment (allowing
for window resizes) [default: False].
* smoothing : float
Exponential moving average smoothing factor for speed estimates
(ignored in GUI mode). Ranges from 0 (initial speed) to 1
(current/instantaneous speed) [default: 0.7].
Returns
~~~~~~~
* out : decorated iterator.
.. code:: python
def update(self, n=1):
"""