From d329275d3ffd279e366789268ff5e8d666d7a84a Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Fri, 4 Nov 2022 12:46:02 -0600 Subject: [PATCH] handle if input to format_thresh is already a list --- metplus/util/string_manip.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metplus/util/string_manip.py b/metplus/util/string_manip.py index 5ddb62e867..c297dde55e 100644 --- a/metplus/util/string_manip.py +++ b/metplus/util/string_manip.py @@ -239,6 +239,9 @@ def format_thresh(thresh_str): @returns string of comma-separated list of the threshold(s) with letter format, i.e. gt3,le5.5,eq7 """ + if isinstance(thresh_str, list): + return format_thresh(','.join(thresh_str)) + formatted_thresh_list = [] # separate thresholds by comma and strip off whitespace around values thresh_list = [thresh.strip() for thresh in thresh_str.split(',')]