Skip to content

Commit b8d39ae

Browse files
authored
Merge pull request #909 from jbampton/pylint-pep8-fixes
Remove whitespace. Remove unused variable j.
2 parents 07294e6 + 486b81d commit b8d39ae

File tree

19 files changed

+223
-216
lines changed

19 files changed

+223
-216
lines changed

plotly/colors.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def validate_colors(colors):
224224
colors_list = colors
225225

226226
# Validate colors in colors_list
227-
for j, each_color in enumerate(colors_list):
227+
for each_color in colors_list:
228228
if 'rgb' in each_color:
229229
each_color = color_parser(
230230
each_color, unlabel_rgb
@@ -401,10 +401,10 @@ def validate_scale_values(scale):
401401
)
402402

403403
if not all(x < y for x, y in zip(scale, scale[1:])):
404-
raise exceptions.PlotlyError(
405-
"'scale' must be a list that contains a strictly increasing "
406-
"sequence of numbers."
407-
)
404+
raise exceptions.PlotlyError(
405+
"'scale' must be a list that contains a strictly increasing "
406+
"sequence of numbers."
407+
)
408408

409409

410410
def make_colorscale(colors, scale=None):
@@ -553,7 +553,7 @@ def label_rgb(colors):
553553
"""
554554
Takes tuple (a, b, c) and returns an rgb color 'rgb(a, b, c)'
555555
"""
556-
return ('rgb(%s, %s, %s)' % (colors[0], colors[1], colors[2]))
556+
return 'rgb(%s, %s, %s)' % (colors[0], colors[1], colors[2])
557557

558558

559559
def unlabel_rgb(colors):

plotly/dashboard_objs/dashboard_objs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def _container(box_1=None, box_2=None, size=MASTER_HEIGHT,
6262
}
6363
return container
6464

65+
6566
dashboard_html = ("""
6667
<!DOCTYPE HTML>
6768
<html>
@@ -273,7 +274,7 @@ def _set_container_sizes(self):
273274
self['layout']['sizeUnit'] = 'px'
274275

275276
for path in all_paths:
276-
if len(path) != 0:
277+
if path:
277278
if self._path_to_box(path)['type'] == 'split':
278279
self._path_to_box(path)['size'] = 50
279280
self._path_to_box(path)['sizeUnit'] = '%'

plotly/figure_factory/_annotated_heatmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ def get_text_color(self):
180180
max_col = map(int,
181181
self.colorscale[-1][1].strip('rgb()').split(','))
182182
elif '#' in self.colorscale[0][1]:
183-
min_col = utils.hex_to_rgb(self.colorscale[0][1])
184-
max_col = utils.hex_to_rgb(self.colorscale[-1][1])
183+
min_col = utils.hex_to_rgb(self.colorscale[0][1])
184+
max_col = utils.hex_to_rgb(self.colorscale[-1][1])
185185
else:
186186
min_col = [255, 255, 255]
187187
max_col = [255, 255, 255]

plotly/figure_factory/_dendrogram.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ def __init__(self, X, orientation='bottom', labels=None, colorscale=None,
124124
distfun = scs.distance.pdist
125125

126126
(dd_traces, xvals, yvals,
127-
ordered_labels, leaves) = self.get_dendrogram_traces(X, colorscale,
128-
distfun,
129-
linkagefun,
130-
hovertext)
127+
ordered_labels, leaves) = self.get_dendrogram_traces(X, colorscale,
128+
distfun,
129+
linkagefun,
130+
hovertext)
131131

132132
self.labels = ordered_labels
133133
self.leaves = leaves
@@ -193,17 +193,17 @@ def set_axis_layout(self, axis_key):
193193
194194
"""
195195
axis_defaults = {
196-
'type': 'linear',
197-
'ticks': 'outside',
198-
'mirror': 'allticks',
199-
'rangemode': 'tozero',
200-
'showticklabels': True,
201-
'zeroline': False,
202-
'showgrid': False,
203-
'showline': True,
196+
'type': 'linear',
197+
'ticks': 'outside',
198+
'mirror': 'allticks',
199+
'rangemode': 'tozero',
200+
'showticklabels': True,
201+
'zeroline': False,
202+
'showgrid': False,
203+
'showline': True,
204204
}
205205

206-
if len(self.labels) != 0:
206+
if self.labels:
207207
axis_key_labels = self.xaxis
208208
if self.orientation in ['left', 'right']:
209209
axis_key_labels = self.yaxis

plotly/figure_factory/_facet_grid.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ def _add_shapes_to_fig(fig, annot_rect_color, flipped_rows=False,
149149
for key in fig['layout'].keys():
150150
if 'axis' in key and fig['layout'][key]['domain'] != [0.0, 1.0]:
151151
shape = {
152-
'fillcolor': annot_rect_color,
153-
'layer': 'below',
154-
'line': {'color': annot_rect_color, 'width': 1},
155-
'type': 'rect',
156-
'xref': 'paper',
157-
'yref': 'paper'
152+
'fillcolor': annot_rect_color,
153+
'layer': 'below',
154+
'line': {'color': annot_rect_color, 'width': 1},
155+
'type': 'rect',
156+
'xref': 'paper',
157+
'yref': 'paper'
158158
}
159159

160160
if 'xaxis' in key:
@@ -1052,7 +1052,7 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None,
10521052
min_ranges = []
10531053
max_ranges = []
10541054
for trace in fig['data']:
1055-
if trace[x_y] is not None and len(trace[x_y]) > 0:
1055+
if trace[x_y] is not None and trace[x_y]:
10561056
min_ranges.append(min(trace[x_y]))
10571057
max_ranges.append(max(trace[x_y]))
10581058
while None in min_ranges:

plotly/figure_factory/_scatterplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ def scatterplot(dataframe, headers, diag, size, height, width, title,
206206

207207

208208
def scatterplot_dict(dataframe, headers, diag, size,
209-
height, width, title, index, index_vals,
210-
endpts, colormap, colormap_type, **kwargs):
209+
height, width, title, index, index_vals,
210+
endpts, colormap, colormap_type, **kwargs):
211211
"""
212212
Refer to FigureFactory.create_scatterplotmatrix() for docstring
213213

plotly/figure_factory/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,10 @@ def validate_scale_values(scale):
421421
)
422422

423423
if not all(x < y for x, y in zip(scale, scale[1:])):
424-
raise exceptions.PlotlyError(
425-
"'scale' must be a list that contains a strictly increasing "
426-
"sequence of numbers."
427-
)
424+
raise exceptions.PlotlyError(
425+
"'scale' must be a list that contains a strictly increasing "
426+
"sequence of numbers."
427+
)
428428

429429

430430
def validate_colorscale(colorscale):

0 commit comments

Comments
 (0)