If not given in notebook.py get default concurrency parameter from jupyter notebook
Concurrency parameter is expected to be given from the command line. If it is not given, it is taken from notebook.py. If concurrency parameter there is None, it will be taken from jupyter notebook.
Merge request reports
Activity
421 421 defcval = concurrency.get("default concurrency", None) 422 if not isinstance(defcval, (list, tuple)): 423 cvals = range(defcval) 422 if defcval is not None: 423 print("Concurrency parameter '{}' is taken from notebooks.py".format(cvar)) 424 if not isinstance(defcval, (list, tuple)): 425 cvals = range(defcval) 426 else: 427 cvals = defcval 424 428 else: 425 cvals = defcval 426 429 for p in parms: 430 if p.name == cvar: 431 cvals = p.value 432 print("Concurrency parameter '{}' is taken from '{}'".format(cvar, notebook)) Indeed. If the value is a scalar, it have to be concerted to list. I would imagine something like:
cvals = [defcval]
In case of range function:cvals = range(defcval)
if defcval is e.g. 1000 cvals would be a list of 1000 elements and 1000 jobs will be submitter. I guess it not what should be. Is there a reason, why range function is used for default parameter fromnotebooks.py
?I don’t think we should be overly smart here in guessing the defaults. The rabge(16) expressions come from the number of modules on those detectors. I would not conclude however that for a scalar given in a notebook we should also default to range(that scalar). Rather, simply wrap the scalar in a list and add a note to the documentation, that this is the default behavior, if no defaults are specified in notebook.py
changed this line in version 2 of the diff
mentioned in commit a2423bb8