From 44a0985f9681abf3b72d3c0bc21057fea005e79f Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Mon, 26 Aug 2019 16:07:14 +0100 Subject: [PATCH] update docs --- tqdm/gui.py | 4 ++-- tqdm/notebook.py | 4 ++-- tqdm/std.py | 15 ++++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tqdm/gui.py b/tqdm/gui.py index 6a1ba565..dbac9d67 100644 --- a/tqdm/gui.py +++ b/tqdm/gui.py @@ -3,8 +3,8 @@ GUI progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: - >>> from tqdm import tgrange[, tqdm_gui] - >>> for i in tgrange(10): #same as: for i in tqdm_gui(xrange(10)) + >>> from tqdm.gui import trange[, tqdm] + >>> for i in trange(10): #same as: for i in tqdm(xrange(10)) ... ... """ # future division is important to divide integers and get as diff --git a/tqdm/notebook.py b/tqdm/notebook.py index 642b2d54..01513f43 100644 --- a/tqdm/notebook.py +++ b/tqdm/notebook.py @@ -3,8 +3,8 @@ IPython/Jupyter Notebook progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: - >>> from tqdm import tnrange[, tqdm_notebook] - >>> for i in tnrange(10): #same as: for i in tqdm_notebook(xrange(10)) + >>> from tqdm.notebook import trange[, tqdm] + >>> for i in trange(10): #same as: for i in tqdm(xrange(10)) ... ... """ # future division is important to divide integers and get as diff --git a/tqdm/std.py b/tqdm/std.py index 579e5dc4..26baea04 100644 --- a/tqdm/std.py +++ b/tqdm/std.py @@ -627,7 +627,8 @@ class tqdm(Comparable): -------- >>> import pandas as pd >>> import numpy as np - >>> from tqdm import tqdm, tqdm_gui + >>> from tqdm import tqdm + >>> from tqdm.gui import tqdm as tqdm_gui >>> >>> df = pd.DataFrame(np.random.randint(0, 100, (100000, 6))) >>> tqdm.pandas(ncols=50) # can use tqdm_gui, optional kwargs, etc @@ -862,7 +863,7 @@ class tqdm(Comparable): bytes. In all other cases will default to unicode. gui : bool, optional WARNING: internal parameter - do not use. - Use tqdm_gui(...) instead. If set, will attempt to use + Use tqdm.gui.tqdm(...) instead. If set, will attempt to use matplotlib animations for a graphical output [default: False]. Returns @@ -1065,7 +1066,7 @@ class tqdm(Comparable): if not hasattr(self, 'sp'): from textwrap import dedent raise TqdmDeprecationWarning(dedent("""\ - Please use `tqdm_gui(...)` instead of `tqdm(..., gui=True)` + Please use `tqdm.gui.tqdm(...)` instead of `tqdm(..., gui=True)` """), fp_write=getattr(self.fp, 'write', sys.stderr.write)) for obj in iterable: @@ -1166,10 +1167,10 @@ class tqdm(Comparable): rate, self.avg_time, self.smoothing) if not hasattr(self, "sp"): - from textwrap import dedent - raise TqdmDeprecationWarning(dedent("""\ - Please use `tqdm_gui(...)` instead of `tqdm(..., gui=True)` - """), fp_write=getattr(self.fp, 'write', sys.stderr.write)) + raise TqdmDeprecationWarning( + "Please use `tqdm.gui.tqdm(...)`" + " instead of `tqdm(..., gui=True)`\n", + fp_write=getattr(self.fp, 'write', sys.stderr.write)) with self._lock: self.display()