Skip to content
Snippets Groups Projects
Commit 7cfe3c34 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Improve warnings/errors around concurrency parameter

parent d784e473
No related branches found
No related tags found
1 merge request!575Refactor parsing arguments and loading main notebook
......@@ -609,7 +609,9 @@ def run(argv=None):
run_uuid = f"t{datetime.now().strftime('%y%m%d_%H%M%S')}"
# check if concurrency parameter is given and we run concurrently
if not any(p.name == "parameter" for p in nb_details.default_params) and concurrency_par is not None:
if concurrency_par is not None and not any(
p.name == concurrency_par for p in nb_details.default_params
):
msg = f"Notebook cannot be run concurrently: no {concurrency_par} parameter"
warnings.warn(msg, RuntimeWarning)
......@@ -764,6 +766,11 @@ def run(argv=None):
cvals = f(*callargs)
print(f"Split concurrency into {cvals}")
if cvals is None:
raise ValueError(
f"No values found for {concurrency_par} (concurrency parameter)"
)
# get expected type
cvtype = get_par_attr(parms, concurrency_par, 'type', list)
cvals = remove_duplications(cvals)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment