code quality fixes

This commit is contained in:
2020-03-09 01:47:16 +00:00
parent 15595892ec
commit ed9a30db13
7 changed files with 17 additions and 24 deletions

View File

@@ -170,8 +170,8 @@ class LyricsBuilder(LyricsConcreteBuilder):
avg = math.ceil(np.mean(nums))
median = math.ceil(np.median(nums))
std = math.ceil(np.std(nums))
max = math.ceil(np.max(nums))
min = math.ceil(np.min(nums))
_max = math.ceil(np.max(nums))
_min = math.ceil(np.min(nums))
p_10 = math.ceil(np.percentile(nums, 10))
p_25 = math.ceil(np.percentile(nums, 25))
p_75 = math.ceil(np.percentile(nums, 75))
@@ -181,8 +181,8 @@ class LyricsBuilder(LyricsConcreteBuilder):
('avg', avg),
('median', median),
('std', std),
('max', max),
('min', min),
('max', _max),
('min', _min),
('p_10', p_10),
('p_25', p_25),
('p_75', p_75),
@@ -312,10 +312,10 @@ class LyricsBuilder(LyricsConcreteBuilder):
f'{self.artist}'
),
) as bar:
for id, alb in self.release_group_ids.items():
for _id, alb in self.release_group_ids.items():
resp_0 = addict.Dict(
musicbrainzngs.browse_releases(
release_group=id,
release_group=_id,
release_type=['album'],
includes=['recordings'],
limit=100,

View File

@@ -1,6 +1,4 @@
from __future__ import annotations
import json
import os
import click

View File

@@ -30,9 +30,9 @@ class ComplexCLI(click.MultiCommand):
rv.sort()
return rv
def get_command(self, ctx, name):
mod = import_module(f'musicbrainzapi.cli.commands.cmd_{name}')
return getattr(mod, name)
def get_command(self, ctx, cmd_name):
mod = import_module(f'musicbrainzapi.cli.commands.cmd_{cmd_name}')
return getattr(mod, cmd_name)
@click.command(cls=ComplexCLI, context_settings=CONTEXT_SETTINGS)

View File

@@ -56,7 +56,7 @@ class LyricsWordcloud:
cls, all_albums_lyrics_count: 'Lyrics.all_albums_lyrics_count',
) -> LyricsWordcloud:
"""Class method to instantiate with a microphone base image.
Parameters
----------
all_albums_lyrics_count : Lyrics.all_albums_lyrics_count
@@ -87,7 +87,7 @@ class LyricsWordcloud:
"""
self.lyrics_list = list()
for i in self.all_albums_lyrics_count:
for album, lyric in i.items():
for _, lyric in i.items():
for track in lyric:
try:
for word in track:
@@ -141,10 +141,10 @@ class LyricsWordcloud:
plt.axis('off')
return self
def show_word_cloud(self):
"""Shows the word cloud.
"""
plt.show()
# def show_word_cloud(self):
# """Shows the word cloud.
# """
# plt.show()
def create_word_cloud(self) -> None:
"""Creates a word cloud