From b7fb71861e2435f35f450506a22a44443094b92e Mon Sep 17 00:00:00 2001 From: Kenny Workman Date: Sat, 11 Nov 2023 15:53:44 -1000 Subject: [PATCH] best effort display name from snakecase --- latch_cli/snakemake/config/parser.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/latch_cli/snakemake/config/parser.py b/latch_cli/snakemake/config/parser.py index fa364839..3e82537a 100644 --- a/latch_cli/snakemake/config/parser.py +++ b/latch_cli/snakemake/config/parser.py @@ -81,10 +81,16 @@ def generate_metadata( is_file = typ in {LatchFile, LatchDir} param_typ = "SnakemakeFileParameter" if is_file else "SnakemakeParameter" + + def _best_effort_display_name(param_name: str): + if param_name[0] == "_": + param_name = param_name[1:] + return " ".join(map(lambda x: x.capitalize(), param_name.split("_"))) + param_str = reindent( f"""\ {repr(identifier_from_str(k))}: {param_typ}( - display_name={repr(k)}, + display_name={repr(_best_effort_display_name(k))}, type={type_repr(typ)}, __config____default__),""", 0,