Unverified Commit 606ae324 authored by moto's avatar moto Committed by GitHub
Browse files

Fix flake8-bugbear lint errors (#505)

parent 78a4a027
......@@ -10,7 +10,7 @@ import utils
def run(exe_path, scp_path, out_dir, wave_len, num_outputs, remove_files, log_level):
logging.basicConfig(level=log_level)
for i in range(num_outputs):
for _ in range(num_outputs):
try:
nyquist = 16000 // 2
high_freq = random.randint(1, nyquist)
......
......@@ -8,7 +8,7 @@ import utils
def run(exe_path, scp_path, out_dir, wave_len, num_outputs, remove_files, log_level):
logging.basicConfig(level=log_level)
for i in range(num_outputs):
for _ in range(num_outputs):
inputs = {
'blackman_coeff': '%.4f' % (random.random() * 5),
'dither': '0',
......
......@@ -46,7 +46,7 @@ class TestDatasets(unittest.TestCase):
path = os.path.join(self.path, "commonvoice")
data = COMMONVOICE(path, "train.tsv", "tatar")
data = bg_iterator(data, 5)
for d in data:
for _ in data:
pass
def test_ljspeech(self):
......
......@@ -24,7 +24,7 @@ class Tester(unittest.TestCase):
test_filepath = os.path.join(test_dirpath, 'assets',
'steam-train-whistle-daniel_simon.wav')
def scale(self, waveform, factor=float(2**31)):
def scale(self, waveform, factor=2.0**31):
# scales a waveform by a factor
if not waveform.is_floating_point():
waveform = waveform.to(torch.get_default_dtype())
......
......@@ -73,7 +73,7 @@ def load(filepath,
"""
return getattr(_get_audio_backend_module(), 'load')(
return _get_audio_backend_module().load(
filepath,
out=out,
normalization=normalization,
......@@ -116,7 +116,7 @@ def save(filepath, src, sample_rate, precision=16, channels_first=True):
Default: ``True``)
"""
return getattr(_get_audio_backend_module(), 'save')(
return _get_audio_backend_module().save(
filepath, src, sample_rate, precision=precision, channels_first=channels_first
)
......@@ -208,7 +208,7 @@ def info(filepath):
>>> rate, channels, encoding = si.rate, si.channels, ei.encoding
"""
return getattr(_get_audio_backend_module(), 'info')(filepath)
return _get_audio_backend_module().info(filepath)
@_audio_backend_guard("sox")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment