Skip to content

Commit c4030c1

Browse files
ColCarrolltwiecki
authored andcommitted
Removed progressbar.py (#1408)
1 parent 220643d commit c4030c1

File tree

4 files changed

+13
-149
lines changed

4 files changed

+13
-149
lines changed

pymc3/progressbar.py

Lines changed: 0 additions & 140 deletions
This file was deleted.

pymc3/sampling.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
from collections import defaultdict
2+
3+
from joblib import Parallel, delayed
4+
from numpy.random import randint, seed
5+
from numpy import shape, asarray
6+
17
from . import backends
28
from .backends.base import merge_traces, BaseTrace, MultiTrace
39
from .backends.ndarray import NDArray
4-
from joblib import Parallel, delayed
510
from .model import modelcontext, Point
611
from .step_methods import (NUTS, HamiltonianMC, Metropolis, BinaryMetropolis,
712
BinaryGibbsMetropolis, Slice, ElemwiseCategorical, CompoundStep)
8-
from .progressbar import progress_bar
9-
from numpy.random import randint, seed
10-
from numpy import shape, asarray
11-
from collections import defaultdict
13+
from tqdm import tqdm
1214

1315
import sys
1416
sys.setrecursionlimit(10000)
@@ -159,11 +161,11 @@ def _sample(draws, step=None, start=None, trace=None, chain=0, tune=None,
159161
progressbar=True, model=None, random_seed=-1):
160162
sampling = _iter_sample(draws, step, start, trace, chain,
161163
tune, model, random_seed)
162-
progress = progress_bar(draws)
164+
if progressbar:
165+
sampling = tqdm(sampling, total=draws)
163166
try:
164-
for i, strace in enumerate(sampling):
165-
if progressbar:
166-
progress.update(i)
167+
for strace in sampling:
168+
pass
167169
except KeyboardInterrupt:
168170
strace.close()
169171
return MultiTrace([strace])

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ theano>=0.8.2
55
pandas>=0.18.0
66
patsy>=0.4.0
77
joblib>=0.9
8+
tqdm>=4.8.4
89
CommonMark==0.5.4
910
recommonmark
1011
sphinx

scripts/create_testenv.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if [ ${PYTHON_VERSION} == "2.7" ]; then
1313
conda install --yes mock enum34;
1414
fi
1515

16+
pip install tqdm
1617
pip install --no-deps numdifftools
1718
pip install git+https://github.com/Theano/Theano.git
1819
pip install git+https://github.com/mahmoudimus/nose-timer.git

0 commit comments

Comments
 (0)