From 2fe3be81157bf5d1e9faf02232dbbb9679cfe149 Mon Sep 17 00:00:00 2001 From: haigh1510 <64354653+haigh1510@users.noreply.github.com> Date: Fri, 4 Feb 2022 11:10:44 +0300 Subject: [PATCH 1/2] Fixed type error for non-str lists Error description: `TypeError: sequence item 0: expected str instance, int found` --- backtrader_plotting/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backtrader_plotting/utils.py b/backtrader_plotting/utils.py index 5bb5baf..d719d04 100644 --- a/backtrader_plotting/utils.py +++ b/backtrader_plotting/utils.py @@ -24,7 +24,7 @@ def paramval2str(name, value): elif isinstance(value, float): return f"{value:.2f}" elif isinstance(value, (list,tuple)): - return ','.join(value) + return ','.join(map(str, a)) elif isinstance(value, type): return value.__name__ else: From e3c08da8341b9ce132f9f13b934c05e7352539ac Mon Sep 17 00:00:00 2001 From: haigh1510 <64354653+haigh1510@users.noreply.github.com> Date: Fri, 4 Feb 2022 11:13:06 +0300 Subject: [PATCH 2/2] Fixed variable name --- backtrader_plotting/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backtrader_plotting/utils.py b/backtrader_plotting/utils.py index d719d04..7cc2591 100644 --- a/backtrader_plotting/utils.py +++ b/backtrader_plotting/utils.py @@ -24,7 +24,7 @@ def paramval2str(name, value): elif isinstance(value, float): return f"{value:.2f}" elif isinstance(value, (list,tuple)): - return ','.join(map(str, a)) + return ','.join(map(str, value)) elif isinstance(value, type): return value.__name__ else: