Skip to content

Commit b106d2d

Browse files
committed
Reformat according to black and add a few missing commas
1 parent d624606 commit b106d2d

File tree

1 file changed

+31
-25
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+31
-25
lines changed

packages/python/plotly/plotly/express/_doc.py

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@
1010
# TODO document "or `None`, default `None`" in various places
1111
# TODO standardize positioning and casing of 'default'
1212

13-
colref = ("str or int or Series or array-like",
14-
"Either a name of a column in `data_frame`, or a pandas Series or array_like object.")
13+
colref = (
14+
"str or int or Series or array-like",
15+
"Either a name of a column in `data_frame`, or a pandas Series or array_like object.",
16+
)
1517

16-
colref_list = ("list of str or int, or Series or array-like",
17-
"Either names of columns in `data_frame`, or pandas Series, or array_like objects")
18+
colref_list = (
19+
"list of str or int, or Series or array-like",
20+
"Either names of columns in `data_frame`, or pandas Series, or array_like objects",
21+
)
1822

1923
docs = dict(
2024
data_frame=[
2125
"DataFrame or array-like or dict",
2226
"This argument needs to be passed for column names (and not keyword names) to be used.",
23-
"Array-like and dict are tranformed internally to a pandas DataFrame."
27+
"Array-like and dict are tranformed internally to a pandas DataFrame.",
2428
],
2529
x=[
2630
*colref,
@@ -107,9 +111,7 @@
107111
*colref,
108112
"Values from this column or array_like are used to assign color to marks.",
109113
],
110-
opacity=[
111-
"float",
112-
"Value between 0 and 1. Sets the opacity for markers."],
114+
opacity=["float", "Value between 0 and 1. Sets the opacity for markers."],
113115
line_dash=[
114116
*colref,
115117
"Values from this column or array_like are used to assign dash-patterns to lines.",
@@ -164,8 +166,8 @@
164166
"Values from this column or array_like are used to provide object-constancy across animation frames: rows with matching `animation_group`s will be treated as if they describe the same object in each frame.",
165167
],
166168
symbol_sequence=[
167-
"list of str"
168-
"Strings should define valid plotly.js symbols.",
169+
"list of str",
170+
"Strings should define valid plotly.js symbols.",
169171
"When `symbol` is set, values in that column are assigned symbols by cycling through `symbol_sequence` in the order described in `category_orders`, unless the value of `symbol` is a key in `symbol_map`.",
170172
],
171173
symbol_map=[
@@ -339,33 +341,34 @@
339341
"`None` will stack up all values at each location coordinate.",
340342
],
341343
barmode=[
342-
"str (default `'relative'`)"
344+
"str (default `'relative'`)",
343345
"One of `'group'`, `'overlay'` or `'relative'`",
344346
"In `'relative'` mode, bars are stacked above zero for positive values and below zero for negative values.",
345347
"In `'overlay'` mode, bars are drawn on top of one another.",
346348
"In `'group'` mode, bars are placed beside each other.",
347349
],
348350
boxmode=[
349-
"str (default `'group'`)"
351+
"str (default `'group'`)",
350352
"One of `'group'` or `'overlay'`",
351353
"In `'overlay'` mode, boxes are on drawn top of one another.",
352354
"In `'group'` mode, baxes are placed beside each other.",
353355
],
354356
violinmode=[
355-
"str (default `'group'`)"
357+
"str (default `'group'`)",
356358
"One of `'group'` or `'overlay'`",
357359
"In `'overlay'` mode, violins are on drawn top of one another.",
358360
"In `'group'` mode, violins are placed beside each other.",
359361
],
360362
stripmode=[
361-
"str (default `'group'`)"
363+
"str (default `'group'`)",
362364
"One of `'group'` or `'overlay'`",
363365
"In `'overlay'` mode, strips are on drawn top of one another.",
364366
"In `'group'` mode, strips are placed beside each other.",
365367
],
366368
zoom=["int (default `8`)", "Between 0 and 20.", "Sets map zoom level."],
367369
orientation=[
368-
"str (default `'v'`)", "One of `'h'` for horizontal or `'v'` for vertical)",
370+
"str (default `'v'`)",
371+
"One of `'h'` for horizontal or `'v'` for vertical)",
369372
],
370373
line_close=[
371374
"boolean (default `False`)",
@@ -375,25 +378,26 @@
375378
scope=[
376379
"str (default `'world'`).",
377380
"One of `'world'`, `'usa'`, `'europe'`, `'asia'`, `'africa'`, `'north america'`, `'south america'`)"
378-
"Default is `'world'` unless `projection` is set to `'albers usa'`, which forces `'usa'`."
381+
"Default is `'world'` unless `projection` is set to `'albers usa'`, which forces `'usa'`.",
379382
],
380383
projection=[
381384
"str ",
382385
"One of `'equirectangular'`, `'mercator'`, `'orthographic'`, `'natural earth'`, `'kavrayskiy7'`, `'miller'`, `'robinson'`, `'eckert4'`, `'azimuthal equal area'`, `'azimuthal equidistant'`, `'conic equal area'`, `'conic conformal'`, `'conic equidistant'`, `'gnomonic'`, `'stereographic'`, `'mollweide'`, `'hammer'`, `'transverse mercator'`, `'albers usa'`, `'winkel tripel'`, `'aitoff'`, `'sinusoidal'`"
383-
"Default depends on `scope`."
386+
"Default depends on `scope`.",
387+
],
388+
center=[
389+
"dict",
390+
"Dict keys are `'lat'` and `'lon'`",
391+
"Sets the center point of the map.",
384392
],
385-
center=["dict", "Dict keys are `'lat'` and `'lon'`", "Sets the center point of the map."],
386393
points=[
387394
"str or boolean (default `'outliers'`)",
388395
"One of `'all'`, `'outliers'`, or `False`.",
389396
"If `'outliers'`, only the sample points lying outside the whiskers are shown.",
390397
"If `'all'`, all sample points are shown.",
391398
"If `False`, no sample points are shown",
392399
],
393-
box=[
394-
"boolean (default `False`)",
395-
"If `True`, boxes are drawn inside the violins.",
396-
],
400+
box=["boolean (default `False`)", "If `True`, boxes are drawn inside the violins."],
397401
notched=["boolean (default `False`)", "If `True`, boxes are drawn with notches."],
398402
cumulative=[
399403
"boolean (default `False`)",
@@ -409,9 +413,11 @@ def make_docstring(fn):
409413
result = (fn.__doc__ or "") + "\nParameters\n----------\n"
410414
for param in inspect.getargspec(fn)[0]:
411415
param_desc_list = docs[param][1:]
412-
param_desc = (indent(fill(" ".join(param_desc_list or "")), ' ')
413-
if param in docs
414-
else "(documentation missing from map)")
416+
param_desc = (
417+
indent(fill(" ".join(param_desc_list or "")), " ")
418+
if param in docs
419+
else "(documentation missing from map)"
420+
)
415421
param_type = docs[param][0]
416422
result += "%s: %s\n%s\n" % (param, param_type, param_desc)
417423
result += "\nReturns\n-------\n"

0 commit comments

Comments
 (0)