File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
packages/python/plotly/plotly/express Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
import inspect
2
+ from textwrap import fill , indent
2
3
3
4
4
5
colref = ("str or int or Series or array-like" ,
406
407
407
408
def make_docstring (fn ):
408
409
result = (fn .__doc__ or "" ) + "\n Parameters\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 )
417
417
result += "\n Returns\n -------\n "
418
418
result += " A `Figure` object."
419
419
return result
You can’t perform that action at this time.
0 commit comments