Skip to content

Commit

Permalink
Merge pull request #491 from DanielGoldfarb/master
Browse files Browse the repository at this point in the history
Ability to sort kwargs alphabetically when calling `kwarg_help()`
  • Loading branch information
DanielGoldfarb authored Jan 12, 2022
2 parents bde1082 + 418ff1f commit 3be3afd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ __pycache__
.tox/
.cache/
*.code-workspace
examples/.ipynb_checkpoints/
examples/scratch_pad/.ipynb_checkpoints/
*.ipynb_checkpoints/
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
1 change: 1 addition & 0 deletions src/mplfinance/_styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def _valid_make_mpf_style_kwargs():
'Validator' : lambda value: isinstance(value,dict) },

'style_name' : { 'Default' : None,
'Description' : '',
'Validator' : lambda value: isinstance(value,str) },

}
Expand Down
2 changes: 1 addition & 1 deletion src/mplfinance/_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

version_info = (0, 12, 8, 'beta', 7)
version_info = (0, 12, 8, 'beta', 8)

_specifier_ = {'alpha': 'a','beta': 'b','candidate': 'rc','final': ''}

Expand Down

0 comments on commit 3be3afd

Please sign in to comment.