From e591027c70520c89a9d8e06a2d8dcedec73bcac4 Mon Sep 17 00:00:00 2001 From: Michael <m.langguth@fz-juelich.de> Date: Mon, 25 Jul 2022 14:09:39 +0200 Subject: [PATCH] Some minor changes to the doc-strings of config_utils.py and generate_runscript.py. --- video_prediction_tools/env_setup/generate_runscript.py | 2 +- .../utils/runscript_generator/config_utils.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/video_prediction_tools/env_setup/generate_runscript.py b/video_prediction_tools/env_setup/generate_runscript.py index a342ccbb..3b541fcc 100755 --- a/video_prediction_tools/env_setup/generate_runscript.py +++ b/video_prediction_tools/env_setup/generate_runscript.py @@ -80,7 +80,7 @@ def main(): # get workflow step by keyboard interaction target_runscript_req = "Please enter the name of the workflow step for which a runscript should be created:" - target_runscript_err = ValueError("Workflow step is unknown. Please select one of the known listed above") + target_runscript_err = ValueError("Please select one of the known listed above.") def check_target_runscript(runscript_name, silent=False): if not runscript_name in known_wrkflw_steps: diff --git a/video_prediction_tools/utils/runscript_generator/config_utils.py b/video_prediction_tools/utils/runscript_generator/config_utils.py index 0624ceed..27e8f155 100755 --- a/video_prediction_tools/utils/runscript_generator/config_utils.py +++ b/video_prediction_tools/utils/runscript_generator/config_utils.py @@ -267,6 +267,7 @@ class Config_runscript_base: :param console_str: Request printed to the console :param check_input: function returning boolean which needs to be passed by input from keyboard interaction. Must have two arguments with the latter being an optional bool called silent. + :param err: Error to be raised in case of failure :param ntries: maximum number of tries (default: 1) :param test_arg: test argument to check_input-function (default: "xxx") :param prefix2arg: optional prefix that might be added to string from keyboard-interaction before it enters @@ -289,9 +290,9 @@ class Config_runscript_base: pass except: raise Exception("%{0}: Cannot approve check_input-argument to be proper.".format(method_name)) - if not isinstance(err,BaseException): - raise ValueError("%{0}: err_str-argument must be an instance of BaseException!".format(method_name)) - if not isinstance(ntries,int) and ntries <= 1: + if not isinstance(err, BaseException): + raise ValueError("%{0}: err-argument must be an instance of BaseException!".format(method_name)) + if not isinstance(ntries, int) and ntries <= 1: raise ValueError("%{0}: ntries-argument must be an integer greater equal 1!".format(method_name)) attempt = 0 -- GitLab