flake8, .gitignore ipy

This commit is contained in:
Casper da Costa-Luis 2019-01-19 23:18:09 +00:00
parent 2d75274db4
commit b2c6e9e045
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
5 changed files with 16 additions and 9 deletions

3
.gitignore vendored
View File

@ -25,6 +25,9 @@ __pycache__
# PyCharm
.idea
# IPython
.ipynb_checkpoints
# asv
.asv/
benchmarks/*.py[co]

View File

@ -47,7 +47,8 @@ all:
@+make build
flake8:
@+flake8 --max-line-length=80 --exclude .asv,.tox -j 8 --count --statistics --exit-zero .
@+flake8 --max-line-length=80 --exclude .asv,.tox,.ipynb_checkpoints \
-j 8 --count --statistics --exit-zero .
test:
tox --skip-missing-interpreters

View File

@ -79,8 +79,8 @@ class TqdmDefaultWriteLock(object):
an argument to joblib or the parallelism lib you use.
"""
def __init__(self):
# Create global parallelism locks to avoid racing issues with parallel bars
# works only if fork available (Linux/MacOSX, but not Windows)
# Create global parallelism locks to avoid racing issues with parallel
# bars works only if fork available (Linux/MacOSX, but not Windows)
self.create_mp_lock()
self.create_th_lock()
cls = type(self)
@ -210,8 +210,8 @@ class tqdm(Comparable):
@staticmethod
def ema(x, mu=None, alpha=0.3):
"""
Exponential moving average: smoothing to give progressively lower
weights to older values.
Exponential moving average: smoothing to give progressively lower
weights to older values.
Parameters
----------
@ -222,7 +222,7 @@ class tqdm(Comparable):
alpha : float, optional
Smoothing factor in range [0, 1], [default: 0.3].
Increase to give more weight to recent values.
Ranges from 0 (yields mu) to 1 (yields x).
Ranges from 0 (yields mu) to 1 (yields x).
"""
return x if mu is None else (alpha * x) + (1 - alpha) * mu
@ -1098,7 +1098,8 @@ Please use `tqdm_gui(...)` instead of `tqdm(..., gui=True)`
# EMA (not just overall average)
if self.smoothing and delta_t and delta_it:
rate = delta_t / delta_it
self.avg_time = self.ema(rate, self.avg_time, self.smoothing)
self.avg_time = self.ema(
rate, self.avg_time, self.smoothing)
if not hasattr(self, "sp"):
raise TqdmDeprecationWarning("""\

View File

@ -243,7 +243,8 @@ class tqdm_gui(tqdm): # pragma: no cover
# EMA (not just overall average)
if self.smoothing and delta_t and delta_it:
rate = delta_t / delta_it
self.avg_time = self.ema(rate, self.avg_time, self.smoothing)
self.avg_time = self.ema(
rate, self.avg_time, self.smoothing)
# Inline due to multiple calls
total = self.total

View File

@ -6,7 +6,8 @@ CUR_OS = _curos()
IS_WIN = CUR_OS in ['Windows', 'cli']
IS_NIX = (not IS_WIN) and any(
CUR_OS.startswith(i) for i in
['CYGWIN', 'MSYS', 'Linux', 'Darwin', 'SunOS', 'FreeBSD', 'NetBSD', 'OpenBSD'])
['CYGWIN', 'MSYS', 'Linux', 'Darwin', 'SunOS',
'FreeBSD', 'NetBSD', 'OpenBSD'])
RE_ANSI = re.compile(r"\x1b\[[;\d]*[A-Za-z]")