Skip to content

Commit 00def09

Browse files
committed
Indent param desc to improve readability
1 parent 457c083 commit 00def09

File tree

1 file changed

+8
-8
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import inspect
2+
from textwrap import fill, indent
23

34

45
colref = ("str or int or Series or array-like",
@@ -406,14 +407,13 @@
406407

407408
def make_docstring(fn):
408409
result = (fn.__doc__ or "") + "\nParameters\n----------\n"
409-
for arg in inspect.getargspec(fn)[0]:
410-
d = (
411-
" ".join(docs[arg] or "")
412-
if arg in docs
413-
else "(documentation missing from map)"
414-
)
415-
result += " %s: %s\n" % (arg, d)
416-
result += "Returns:\n"
410+
for param in inspect.getargspec(fn)[0]:
411+
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)")
415+
param_type = docs[param][0]
416+
result += "%s: %s\n%s\n" % (param, param_type, param_desc)
417417
result += "\nReturns\n-------\n"
418418
result += " A `Figure` object."
419419
return result

0 commit comments

Comments
 (0)