Skip to content

Remove whitespace. Remove unused variable j. #909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jan 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions plotly/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def validate_colors(colors):
colors_list = colors

# Validate colors in colors_list
for j, each_color in enumerate(colors_list):
for each_color in colors_list:
if 'rgb' in each_color:
each_color = color_parser(
each_color, unlabel_rgb
Expand Down Expand Up @@ -401,10 +401,10 @@ def validate_scale_values(scale):
)

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


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


def unlabel_rgb(colors):
Expand Down
3 changes: 2 additions & 1 deletion plotly/dashboard_objs/dashboard_objs.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def _container(box_1=None, box_2=None, size=MASTER_HEIGHT,
}
return container


dashboard_html = ("""
<!DOCTYPE HTML>
<html>
Expand Down Expand Up @@ -273,7 +274,7 @@ def _set_container_sizes(self):
self['layout']['sizeUnit'] = 'px'

for path in all_paths:
if len(path) != 0:
if path:
if self._path_to_box(path)['type'] == 'split':
self._path_to_box(path)['size'] = 50
self._path_to_box(path)['sizeUnit'] = '%'
Expand Down
4 changes: 2 additions & 2 deletions plotly/figure_factory/_annotated_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def get_text_color(self):
max_col = map(int,
self.colorscale[-1][1].strip('rgb()').split(','))
elif '#' in self.colorscale[0][1]:
min_col = utils.hex_to_rgb(self.colorscale[0][1])
max_col = utils.hex_to_rgb(self.colorscale[-1][1])
min_col = utils.hex_to_rgb(self.colorscale[0][1])
max_col = utils.hex_to_rgb(self.colorscale[-1][1])
else:
min_col = [255, 255, 255]
max_col = [255, 255, 255]
Expand Down
26 changes: 13 additions & 13 deletions plotly/figure_factory/_dendrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ def __init__(self, X, orientation='bottom', labels=None, colorscale=None,
distfun = scs.distance.pdist

(dd_traces, xvals, yvals,
ordered_labels, leaves) = self.get_dendrogram_traces(X, colorscale,
distfun,
linkagefun,
hovertext)
ordered_labels, leaves) = self.get_dendrogram_traces(X, colorscale,
distfun,
linkagefun,
hovertext)

self.labels = ordered_labels
self.leaves = leaves
Expand Down Expand Up @@ -193,17 +193,17 @@ def set_axis_layout(self, axis_key):

"""
axis_defaults = {
'type': 'linear',
'ticks': 'outside',
'mirror': 'allticks',
'rangemode': 'tozero',
'showticklabels': True,
'zeroline': False,
'showgrid': False,
'showline': True,
'type': 'linear',
'ticks': 'outside',
'mirror': 'allticks',
'rangemode': 'tozero',
'showticklabels': True,
'zeroline': False,
'showgrid': False,
'showline': True,
}

if len(self.labels) != 0:
if self.labels:
axis_key_labels = self.xaxis
if self.orientation in ['left', 'right']:
axis_key_labels = self.yaxis
Expand Down
14 changes: 7 additions & 7 deletions plotly/figure_factory/_facet_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ def _add_shapes_to_fig(fig, annot_rect_color, flipped_rows=False,
for key in fig['layout'].keys():
if 'axis' in key and fig['layout'][key]['domain'] != [0.0, 1.0]:
shape = {
'fillcolor': annot_rect_color,
'layer': 'below',
'line': {'color': annot_rect_color, 'width': 1},
'type': 'rect',
'xref': 'paper',
'yref': 'paper'
'fillcolor': annot_rect_color,
'layer': 'below',
'line': {'color': annot_rect_color, 'width': 1},
'type': 'rect',
'xref': 'paper',
'yref': 'paper'
}

if 'xaxis' in key:
Expand Down Expand Up @@ -1052,7 +1052,7 @@ def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None,
min_ranges = []
max_ranges = []
for trace in fig['data']:
if trace[x_y] is not None and len(trace[x_y]) > 0:
if trace[x_y] is not None and trace[x_y]:
min_ranges.append(min(trace[x_y]))
max_ranges.append(max(trace[x_y]))
while None in min_ranges:
Expand Down
4 changes: 2 additions & 2 deletions plotly/figure_factory/_scatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ def scatterplot(dataframe, headers, diag, size, height, width, title,


def scatterplot_dict(dataframe, headers, diag, size,
height, width, title, index, index_vals,
endpts, colormap, colormap_type, **kwargs):
height, width, title, index, index_vals,
endpts, colormap, colormap_type, **kwargs):
"""
Refer to FigureFactory.create_scatterplotmatrix() for docstring

Expand Down
8 changes: 4 additions & 4 deletions plotly/figure_factory/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,10 @@ def validate_scale_values(scale):
)

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


def validate_colorscale(colorscale):
Expand Down
Loading