Skip to content

Commit

Permalink
add ability to sort kwargs in kwarg_help()
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielGoldfarb committed Jan 12, 2022
1 parent 211431a commit 882bd91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mplfinance/_kwarg_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def left_formatter(value):
return left_formatter


def kwarg_help( func_name=None, kwarg_names=None ):
def kwarg_help( func_name=None, kwarg_names=None, sort=False ):

func_kwarg_map = {
'plot' : mpf.plotting._valid_plot_kwargs,
Expand Down Expand Up @@ -113,6 +113,7 @@ def kwarg_help( func_name=None, kwarg_names=None ):

df = (pd.DataFrame(vks).T).drop('Validator',axis=1)
df.index.name = 'Kwarg'
if sort: df.sort_index(inplace=True)
df.reset_index(inplace=True)

if kwarg_names is not None:
Expand Down

0 comments on commit 882bd91

Please sign in to comment.