@@ -355,58 +355,73 @@ def _valid_renko_kwargs():
355355 '''
356356 Construct and return the "valid renko kwargs table" for the mplfinance.plot(type='renko')
357357 function. A valid kwargs table is a `dict` of `dict`s. The keys of the outer dict are
358- the valid key-words for the function. The value for each key is a dict containing 2
359- specific keys: "Default", and "Validator" with the following values:
358+ the valid key-words for the function. The value for each key is a dict containing 3
359+ specific keys: "Default", "Description" and "Validator" with the following values:
360360 "Default" - The default value for the kwarg if none is specified.
361+ "Description" - The description for the kwarg.
361362 "Validator" - A function that takes the caller specified value for the kwarg,
362363 and validates that it is the correct type, and (for kwargs with
363364 a limited set of allowed values) may also validate that the
364365 kwarg value is one of the allowed values.
365366 '''
366367 vkwargs = {
367368 'brick_size' : { 'Default' : 'atr' ,
368- 'Validator' : lambda value : isinstance (value ,(float ,int )) or value == 'atr' },
369+ 'Description' : '' ,
370+ 'Validator' : lambda value : isinstance (value ,(float ,int ))
371+ or value == 'atr' },
369372 'atr_length' : { 'Default' : 14 ,
370- 'Validator' : lambda value : isinstance (value ,int ) or value == 'total' },
373+ 'Description' : '' ,
374+ 'Validator' : lambda value : isinstance (value ,int )
375+ or value == 'total' },
371376 }
372377
373378 _validate_vkwargs_dict (vkwargs )
374379
375380 return vkwargs
376381
382+
377383def _valid_pnf_kwargs ():
378384 '''
379385 Construct and return the "valid pnf kwargs table" for the mplfinance.plot(type='pnf')
380386 function. A valid kwargs table is a `dict` of `dict`s. The keys of the outer dict are
381- the valid key-words for the function. The value for each key is a dict containing 2
382- specific keys: "Default", and "Validator" with the following values:
387+ the valid key-words for the function. The value for each key is a dict containing 3
388+ specific keys: "Default", "Description" and "Validator" with the following values:
383389 "Default" - The default value for the kwarg if none is specified.
390+ "Description" - The description for the kwarg.
384391 "Validator" - A function that takes the caller specified value for the kwarg,
385392 and validates that it is the correct type, and (for kwargs with
386393 a limited set of allowed values) may also validate that the
387394 kwarg value is one of the allowed values.
388395 '''
389396 vkwargs = {
390397 'box_size' : { 'Default' : 'atr' ,
391- 'Validator' : lambda value : isinstance (value ,(float ,int )) or value == 'atr' },
398+ 'Description' : '' ,
399+ 'Validator' : lambda value : isinstance (value ,(float ,int ))
400+ or value == 'atr' },
392401 'atr_length' : { 'Default' : 14 ,
393- 'Validator' : lambda value : isinstance (value ,int ) or value == 'total' },
402+ 'Description' : '' ,
403+ 'Validator' : lambda value : isinstance (value ,int )
404+ or value == 'total' },
405+
394406 'reversal' : { 'Default' : 1 ,
395- 'Validator' : lambda value : isinstance (value ,int ) }
407+ 'Description' : '' ,
408+ 'Validator' : lambda value : isinstance (value ,int ) },
396409 }
397410
398411 _validate_vkwargs_dict (vkwargs )
399412
400413 return vkwargs
401414
415+
402416def _valid_lines_kwargs ():
403417 '''
404418 Construct and return the "valid lines (hlines,vlines,alines,tlines) kwargs table"
405419 for the mplfinance.plot() `[h|v|a|t]lines=` kwarg functions.
406420 A valid kwargs table is a `dict` of `dict`s. The keys of the outer dict are
407- the valid key-words for the function. The value for each key is a dict containing 2
408- specific keys: "Default", and "Validator" with the following values:
421+ the valid key-words for the function. The value for each key is a dict containing 3
422+ specific keys: "Default", "Description" and "Validator" with the following values:
409423 "Default" - The default value for the kwarg if none is specified.
424+ "Description" - The description for the kwarg.
410425 "Validator" - A function that takes the caller specified value for the kwarg,
411426 and validates that it is the correct type, and (for kwargs with
412427 a limited set of allowed values) may also validate that the
@@ -415,32 +430,53 @@ def _valid_lines_kwargs():
415430 valid_linestyles = ['-' ,'solid' ,'--' ,'dashed' ,'-.' ,'dashdot' ,':' ,'dotted' ,None ,' ' ,'' ]
416431 vkwargs = {
417432 'hlines' : { 'Default' : None ,
433+ 'Description' : '' ,
418434 'Validator' : _bypass_kwarg_validation },
435+
419436 'vlines' : { 'Default' : None ,
437+ 'Description' : '' ,
420438 'Validator' : _bypass_kwarg_validation },
439+
421440 'alines' : { 'Default' : None ,
441+ 'Description' : '' ,
422442 'Validator' : _bypass_kwarg_validation },
443+
423444 'tlines' : { 'Default' : None ,
445+ 'Description' : '' ,
424446 'Validator' : _bypass_kwarg_validation },
447+
425448 'colors' : { 'Default' : None ,
426- 'Validator' : lambda value : value is None or
427- mcolors .is_color_like (value ) or
428- ( isinstance (value ,(list ,tuple )) and
429- all ([mcolors .is_color_like (v ) for v in value ]) ) },
449+ 'Description' : '' ,
450+ 'Validator' : lambda value : value is None
451+ or mcolors .is_color_like (value )
452+ or (isinstance (value ,(list ,tuple ))
453+ and all ([mcolors .is_color_like (v ) for v in value ]) ) },
454+
430455 'linestyle' : { 'Default' : '-' ,
431- 'Validator' : lambda value : value is None or value in valid_linestyles },
456+ 'Description' : '' ,
457+ 'Validator' : lambda value : value is None
458+ or value in valid_linestyles },
459+
432460 'linewidths' : { 'Default' : None ,
433- 'Validator' : lambda value : value is None or
434- isinstance (value ,(float ,int )) or
435- all ([isinstance (v ,(float ,int )) for v in value ]) },
461+ 'Description' : '' ,
462+ 'Validator' : lambda value : value is None
463+ or isinstance (value ,(float ,int ))
464+ or all ([isinstance (v ,(float ,int )) for v in value ]) },
465+
436466 'alpha' : { 'Default' : 1.0 ,
467+ 'Description' : '' ,
437468 'Validator' : lambda value : isinstance (value ,(float ,int )) },
438469
439- 'tline_use' : { 'Default' : 'close' ,
440- 'Validator' : lambda value : isinstance (value ,str ) or (isinstance (value ,(list ,tuple )) and
441- all ([isinstance (v ,str ) for v in value ]) ) },
442- 'tline_method' : { 'Default' : 'point-to-point' ,
443- 'Validator' : lambda value : value in ['point-to-point' ,'least-squares' ] }
470+
471+ 'tline_use' : { 'Default' : 'close' ,
472+ 'Description' : '' ,
473+ 'Validator' : lambda value : isinstance (value ,str )
474+ or (isinstance (value ,(list ,tuple ))
475+ and all ([isinstance (v ,str ) for v in value ]) ) },
476+
477+ 'tline_method' : { 'Default' : 'point-to-point' ,
478+ 'Description' : '' ,
479+ 'Validator' : lambda value : value in ['point-to-point' ,'least-squares' ] }
444480 }
445481
446482 _validate_vkwargs_dict (vkwargs )
0 commit comments