Skip to content

Commit e67f80e

Browse files
authored
Fixed paramval2str type error for non-str lists
Hi, if you have parameter with list of something other than list (e.g. list of dicts), you'll get a error `TypeError: sequence item 0: expected str instance, <YOUR_NON_STR_TYPE_HERE> found`. With this fix you'll convert everything to string recursively, thus preserving better text output. Slightly better than verybadsoldier#88
1 parent 878f9a5 commit e67f80e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backtrader_plotting/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def paramval2str(name, value):
2424
elif isinstance(value, float):
2525
return f"{value:.2f}"
2626
elif isinstance(value, (list,tuple)):
27-
return ','.join(value)
27+
return ','.join(map(lambda x: paramval2str(name, x), value))
2828
elif isinstance(value, type):
2929
return value.__name__
3030
else:

0 commit comments

Comments
 (0)