From 0c385e14c8d7c411d5701ce691f01f093f5e795f Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 7 Jan 2018 04:06:26 +1000 Subject: [PATCH 01/14] Remove whitespace. Remove unused variable j. --- plotly/colors.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plotly/colors.py b/plotly/colors.py index f037a142a1a..a2ada1ac884 100644 --- a/plotly/colors.py +++ b/plotly/colors.py @@ -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 diff --git a/setup.py b/setup.py index d12b3c75989..9a73fc42068 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -exec (open('plotly/version.py').read()) +exec(open('plotly/version.py').read()) def readme(): From f70a332be5abaffbd1b6a057b1ddc081141c1620 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 7 Jan 2018 05:48:06 +1000 Subject: [PATCH 02/14] Fix indentation. Fix unnecessary parens after 'return' keyword (superfluous-parens). --- plotly/colors.py | 10 ++-- plotly/graph_reference.py | 100 +++++++++++++++++++------------------- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/plotly/colors.py b/plotly/colors.py index a2ada1ac884..30edc8b6cef 100644 --- a/plotly/colors.py +++ b/plotly/colors.py @@ -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): @@ -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): diff --git a/plotly/graph_reference.py b/plotly/graph_reference.py index dd78bb30d92..873aed7925c 100644 --- a/plotly/graph_reference.py +++ b/plotly/graph_reference.py @@ -72,55 +72,55 @@ def get_graph_reference(): # TODO: Patch in frames info until it hits streambed. See #659 graph_reference['frames'] = { - "items": { - "frames_entry": { - "baseframe": { - "description": "The name of the frame into which this " - "frame's properties are merged before " - "applying. This is used to unify " - "properties and avoid needing to specify " - "the same values for the same properties " - "in multiple frames.", - "role": "info", - "valType": "string" - }, - "data": { - "description": "A list of traces this frame modifies. " - "The format is identical to the normal " - "trace definition.", - "role": "object", - "valType": "any" - }, - "group": { - "description": "An identifier that specifies the group " - "to which the frame belongs, used by " - "animate to select a subset of frames.", - "role": "info", - "valType": "string" - }, - "layout": { - "role": "object", - "description": "Layout properties which this frame " - "modifies. The format is identical to " - "the normal layout definition.", - "valType": "any" - }, - "name": { - "description": "A label by which to identify the frame", - "role": "info", - "valType": "string" - }, - "role": "object", - "traces": { - "description": "A list of trace indices that identify " - "the respective traces in the data " - "attribute", - "role": "info", - "valType": "info_array" - } - } - }, - "role": "object" + "items": { + "frames_entry": { + "baseframe": { + "description": "The name of the frame into which this " + "frame's properties are merged before " + "applying. This is used to unify " + "properties and avoid needing to specify " + "the same values for the same properties " + "in multiple frames.", + "role": "info", + "valType": "string" + }, + "data": { + "description": "A list of traces this frame modifies. " + "The format is identical to the normal " + "trace definition.", + "role": "object", + "valType": "any" + }, + "group": { + "description": "An identifier that specifies the group " + "to which the frame belongs, used by " + "animate to select a subset of frames.", + "role": "info", + "valType": "string" + }, + "layout": { + "role": "object", + "description": "Layout properties which this frame " + "modifies. The format is identical to " + "the normal layout definition.", + "valType": "any" + }, + "name": { + "description": "A label by which to identify the frame", + "role": "info", + "valType": "string" + }, + "role": "object", + "traces": { + "description": "A list of trace indices that identify " + "the respective traces in the data " + "attribute", + "role": "info", + "valType": "info_array" + } + } + }, + "role": "object" } return graph_reference @@ -223,7 +223,7 @@ def get_attributes_dicts(object_name, parent_object_names=()): # We return a dict mapping paths to attributes. We also add in additional # attributes if defined. attributes_dicts = {path: utils.get_by_path(GRAPH_REFERENCE, path) - for path in attribute_paths} + for path in attribute_paths} attributes_dicts['additional_attributes'] = additional_attributes return attributes_dicts From 6f83cf08915d4c904b5040a7d85070f531b02a5e Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 7 Jan 2018 05:54:06 +1000 Subject: [PATCH 03/14] Fix unnecessary parens after 'not' keyword (superfluous-parens). --- plotly/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/session.py b/plotly/session.py index 2e72d45bff3..e6d29248bd0 100644 --- a/plotly/session.py +++ b/plotly/session.py @@ -132,7 +132,7 @@ def update_session_plot_options(**kwargs): .format(key, PLOT_OPTIONS[key])) # raise exception if sharing is invalid - if (key == 'sharing' and not (kwargs[key] in SHARING_OPTIONS)): + if key == 'sharing' and not (kwargs[key] in SHARING_OPTIONS): raise exceptions.PlotlyError("'{0}' must be of either '{1}', '{2}'" " or '{3}'" .format(key, *SHARING_OPTIONS)) From 4bb5ab740e07f0295f3b0f10ac50fbcde3f1dca4 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 7 Jan 2018 06:18:50 +1000 Subject: [PATCH 04/14] Indent code. --- plotly/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plotly/utils.py b/plotly/utils.py index 7d623014b5b..121d864776d 100644 --- a/plotly/utils.py +++ b/plotly/utils.py @@ -409,9 +409,9 @@ def get_by_path(obj, path): ### validation def validate_world_readable_and_sharing_settings(option_set): if ('world_readable' in option_set and - option_set['world_readable'] is True and - 'sharing' in option_set and - option_set['sharing'] is not None and + option_set['world_readable'] is True and + 'sharing' in option_set and + option_set['sharing'] is not None and option_set['sharing'] != 'public'): raise PlotlyError( "Looks like you are setting your plot privacy to both " From 12897486e81c981aabf8ccdb3dd1d02cc573b701 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 7 Jan 2018 06:35:36 +1000 Subject: [PATCH 05/14] Indent code. --- plotly/tools.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plotly/tools.py b/plotly/tools.py index b24c391833f..fad66b8a8bb 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -326,9 +326,9 @@ def get_embed(file_owner_or_url, file_id=None, width="100%", height=525): "~{file_owner}/{file_id}.embed\" " "height=\"{iframe_height}\" width=\"{iframe_width}\">" "").format( - plotly_rest_url=plotly_rest_url, - file_owner=file_owner, file_id=file_id, - iframe_height=height, iframe_width=width) + plotly_rest_url=plotly_rest_url, + file_owner=file_owner, file_id=file_id, + iframe_height=height, iframe_width=width) else: s = ("").format( - plotly_rest_url=plotly_rest_url, - file_owner=file_owner, file_id=file_id, share_key=share_key, - iframe_height=height, iframe_width=width) + plotly_rest_url=plotly_rest_url, + file_owner=file_owner, file_id=file_id, share_key=share_key, + iframe_height=height, iframe_width=width) return s @@ -867,7 +867,7 @@ def make_subplots(rows=1, cols=1, raise Exception(exception_msg) except KeyError: specs = [[{} - for c in range(cols)] + for c in range(cols)] for r in range(rows)] # default 'specs' # Throw exception if specs is over or under specified From d3a0d2b038a90c57f34aedcb0f27a0ca95a04b44 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 7 Jan 2018 07:25:59 +1000 Subject: [PATCH 06/14] Indent code. Do not use len to determine if a sequence is empty (len-as-condition). --- plotly/figure_factory/_annotated_heatmap.py | 4 ++-- plotly/figure_factory/_dendrogram.py | 26 ++++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/plotly/figure_factory/_annotated_heatmap.py b/plotly/figure_factory/_annotated_heatmap.py index ba1985fd704..300c4c6ed6e 100644 --- a/plotly/figure_factory/_annotated_heatmap.py +++ b/plotly/figure_factory/_annotated_heatmap.py @@ -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] diff --git a/plotly/figure_factory/_dendrogram.py b/plotly/figure_factory/_dendrogram.py index 700ab35be4b..857b762a40b 100644 --- a/plotly/figure_factory/_dendrogram.py +++ b/plotly/figure_factory/_dendrogram.py @@ -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 @@ -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 From 13eecc5c1bc070f9eae832a7f93d06748e6111d2 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 7 Jan 2018 07:53:21 +1000 Subject: [PATCH 07/14] Indent code. Do not use len sequence to determine if a sequence is empty (len-as-condition). --- plotly/figure_factory/_facet_grid.py | 14 +++++++------- plotly/figure_factory/_scatterplot.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plotly/figure_factory/_facet_grid.py b/plotly/figure_factory/_facet_grid.py index 6d5fe33eedf..b110fd5c2e1 100644 --- a/plotly/figure_factory/_facet_grid.py +++ b/plotly/figure_factory/_facet_grid.py @@ -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: @@ -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: diff --git a/plotly/figure_factory/_scatterplot.py b/plotly/figure_factory/_scatterplot.py index 3c2de2452f7..5ed081784ff 100644 --- a/plotly/figure_factory/_scatterplot.py +++ b/plotly/figure_factory/_scatterplot.py @@ -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 From 97da0be7b4c20d5636c8594987735140ff1519a2 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 7 Jan 2018 08:53:34 +1000 Subject: [PATCH 08/14] Fix indent. Remove trailing whitespace (trailing-whitespace). Do not use len sequence to determine if a sequence is empty (len-as-condition). --- plotly/figure_factory/utils.py | 8 +- plotly/graph_objs/graph_objs.py | 212 ++++++++++++++++---------------- 2 files changed, 110 insertions(+), 110 deletions(-) diff --git a/plotly/figure_factory/utils.py b/plotly/figure_factory/utils.py index f6d4778ab64..f275463407f 100644 --- a/plotly/figure_factory/utils.py +++ b/plotly/figure_factory/utils.py @@ -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): diff --git a/plotly/graph_objs/graph_objs.py b/plotly/graph_objs/graph_objs.py index 533525c493b..e443c2b0fb4 100644 --- a/plotly/graph_objs/graph_objs.py +++ b/plotly/graph_objs/graph_objs.py @@ -310,7 +310,7 @@ def get_ordered(self, **kwargs): def to_string(self, level=0, indent=4, eol='\n', pretty=True, max_chars=80): """Get formatted string by calling `to_string` on children items.""" - if not len(self): + if not self: return "{name}()".format(name=self._get_class_name()) string = "{name}([{eol}{indent}".format( name=self._get_class_name(), @@ -691,7 +691,7 @@ def to_string(self, level=0, indent=4, eol='\n', print(obj.to_string()) """ - if not len(self): + if not self: return "{name}()".format(name=self._get_class_name()) string = "{name}(".format(name=self._get_class_name()) if self._name in graph_reference.TRACE_NAMES: @@ -759,7 +759,7 @@ def force_clean(self, **kwargs): except AttributeError: pass if isinstance(self[key], (dict, list)): - if len(self[key]) == 0: + if not self[key]: del self[key] # clears empty collections! elif self[key] is None: del self[key] @@ -805,10 +805,10 @@ def create(object_name, *args, **kwargs): class AngularAxis(PlotlyDict): """ Valid attributes for 'angularaxis' at path [] under parents (): - + ['domain', 'endpadding', 'range', 'showline', 'showticklabels', 'tickcolor', 'ticklen', 'tickorientation', 'ticksuffix', 'visible'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -819,7 +819,7 @@ class AngularAxis(PlotlyDict): class Annotation(PlotlyDict): """ Valid attributes for 'annotation' at path [] under parents (): - + ['align', 'arrowcolor', 'arrowhead', 'arrowsize', 'arrowwidth', 'ax', 'axref', 'ay', 'ayref', 'bgcolor', 'bordercolor', 'borderpad', 'borderwidth', 'captureevents', 'clicktoshow', 'font', 'height', @@ -827,7 +827,7 @@ class Annotation(PlotlyDict): 'text', 'textangle', 'valign', 'visible', 'width', 'x', 'xanchor', 'xclick', 'xref', 'xshift', 'y', 'yanchor', 'yclick', 'yref', 'yshift', 'z'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -847,12 +847,12 @@ class Annotations(PlotlyList): class Area(PlotlyDict): """ Valid attributes for 'area' at path [] under parents (): - + ['customdata', 'customdatasrc', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'marker', 'name', 'opacity', 'r', 'rsrc', 'showlegend', 'stream', 't', 'tsrc', 'type', 'uid', 'visible'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -863,7 +863,7 @@ class Area(PlotlyDict): class Bar(PlotlyDict): """ Valid attributes for 'bar' at path [] under parents (): - + ['bardir', 'base', 'basesrc', 'constraintext', 'customdata', 'customdatasrc', 'dx', 'dy', 'error_x', 'error_y', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertext', 'hovertextsrc', 'ids', @@ -873,7 +873,7 @@ class Bar(PlotlyDict): 'textpositionsrc', 'textsrc', 'tsrc', 'type', 'uid', 'visible', 'width', 'widthsrc', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -884,14 +884,14 @@ class Bar(PlotlyDict): class Box(PlotlyDict): """ Valid attributes for 'box' at path [] under parents (): - + ['boxmean', 'boxpoints', 'customdata', 'customdatasrc', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'jitter', 'legendgroup', 'line', 'marker', 'name', 'opacity', 'orientation', 'pointpos', 'showlegend', 'stream', 'type', 'uid', 'visible', 'whiskerwidth', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -902,14 +902,14 @@ class Box(PlotlyDict): class Candlestick(PlotlyDict): """ Valid attributes for 'candlestick' at path [] under parents (): - + ['close', 'closesrc', 'customdata', 'customdatasrc', 'decreasing', 'high', 'highsrc', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'increasing', 'legendgroup', 'line', 'low', 'lowsrc', 'name', 'opacity', 'open', 'opensrc', 'showlegend', 'stream', 'text', 'textsrc', 'type', 'uid', 'visible', 'whiskerwidth', 'x', 'xaxis', 'xcalendar', 'xsrc', 'yaxis'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -920,13 +920,13 @@ class Candlestick(PlotlyDict): class Carpet(PlotlyDict): """ Valid attributes for 'carpet' at path [] under parents (): - + ['a', 'a0', 'aaxis', 'asrc', 'b', 'b0', 'baxis', 'bsrc', 'carpet', 'cheaterslope', 'color', 'customdata', 'customdatasrc', 'da', 'db', 'font', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'name', 'opacity', 'showlegend', 'stream', 'type', 'uid', 'visible', 'x', 'xaxis', 'xsrc', 'y', 'yaxis', 'ysrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -937,14 +937,14 @@ class Carpet(PlotlyDict): class Choropleth(PlotlyDict): """ Valid attributes for 'choropleth' at path [] under parents (): - + ['autocolorscale', 'colorbar', 'colorscale', 'customdata', 'customdatasrc', 'geo', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'locationmode', 'locations', 'locationssrc', 'marker', 'name', 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'text', 'textsrc', 'type', 'uid', 'visible', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -955,7 +955,7 @@ class Choropleth(PlotlyDict): class ColorBar(PlotlyDict): """ Valid attributes for 'colorbar' at path [] under parents (): - + ['bgcolor', 'bordercolor', 'borderwidth', 'dtick', 'exponentformat', 'len', 'lenmode', 'nticks', 'outlinecolor', 'outlinewidth', 'separatethousands', 'showexponent', 'showticklabels', @@ -965,7 +965,7 @@ class ColorBar(PlotlyDict): 'ticktextsrc', 'tickvals', 'tickvalssrc', 'tickwidth', 'title', 'titlefont', 'titleside', 'x', 'xanchor', 'xpad', 'y', 'yanchor', 'ypad'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -976,7 +976,7 @@ class ColorBar(PlotlyDict): class Contour(PlotlyDict): """ Valid attributes for 'contour' at path [] under parents (): - + ['autocolorscale', 'autocontour', 'colorbar', 'colorscale', 'connectgaps', 'contours', 'customdata', 'customdatasrc', 'dx', 'dy', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', @@ -985,7 +985,7 @@ class Contour(PlotlyDict): 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'xtype', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc', 'ytype', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -996,7 +996,7 @@ class Contour(PlotlyDict): class Contourcarpet(PlotlyDict): """ Valid attributes for 'contourcarpet' at path [] under parents (): - + ['a', 'a0', 'asrc', 'atype', 'autocolorscale', 'autocontour', 'b', 'b0', 'bsrc', 'btype', 'carpet', 'colorbar', 'colorscale', 'connectgaps', 'contours', 'customdata', 'customdatasrc', 'da', 'db', @@ -1005,7 +1005,7 @@ class Contourcarpet(PlotlyDict): 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'text', 'textsrc', 'transpose', 'type', 'uid', 'visible', 'xaxis', 'yaxis', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1016,11 +1016,11 @@ class Contourcarpet(PlotlyDict): class Contours(PlotlyDict): """ Valid attributes for 'contours' at path [] under parents (): - + ['coloring', 'end', 'labelfont', 'labelformat', 'operation', 'showlabels', 'showlines', 'size', 'start', 'type', 'value', 'x', 'y', 'z'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1102,12 +1102,12 @@ def get_data(self, flatten=False): class ErrorX(PlotlyDict): """ Valid attributes for 'error_x' at path [] under parents (): - + ['array', 'arrayminus', 'arrayminussrc', 'arraysrc', 'color', 'copy_ystyle', 'copy_zstyle', 'opacity', 'symmetric', 'thickness', 'traceref', 'tracerefminus', 'type', 'value', 'valueminus', 'visible', 'width'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1118,12 +1118,12 @@ class ErrorX(PlotlyDict): class ErrorY(PlotlyDict): """ Valid attributes for 'error_y' at path [] under parents (): - + ['array', 'arrayminus', 'arrayminussrc', 'arraysrc', 'color', 'copy_ystyle', 'copy_zstyle', 'opacity', 'symmetric', 'thickness', 'traceref', 'tracerefminus', 'type', 'value', 'valueminus', 'visible', 'width'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1134,12 +1134,12 @@ class ErrorY(PlotlyDict): class ErrorZ(PlotlyDict): """ Valid attributes for 'error_z' at path [] under parents (): - + ['array', 'arrayminus', 'arrayminussrc', 'arraysrc', 'color', 'copy_ystyle', 'copy_zstyle', 'opacity', 'symmetric', 'thickness', 'traceref', 'tracerefminus', 'type', 'value', 'valueminus', 'visible', 'width'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1150,9 +1150,9 @@ class ErrorZ(PlotlyDict): class Figure(PlotlyDict): """ Valid attributes for 'figure' at path [] under parents (): - + ['data', 'frames', 'layout'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1270,9 +1270,9 @@ def append_trace(self, trace, row, col): class Font(PlotlyDict): """ Valid attributes for 'font' at path [] under parents (): - + ['color', 'colorsrc', 'family', 'familysrc', 'size', 'sizesrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1297,7 +1297,7 @@ def _value_to_graph_object(self, index, value, _raise=True): def to_string(self, level=0, indent=4, eol='\n', pretty=True, max_chars=80): """Get formatted string by calling `to_string` on children items.""" - if not len(self): + if not self: return "{name}()".format(name=self._get_class_name()) string = "{name}([{eol}{indent}".format( name=self._get_class_name(), @@ -1324,7 +1324,7 @@ def to_string(self, level=0, indent=4, eol='\n', class Heatmap(PlotlyDict): """ Valid attributes for 'heatmap' at path [] under parents (): - + ['autocolorscale', 'colorbar', 'colorscale', 'connectgaps', 'customdata', 'customdatasrc', 'dx', 'dy', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'name', 'opacity', @@ -1332,7 +1332,7 @@ class Heatmap(PlotlyDict): 'transpose', 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xcalendar', 'xgap', 'xsrc', 'xtype', 'y', 'y0', 'yaxis', 'ycalendar', 'ygap', 'ysrc', 'ytype', 'z', 'zauto', 'zmax', 'zmin', 'zsmooth', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1343,14 +1343,14 @@ class Heatmap(PlotlyDict): class Heatmapgl(PlotlyDict): """ Valid attributes for 'heatmapgl' at path [] under parents (): - + ['autocolorscale', 'colorbar', 'colorscale', 'customdata', 'customdatasrc', 'dx', 'dy', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'name', 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'text', 'textsrc', 'transpose', 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xsrc', 'xtype', 'y', 'y0', 'yaxis', 'ysrc', 'ytype', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1361,7 +1361,7 @@ class Heatmapgl(PlotlyDict): class Histogram(PlotlyDict): """ Valid attributes for 'histogram' at path [] under parents (): - + ['autobinx', 'autobiny', 'bardir', 'cumulative', 'customdata', 'customdatasrc', 'error_x', 'error_y', 'histfunc', 'histnorm', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', @@ -1369,7 +1369,7 @@ class Histogram(PlotlyDict): 'orientation', 'showlegend', 'stream', 'text', 'textsrc', 'type', 'uid', 'visible', 'x', 'xaxis', 'xbins', 'xcalendar', 'xsrc', 'y', 'yaxis', 'ybins', 'ycalendar', 'ysrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1380,7 +1380,7 @@ class Histogram(PlotlyDict): class Histogram2d(PlotlyDict): """ Valid attributes for 'histogram2d' at path [] under parents (): - + ['autobinx', 'autobiny', 'autocolorscale', 'colorbar', 'colorscale', 'customdata', 'customdatasrc', 'histfunc', 'histnorm', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'marker', @@ -1388,7 +1388,7 @@ class Histogram2d(PlotlyDict): 'showscale', 'stream', 'type', 'uid', 'visible', 'x', 'xaxis', 'xbins', 'xcalendar', 'xgap', 'xsrc', 'y', 'yaxis', 'ybins', 'ycalendar', 'ygap', 'ysrc', 'z', 'zauto', 'zmax', 'zmin', 'zsmooth', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1399,7 +1399,7 @@ class Histogram2d(PlotlyDict): class Histogram2dContour(PlotlyDict): """ Valid attributes for 'histogram2dcontour' at path [] under parents (): - + ['autobinx', 'autobiny', 'autocolorscale', 'autocontour', 'colorbar', 'colorscale', 'contours', 'customdata', 'customdatasrc', 'histfunc', 'histnorm', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', @@ -1408,7 +1408,7 @@ class Histogram2dContour(PlotlyDict): 'stream', 'type', 'uid', 'visible', 'x', 'xaxis', 'xbins', 'xcalendar', 'xsrc', 'y', 'yaxis', 'ybins', 'ycalendar', 'ysrc', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1419,7 +1419,7 @@ class Histogram2dContour(PlotlyDict): class Histogram2dcontour(PlotlyDict): """ Valid attributes for 'histogram2dcontour' at path [] under parents (): - + ['autobinx', 'autobiny', 'autocolorscale', 'autocontour', 'colorbar', 'colorscale', 'contours', 'customdata', 'customdatasrc', 'histfunc', 'histnorm', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', @@ -1428,7 +1428,7 @@ class Histogram2dcontour(PlotlyDict): 'stream', 'type', 'uid', 'visible', 'x', 'xaxis', 'xbins', 'xcalendar', 'xsrc', 'y', 'yaxis', 'ybins', 'ycalendar', 'ysrc', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1439,7 +1439,7 @@ class Histogram2dcontour(PlotlyDict): class Layout(PlotlyDict): """ Valid attributes for 'layout' at path [] under parents (): - + ['angularaxis', 'annotations', 'autosize', 'bargap', 'bargroupgap', 'barmode', 'barnorm', 'boxgap', 'boxgroupgap', 'boxmode', 'calendar', 'direction', 'dragmode', 'font', 'geo', 'height', 'hiddenlabels', @@ -1448,7 +1448,7 @@ class Layout(PlotlyDict): 'plot_bgcolor', 'radialaxis', 'scene', 'separators', 'shapes', 'showlegend', 'sliders', 'smith', 'ternary', 'title', 'titlefont', 'updatemenus', 'width', 'xaxis', 'yaxis'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1459,10 +1459,10 @@ class Layout(PlotlyDict): class Legend(PlotlyDict): """ Valid attributes for 'legend' at path [] under parents (): - + ['bgcolor', 'bordercolor', 'borderwidth', 'font', 'orientation', 'tracegroupgap', 'traceorder', 'x', 'xanchor', 'y', 'yanchor'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1473,12 +1473,12 @@ class Legend(PlotlyDict): class Line(PlotlyDict): """ Valid attributes for 'line' at path [] under parents (): - + ['autocolorscale', 'cauto', 'cmax', 'cmin', 'color', 'colorbar', 'colorscale', 'colorsrc', 'dash', 'outliercolor', 'outlierwidth', 'reversescale', 'shape', 'showscale', 'simplify', 'smoothing', 'width', 'widthsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1489,9 +1489,9 @@ class Line(PlotlyDict): class Margin(PlotlyDict): """ Valid attributes for 'margin' at path [] under parents (): - + ['autoexpand', 'b', 'l', 'pad', 'r', 't'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1502,13 +1502,13 @@ class Margin(PlotlyDict): class Marker(PlotlyDict): """ Valid attributes for 'marker' at path [] under parents (): - + ['autocolorscale', 'blend', 'border', 'cauto', 'cmax', 'cmin', 'color', 'colorbar', 'colors', 'colorscale', 'colorsrc', 'colorssrc', 'gradient', 'line', 'maxdisplayed', 'opacity', 'opacitysrc', 'outliercolor', 'reversescale', 'showscale', 'size', 'sizemax', 'sizemin', 'sizemode', 'sizeref', 'sizesrc', 'symbol', 'symbolsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1519,7 +1519,7 @@ class Marker(PlotlyDict): class Mesh3d(PlotlyDict): """ Valid attributes for 'mesh3d' at path [] under parents (): - + ['alphahull', 'autocolorscale', 'cauto', 'cmax', 'cmin', 'color', 'colorbar', 'colorscale', 'contour', 'customdata', 'customdatasrc', 'delaunayaxis', 'facecolor', 'facecolorsrc', 'flatshading', @@ -1529,7 +1529,7 @@ class Mesh3d(PlotlyDict): 'reversescale', 'scene', 'showlegend', 'showscale', 'stream', 'type', 'uid', 'vertexcolor', 'vertexcolorsrc', 'visible', 'x', 'xcalendar', 'xsrc', 'y', 'ycalendar', 'ysrc', 'z', 'zcalendar', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1540,14 +1540,14 @@ class Mesh3d(PlotlyDict): class Ohlc(PlotlyDict): """ Valid attributes for 'ohlc' at path [] under parents (): - + ['close', 'closesrc', 'customdata', 'customdatasrc', 'decreasing', 'high', 'highsrc', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'increasing', 'legendgroup', 'line', 'low', 'lowsrc', 'name', 'opacity', 'open', 'opensrc', 'showlegend', 'stream', 'text', 'textsrc', 'tickwidth', 'type', 'uid', 'visible', 'x', 'xaxis', 'xcalendar', 'xsrc', 'yaxis'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1558,12 +1558,12 @@ class Ohlc(PlotlyDict): class Parcoords(PlotlyDict): """ Valid attributes for 'parcoords' at path [] under parents (): - + ['customdata', 'customdatasrc', 'dimensions', 'domain', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'labelfont', 'legendgroup', 'line', 'name', 'opacity', 'rangefont', 'showlegend', 'stream', 'tickfont', 'type', 'uid', 'visible'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1574,7 +1574,7 @@ class Parcoords(PlotlyDict): class Pie(PlotlyDict): """ Valid attributes for 'pie' at path [] under parents (): - + ['customdata', 'customdatasrc', 'direction', 'dlabel', 'domain', 'hole', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'insidetextfont', 'label0', 'labels', @@ -1583,7 +1583,7 @@ class Pie(PlotlyDict): 'showlegend', 'sort', 'stream', 'text', 'textfont', 'textinfo', 'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'values', 'valuessrc', 'visible'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1594,13 +1594,13 @@ class Pie(PlotlyDict): class Pointcloud(PlotlyDict): """ Valid attributes for 'pointcloud' at path [] under parents (): - + ['customdata', 'customdatasrc', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'indices', 'indicessrc', 'legendgroup', 'marker', 'name', 'opacity', 'showlegend', 'stream', 'text', 'textsrc', 'type', 'uid', 'visible', 'x', 'xaxis', 'xbounds', 'xboundssrc', 'xsrc', 'xy', 'xysrc', 'y', 'yaxis', 'ybounds', 'yboundssrc', 'ysrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1611,11 +1611,11 @@ class Pointcloud(PlotlyDict): class RadialAxis(PlotlyDict): """ Valid attributes for 'radialaxis' at path [] under parents (): - + ['domain', 'endpadding', 'orientation', 'range', 'showline', 'showticklabels', 'tickcolor', 'ticklen', 'tickorientation', 'ticksuffix', 'visible'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1626,12 +1626,12 @@ class RadialAxis(PlotlyDict): class Sankey(PlotlyDict): """ Valid attributes for 'sankey' at path [] under parents (): - + ['arrangement', 'customdata', 'customdatasrc', 'domain', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'link', 'name', 'node', 'opacity', 'orientation', 'showlegend', 'stream', 'textfont', 'type', 'uid', 'valueformat', 'valuesuffix', 'visible'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1642,7 +1642,7 @@ class Sankey(PlotlyDict): class Scatter(PlotlyDict): """ Valid attributes for 'scatter' at path [] under parents (): - + ['cliponaxis', 'connectgaps', 'customdata', 'customdatasrc', 'dx', 'dy', 'error_x', 'error_y', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hoveron', 'hovertext', 'hovertextsrc', @@ -1651,7 +1651,7 @@ class Scatter(PlotlyDict): 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'tsrc', 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1662,7 +1662,7 @@ class Scatter(PlotlyDict): class Scatter3d(PlotlyDict): """ Valid attributes for 'scatter3d' at path [] under parents (): - + ['connectgaps', 'customdata', 'customdatasrc', 'error_x', 'error_y', 'error_z', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'legendgroup', 'line', 'marker', @@ -1671,7 +1671,7 @@ class Scatter3d(PlotlyDict): 'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'visible', 'x', 'xcalendar', 'xsrc', 'y', 'ycalendar', 'ysrc', 'z', 'zcalendar', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1682,14 +1682,14 @@ class Scatter3d(PlotlyDict): class Scattercarpet(PlotlyDict): """ Valid attributes for 'scattercarpet' at path [] under parents (): - + ['a', 'asrc', 'b', 'bsrc', 'carpet', 'connectgaps', 'customdata', 'customdatasrc', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hoveron', 'ids', 'idssrc', 'legendgroup', 'line', 'marker', 'mode', 'name', 'opacity', 'showlegend', 'stream', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'visible', 'xaxis', 'yaxis'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1700,7 +1700,7 @@ class Scattercarpet(PlotlyDict): class Scattergeo(PlotlyDict): """ Valid attributes for 'scattergeo' at path [] under parents (): - + ['connectgaps', 'customdata', 'customdatasrc', 'fill', 'fillcolor', 'geo', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'lat', 'latsrc', 'legendgroup', @@ -1708,7 +1708,7 @@ class Scattergeo(PlotlyDict): 'marker', 'mode', 'name', 'opacity', 'showlegend', 'stream', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'visible'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1719,14 +1719,14 @@ class Scattergeo(PlotlyDict): class Scattergl(PlotlyDict): """ Valid attributes for 'scattergl' at path [] under parents (): - + ['connectgaps', 'customdata', 'customdatasrc', 'dx', 'dy', 'error_x', 'error_y', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'line', 'marker', 'mode', 'name', 'opacity', 'showlegend', 'stream', 'text', 'textsrc', 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1737,14 +1737,14 @@ class Scattergl(PlotlyDict): class Scattermapbox(PlotlyDict): """ Valid attributes for 'scattermapbox' at path [] under parents (): - + ['connectgaps', 'customdata', 'customdatasrc', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'lat', 'latsrc', 'legendgroup', 'line', 'lon', 'lonsrc', 'marker', 'mode', 'name', 'opacity', 'showlegend', 'stream', 'subplot', 'text', 'textfont', 'textposition', 'textsrc', 'type', 'uid', 'visible'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1755,7 +1755,7 @@ class Scattermapbox(PlotlyDict): class Scatterternary(PlotlyDict): """ Valid attributes for 'scatterternary' at path [] under parents (): - + ['a', 'asrc', 'b', 'bsrc', 'c', 'cliponaxis', 'connectgaps', 'csrc', 'customdata', 'customdatasrc', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hoveron', 'hovertext', 'hovertextsrc', @@ -1763,7 +1763,7 @@ class Scatterternary(PlotlyDict): 'opacity', 'showlegend', 'stream', 'subplot', 'sum', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'visible'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1774,11 +1774,11 @@ class Scatterternary(PlotlyDict): class Scene(PlotlyDict): """ Valid attributes for 'scene' at path [] under parents (): - + ['annotations', 'aspectmode', 'aspectratio', 'bgcolor', 'camera', 'cameraposition', 'domain', 'dragmode', 'hovermode', 'xaxis', 'yaxis', 'zaxis'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1789,9 +1789,9 @@ class Scene(PlotlyDict): class Stream(PlotlyDict): """ Valid attributes for 'stream' at path [] under parents (): - + ['maxpoints', 'token'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1802,7 +1802,7 @@ class Stream(PlotlyDict): class Surface(PlotlyDict): """ Valid attributes for 'surface' at path [] under parents (): - + ['autocolorscale', 'cauto', 'cmax', 'cmin', 'colorbar', 'colorscale', 'contours', 'customdata', 'customdatasrc', 'hidesurface', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', @@ -1811,7 +1811,7 @@ class Surface(PlotlyDict): 'surfacecolorsrc', 'text', 'textsrc', 'type', 'uid', 'visible', 'x', 'xcalendar', 'xsrc', 'y', 'ycalendar', 'ysrc', 'z', 'zauto', 'zcalendar', 'zmax', 'zmin', 'zsrc'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1822,13 +1822,13 @@ class Surface(PlotlyDict): class Table(PlotlyDict): """ Valid attributes for 'table' at path [] under parents (): - + ['cells', 'columnorder', 'columnordersrc', 'columnwidth', 'columnwidthsrc', 'customdata', 'customdatasrc', 'domain', 'header', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'name', 'opacity', 'showlegend', 'stream', 'type', 'uid', 'visible'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1843,7 +1843,7 @@ class Trace(dict): class XAxis(PlotlyDict): """ Valid attributes for 'xaxis' at path [] under parents (): - + ['anchor', 'autorange', 'autotick', 'backgroundcolor', 'calendar', 'categoryarray', 'categoryarraysrc', 'categoryorder', 'color', 'constrain', 'constraintoward', 'domain', 'dtick', 'exponentformat', @@ -1858,7 +1858,7 @@ class XAxis(PlotlyDict): 'tickprefix', 'ticks', 'ticksuffix', 'ticktext', 'ticktextsrc', 'tickvals', 'tickvalssrc', 'tickwidth', 'title', 'titlefont', 'type', 'visible', 'zeroline', 'zerolinecolor', 'zerolinewidth'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1869,9 +1869,9 @@ class XAxis(PlotlyDict): class XBins(PlotlyDict): """ Valid attributes for 'xbins' at path [] under parents (): - + ['end', 'size', 'start'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1882,7 +1882,7 @@ class XBins(PlotlyDict): class YAxis(PlotlyDict): """ Valid attributes for 'yaxis' at path [] under parents (): - + ['anchor', 'autorange', 'autotick', 'backgroundcolor', 'calendar', 'categoryarray', 'categoryarraysrc', 'categoryorder', 'color', 'constrain', 'constraintoward', 'domain', 'dtick', 'exponentformat', @@ -1897,7 +1897,7 @@ class YAxis(PlotlyDict): 'ticksuffix', 'ticktext', 'ticktextsrc', 'tickvals', 'tickvalssrc', 'tickwidth', 'title', 'titlefont', 'type', 'visible', 'zeroline', 'zerolinecolor', 'zerolinewidth'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1908,9 +1908,9 @@ class YAxis(PlotlyDict): class YBins(PlotlyDict): """ Valid attributes for 'ybins' at path [] under parents (): - + ['end', 'size', 'start'] - + Run `.help('attribute')` on any of the above. '' is the object at [] @@ -1921,7 +1921,7 @@ class YBins(PlotlyDict): class ZAxis(PlotlyDict): """ Valid attributes for 'zaxis' at path [] under parents (): - + ['autorange', 'backgroundcolor', 'calendar', 'categoryarray', 'categoryarraysrc', 'categoryorder', 'color', 'dtick', 'exponentformat', 'gridcolor', 'gridwidth', 'hoverformat', 'linecolor', @@ -1934,7 +1934,7 @@ class ZAxis(PlotlyDict): 'ticksuffix', 'ticktext', 'ticktextsrc', 'tickvals', 'tickvalssrc', 'tickwidth', 'title', 'titlefont', 'type', 'visible', 'zeroline', 'zerolinecolor', 'zerolinewidth'] - + Run `.help('attribute')` on any of the above. '' is the object at [] From 342d5ece5cb6dc162163bec48f805f27c0c7064e Mon Sep 17 00:00:00 2001 From: John Bampton Date: Sun, 7 Jan 2018 09:13:40 +1000 Subject: [PATCH 09/14] Fix indent. Do not use len sequence to determine if a sequence is empty (len-as-condition). --- plotly/offline/offline.py | 8 ++++---- plotly/widgets/graph_widget.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py index 6ab50476448..f86d7e516b5 100644 --- a/plotly/offline/offline.py +++ b/plotly/offline/offline.py @@ -267,8 +267,8 @@ def _plot_html(figure_or_data, config, validate, default_width, optional_line2 + '' '').format( - id=plotdivid, script=script, - height=height, width=width) + id=plotdivid, script=script, + height=height, width=width) return plotly_html_div, plotdivid, width, height @@ -369,7 +369,7 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly', if image not in __IMAGE_FORMATS: raise ValueError('The image parameter must be one of the following' ': {}'.format(__IMAGE_FORMATS) - ) + ) # if image is given, and is a valid format, we will download the image script = get_image_download_script('iplot').format(format=image, width=image_width, @@ -493,7 +493,7 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly', if image not in __IMAGE_FORMATS: raise ValueError('The image parameter must be one of the ' 'following: {}'.format(__IMAGE_FORMATS) - ) + ) # if the check passes then download script is injected. # write the download script: script = get_image_download_script('plot') diff --git a/plotly/widgets/graph_widget.py b/plotly/widgets/graph_widget.py index 451adf223bd..822899fae89 100644 --- a/plotly/widgets/graph_widget.py +++ b/plotly/widgets/graph_widget.py @@ -121,7 +121,7 @@ def _handle_registration(self, event_type, callback, remove): self._event_handlers[event_type].register_callback(callback, remove=remove) event_callbacks = self._event_handlers[event_type].callbacks - if (len(event_callbacks) and event_type not in self._listener_set): + if (event_callbacks and event_type not in self._listener_set): self._listener_set.add(event_type) message = {'task': 'listen', 'events': list(self._listener_set)} self._handle_outgoing_message(message) From fe1dcd7dd46a978ef1a91ef36d76f29e38ad30e9 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Mon, 8 Jan 2018 10:35:45 +1000 Subject: [PATCH 10/14] Fix unnecessary parens (superfluous-parens). --- plotly/widgets/graph_widget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/widgets/graph_widget.py b/plotly/widgets/graph_widget.py index 822899fae89..afab4c44925 100644 --- a/plotly/widgets/graph_widget.py +++ b/plotly/widgets/graph_widget.py @@ -121,7 +121,7 @@ def _handle_registration(self, event_type, callback, remove): self._event_handlers[event_type].register_callback(callback, remove=remove) event_callbacks = self._event_handlers[event_type].callbacks - if (event_callbacks and event_type not in self._listener_set): + if event_callbacks and event_type not in self._listener_set: self._listener_set.add(event_type) message = {'task': 'listen', 'events': list(self._listener_set)} self._handle_outgoing_message(message) From ad3db4157ad42d514f008ebf38ac0df91b2da7d1 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Mon, 8 Jan 2018 10:47:30 +1000 Subject: [PATCH 11/14] Standard imports 'time, webbrowser' should be placed before 'from pkg_resources import resource_string' (wrong-import-order). Surround top-level function and class definitions with two blank lines. --- plotly/offline/offline.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py index f86d7e516b5..96f7239068f 100644 --- a/plotly/offline/offline.py +++ b/plotly/offline/offline.py @@ -6,12 +6,12 @@ from __future__ import absolute_import import os +import time import uuid import warnings -from pkg_resources import resource_string -import time import webbrowser +from pkg_resources import resource_string from requests.compat import json as _json import plotly @@ -41,6 +41,7 @@ def get_plotlyjs(): plotlyjs = resource_string('plotly', path).decode('utf-8') return plotlyjs + def get_image_download_script(caller): """ This function will return a script that will download an image of a Plotly From e4caf06b6a223c7102264d3b7c805f0a150a14e5 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Mon, 8 Jan 2018 11:07:35 +1000 Subject: [PATCH 12/14] Pylint fixes again. --- plotly/dashboard_objs/dashboard_objs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plotly/dashboard_objs/dashboard_objs.py b/plotly/dashboard_objs/dashboard_objs.py index 1b3b215ed34..e93f6a60006 100644 --- a/plotly/dashboard_objs/dashboard_objs.py +++ b/plotly/dashboard_objs/dashboard_objs.py @@ -62,6 +62,7 @@ def _container(box_1=None, box_2=None, size=MASTER_HEIGHT, } return container + dashboard_html = (""" @@ -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'] = '%' From fed867ae595137ee30b84ea8886897c381e963df Mon Sep 17 00:00:00 2001 From: John Bampton Date: Mon, 8 Jan 2018 11:21:17 +1000 Subject: [PATCH 13/14] Pylint fixes again. --- plotly/matplotlylib/mpltools.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plotly/matplotlylib/mpltools.py b/plotly/matplotlylib/mpltools.py index bc90074bdc8..f5e99e29e22 100644 --- a/plotly/matplotlylib/mpltools.py +++ b/plotly/matplotlylib/mpltools.py @@ -292,6 +292,7 @@ def convert_path_array(path_array): else: return symbols + def convert_linewidth_array(width_array): if len(width_array) == 1: return width_array[0] @@ -308,7 +309,7 @@ def convert_size_array(size_array): def get_markerstyle_from_collection(props): - markerstyle=dict( + markerstyle = dict( alpha=None, facecolor=convert_rgba_array(props['styles']['facecolor']), marker=convert_path_array(props['paths']), @@ -339,6 +340,7 @@ def get_rect_ymax(data): """Find maximum y value from four (x,y) vertices.""" return max(data[0][1], data[1][1], data[2][1], data[3][1]) + def get_spine_visible(ax, spine_key): """Return some spine parameters for the spine, `spine_key`.""" spine = ax.spines[spine_key] @@ -393,6 +395,7 @@ def make_bar(**props): 'zorder': props['style']['zorder'] } + def prep_ticks(ax, index, ax_type, props): """Prepare axis obj belonging to axes obj. @@ -444,10 +447,10 @@ def prep_ticks(ax, index, ax_type, props): if base == 10: if ax_type == 'x': axis_dict['range'] = [math.log10(props['xlim'][0]), - math.log10(props['xlim'][1])] + math.log10(props['xlim'][1])] elif ax_type == 'y': axis_dict['range'] = [math.log10(props['ylim'][0]), - math.log10(props['ylim'][1])] + math.log10(props['ylim'][1])] else: axis_dict = dict(range=None, type='linear') warnings.warn("Converted non-base10 {0}-axis log scale to 'linear'" From 486b81d9783674edbfd8006afe3a86c54d47788a Mon Sep 17 00:00:00 2001 From: John Bampton Date: Thu, 11 Jan 2018 20:55:23 +1000 Subject: [PATCH 14/14] Fix undefined reference to __version__ in setup.py. Pylint showed an undefined variable error. You can test this fix by changing the 'version' in version.py or setup.py and then running from the command line: python3 setup.py --version Also a few other pylint fixes. --- plotly/grid_objs/grid_objs.py | 2 +- plotly/plotly/plotly.py | 1 + plotly/tests/test_optional/test_matplotlylib/data/scatter.py | 2 +- setup.py | 5 +++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plotly/grid_objs/grid_objs.py b/plotly/grid_objs/grid_objs.py index d373d39d2e2..159f6e86581 100644 --- a/plotly/grid_objs/grid_objs.py +++ b/plotly/grid_objs/grid_objs.py @@ -207,7 +207,7 @@ def __init__(self, columns_or_json, fid=None): ordered_columns.append(Column( columns_or_json['cols'][column_name]['data'], column_name) - ) + ) self._columns = ordered_columns # fill in column_ids diff --git a/plotly/plotly/plotly.py b/plotly/plotly/plotly.py index b14d4912697..740ca347463 100644 --- a/plotly/plotly/plotly.py +++ b/plotly/plotly/plotly.py @@ -66,6 +66,7 @@ def sign_in(username, api_key, **kwargs): except exceptions.PlotlyRequestError: raise exceptions.PlotlyError('Sign in failed.') + update_plot_options = session.update_session_plot_options diff --git a/plotly/tests/test_optional/test_matplotlylib/data/scatter.py b/plotly/tests/test_optional/test_matplotlylib/data/scatter.py index 28106aabd30..6243e967f85 100644 --- a/plotly/tests/test_optional/test_matplotlylib/data/scatter.py +++ b/plotly/tests/test_optional/test_matplotlylib/data/scatter.py @@ -4,7 +4,7 @@ Marker, Scatter, XAxis, YAxis) D = dict( - x1=[1, 2, 2, 4, 5, 6, 1, 7, 8, 5 ,3], + x1=[1, 2, 2, 4, 5, 6, 1, 7, 8, 5, 3], y1=[5, 3, 7, 2, 9, 7, 8, 4, 5, 9, 2], x2=[-1, 1, -0.3, -0.6, 0.4, 0.8, -0.1, 0.7], y2=[-0.5, 0.4, 0.7, -0.6, 0.3, -1, 0, 0.3] diff --git a/setup.py b/setup.py index 9a73fc42068..f95b29f27eb 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ from setuptools import setup -exec(open('plotly/version.py').read()) +main_ns = {} +exec(open('plotly/version.py').read(), main_ns) def readme(): @@ -9,7 +10,7 @@ def readme(): setup(name='plotly', - version=__version__, + version=main_ns['__version__'], use_2to3=False, author='Chris P', author_email='chris@plot.ly',