Skip to content

Commit dc95949

Browse files
committed
Kwargs for plotting with descriptions and sorted alphabetically
1 parent d777f43 commit dc95949

File tree

2 files changed

+283
-172
lines changed

2 files changed

+283
-172
lines changed

src/mplfinance/_arg_validators.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,16 @@ def _kwarg_not_implemented(value):
274274
raise NotImplementedError('kwarg NOT implemented.')
275275

276276
def _validate_vkwargs_dict(vkwargs):
277-
# Check that we didn't make a typo in any of the things
278-
# that should be the same for all vkwargs dict items:
277+
"""
278+
Check that we didn't make a typo in any of the things
279+
that should be the same for all vkwargs dict items:
280+
281+
{kwarg : {'Default': ... , 'Description': ... , 'Validator': ...} }
282+
"""
279283
for key, value in vkwargs.items():
280-
if len(value) != 2:
281-
raise ValueError('Items != 2 in valid kwarg table, for kwarg "'+key+'"')
284+
# has been changed to 3 to support descriptions
285+
if len(value) != 3:
286+
raise ValueError('Items != 3 in valid kwarg table, for kwarg "'+key+'"')
282287
if 'Default' not in value:
283288
raise ValueError('Missing "Default" value for kwarg "'+key+'"')
284289
if 'Validator' not in value:

0 commit comments

Comments
 (0)