Skip to content

Commit

Permalink
style: fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed May 17, 2024
1 parent 0778875 commit a5ebaa1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions deepaas/cmd/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a5ebaa1

Please sign in to comment.