Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aa9caef

Browse filesBrowse files
committed
merge conflicts
2 parents 8b1d902 + 1bf7bc2 commit aa9caef
Copy full SHA for aa9caef

File tree

Expand file treeCollapse file tree

20 files changed

+122
-115
lines changed
Filter options
Expand file treeCollapse file tree

20 files changed

+122
-115
lines changed

‎contributing.md

Copy file name to clipboardExpand all lines: contributing.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ First, you'll need to *get* our project. This is the appropriate *clone* command
2323
**DO THIS (in the directory where you want the repo to live)**
2424

2525
```bash
26-
git clone https://github.com/plotly/python-api.git
26+
git clone https://github.com/your_github_username/plotly.py.git
2727
```
2828

2929
### Submodules
3030

3131
Second, this project uses git submodules! They're both helpful and, at times, difficult to work with. The good news is you probably don't need to think about them! Just run the following shell command to make sure that your local repo is wired properly:
3232

33-
**DO THIS (run this command in your new `plotly-api` directory)**
33+
**DO THIS (run this command in your new `plotly.py` directory)**
3434

3535
```bash
3636
make setup_subs

‎plotly/colors.py

Copy file name to clipboardExpand all lines: plotly/colors.py
+6-6Lines 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

Copy file name to clipboardExpand all lines: plotly/dashboard_objs/dashboard_objs.py
+2-1Lines 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

Copy file name to clipboardExpand all lines: plotly/figure_factory/_annotated_heatmap.py
+2-2Lines 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

Copy file name to clipboardExpand all lines: plotly/figure_factory/_dendrogram.py
+13-13Lines 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

Copy file name to clipboardExpand all lines: plotly/figure_factory/_facet_grid.py
+7-7Lines 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

Copy file name to clipboardExpand all lines: plotly/figure_factory/_scatterplot.py
+2-2Lines 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

Copy file name to clipboardExpand all lines: plotly/figure_factory/utils.py
+4-4Lines 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):

‎plotly/graph_objs/graph_objs.py

Copy file name to clipboardExpand all lines: plotly/graph_objs/graph_objs.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def get_ordered(self, **kwargs):
310310
def to_string(self, level=0, indent=4, eol='\n',
311311
pretty=True, max_chars=80):
312312
"""Get formatted string by calling `to_string` on children items."""
313-
if not len(self):
313+
if not self:
314314
return "{name}()".format(name=self._get_class_name())
315315
string = "{name}([{eol}{indent}".format(
316316
name=self._get_class_name(),
@@ -691,7 +691,7 @@ def to_string(self, level=0, indent=4, eol='\n',
691691
print(obj.to_string())
692692
693693
"""
694-
if not len(self):
694+
if not self:
695695
return "{name}()".format(name=self._get_class_name())
696696
string = "{name}(".format(name=self._get_class_name())
697697
if self._name in graph_reference.TRACE_NAMES:
@@ -759,7 +759,7 @@ def force_clean(self, **kwargs):
759759
except AttributeError:
760760
pass
761761
if isinstance(self[key], (dict, list)):
762-
if len(self[key]) == 0:
762+
if not self[key]:
763763
del self[key] # clears empty collections!
764764
elif self[key] is None:
765765
del self[key]

‎plotly/graph_reference.py

Copy file name to clipboardExpand all lines: plotly/graph_reference.py
+50-50Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -72,55 +72,55 @@ def get_graph_reference():
7272

7373
# TODO: Patch in frames info until it hits streambed. See #659
7474
graph_reference['frames'] = {
75-
"items": {
76-
"frames_entry": {
77-
"baseframe": {
78-
"description": "The name of the frame into which this "
79-
"frame's properties are merged before "
80-
"applying. This is used to unify "
81-
"properties and avoid needing to specify "
82-
"the same values for the same properties "
83-
"in multiple frames.",
84-
"role": "info",
85-
"valType": "string"
86-
},
87-
"data": {
88-
"description": "A list of traces this frame modifies. "
89-
"The format is identical to the normal "
90-
"trace definition.",
91-
"role": "object",
92-
"valType": "any"
93-
},
94-
"group": {
95-
"description": "An identifier that specifies the group "
96-
"to which the frame belongs, used by "
97-
"animate to select a subset of frames.",
98-
"role": "info",
99-
"valType": "string"
100-
},
101-
"layout": {
102-
"role": "object",
103-
"description": "Layout properties which this frame "
104-
"modifies. The format is identical to "
105-
"the normal layout definition.",
106-
"valType": "any"
107-
},
108-
"name": {
109-
"description": "A label by which to identify the frame",
110-
"role": "info",
111-
"valType": "string"
112-
},
113-
"role": "object",
114-
"traces": {
115-
"description": "A list of trace indices that identify "
116-
"the respective traces in the data "
117-
"attribute",
118-
"role": "info",
119-
"valType": "info_array"
120-
}
121-
}
122-
},
123-
"role": "object"
75+
"items": {
76+
"frames_entry": {
77+
"baseframe": {
78+
"description": "The name of the frame into which this "
79+
"frame's properties are merged before "
80+
"applying. This is used to unify "
81+
"properties and avoid needing to specify "
82+
"the same values for the same properties "
83+
"in multiple frames.",
84+
"role": "info",
85+
"valType": "string"
86+
},
87+
"data": {
88+
"description": "A list of traces this frame modifies. "
89+
"The format is identical to the normal "
90+
"trace definition.",
91+
"role": "object",
92+
"valType": "any"
93+
},
94+
"group": {
95+
"description": "An identifier that specifies the group "
96+
"to which the frame belongs, used by "
97+
"animate to select a subset of frames.",
98+
"role": "info",
99+
"valType": "string"
100+
},
101+
"layout": {
102+
"role": "object",
103+
"description": "Layout properties which this frame "
104+
"modifies. The format is identical to "
105+
"the normal layout definition.",
106+
"valType": "any"
107+
},
108+
"name": {
109+
"description": "A label by which to identify the frame",
110+
"role": "info",
111+
"valType": "string"
112+
},
113+
"role": "object",
114+
"traces": {
115+
"description": "A list of trace indices that identify "
116+
"the respective traces in the data "
117+
"attribute",
118+
"role": "info",
119+
"valType": "info_array"
120+
}
121+
}
122+
},
123+
"role": "object"
124124
}
125125

126126
return graph_reference
@@ -223,7 +223,7 @@ def get_attributes_dicts(object_name, parent_object_names=()):
223223
# We return a dict mapping paths to attributes. We also add in additional
224224
# attributes if defined.
225225
attributes_dicts = {path: utils.get_by_path(GRAPH_REFERENCE, path)
226-
for path in attribute_paths}
226+
for path in attribute_paths}
227227
attributes_dicts['additional_attributes'] = additional_attributes
228228

229229
return attributes_dicts

‎plotly/grid_objs/grid_objs.py

Copy file name to clipboardExpand all lines: plotly/grid_objs/grid_objs.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def __init__(self, columns_or_json, fid=None):
207207
ordered_columns.append(Column(
208208
columns_or_json['cols'][column_name]['data'],
209209
column_name)
210-
)
210+
)
211211
self._columns = ordered_columns
212212

213213
# fill in column_ids

‎plotly/matplotlylib/mpltools.py

Copy file name to clipboardExpand all lines: plotly/matplotlylib/mpltools.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ def convert_path_array(path_array):
292292
else:
293293
return symbols
294294

295+
295296
def convert_linewidth_array(width_array):
296297
if len(width_array) == 1:
297298
return width_array[0]
@@ -308,7 +309,7 @@ def convert_size_array(size_array):
308309

309310

310311
def get_markerstyle_from_collection(props):
311-
markerstyle=dict(
312+
markerstyle = dict(
312313
alpha=None,
313314
facecolor=convert_rgba_array(props['styles']['facecolor']),
314315
marker=convert_path_array(props['paths']),
@@ -339,6 +340,7 @@ def get_rect_ymax(data):
339340
"""Find maximum y value from four (x,y) vertices."""
340341
return max(data[0][1], data[1][1], data[2][1], data[3][1])
341342

343+
342344
def get_spine_visible(ax, spine_key):
343345
"""Return some spine parameters for the spine, `spine_key`."""
344346
spine = ax.spines[spine_key]
@@ -393,6 +395,7 @@ def make_bar(**props):
393395
'zorder': props['style']['zorder']
394396
}
395397

398+
396399
def prep_ticks(ax, index, ax_type, props):
397400
"""Prepare axis obj belonging to axes obj.
398401
@@ -444,10 +447,10 @@ def prep_ticks(ax, index, ax_type, props):
444447
if base == 10:
445448
if ax_type == 'x':
446449
axis_dict['range'] = [math.log10(props['xlim'][0]),
447-
math.log10(props['xlim'][1])]
450+
math.log10(props['xlim'][1])]
448451
elif ax_type == 'y':
449452
axis_dict['range'] = [math.log10(props['ylim'][0]),
450-
math.log10(props['ylim'][1])]
453+
math.log10(props['ylim'][1])]
451454
else:
452455
axis_dict = dict(range=None, type='linear')
453456
warnings.warn("Converted non-base10 {0}-axis log scale to 'linear'"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.