From 13e61053e76bf3fc93f645b5bcd9a5ec765512a8 Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Fri, 17 May 2024 11:53:15 +0200 Subject: [PATCH] style: fix flake8 --- deepaas/cmd/cli.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/deepaas/cmd/cli.py b/deepaas/cmd/cli.py index 20b3b7ef..82fbb68c 100644 --- a/deepaas/cmd/cli.py +++ b/deepaas/cmd/cli.py @@ -51,10 +51,11 @@ # ref: https://stackoverflow.com/questions/7625786/type-dict-in-argparse-add-argument # We follow a similar approach with bools # ref: https://stackoverflow.com/a/59579733/18471590 -# ref: https://stackoverflow.com/questions/715417/converting-from-a-string-to-boolean-in-python/18472142#18472142 +# ref: https://stackoverflow.com/questions/715417/converting-from-a-string-to-boolean-in-python/18472142#18472142 # noqa + def str2bool(v): - return v.lower() in ("yes", "true", "t", "1") + return v.lower() in ("yes", "true", "t", "1") FIELD_TYPE_CONVERTERS = { @@ -138,7 +139,7 @@ def _fields_to_dict(fields_in): if "enum" in val.metadata.keys(): val_help += f"\nChoices: {val.metadata['enum']}" - val_help = val_help.lstrip('\n') # remove escape when no description found + val_help = val_help.lstrip('\n') # remove escape when no description found param["help"] = val_help dict_out[key] = param @@ -210,6 +211,7 @@ def _get_file_args(fields_in): file_args['predict'] = _get_file_args(model_obj.get_predict_args()) file_args['train'] = _get_file_args(model_obj.get_train_args()) + # Function to add later these arguments to CONF via SubCommandOpt def _add_methods(subparsers): """Function to add argparse subparsers via SubCommandOpt (see below)