Skip to content

Commit aa9caef

Browse files
committed
merge conflicts
2 parents 8b1d902 + 1bf7bc2 commit aa9caef

File tree

20 files changed

+122
-115
lines changed

20 files changed

+122
-115
lines changed

contributing.md

Lines 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

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):

plotly/graph_objs/graph_objs.py

Lines 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

Lines 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

0 commit comments

Comments
 (0)