def _trial_label(proto_run, trial_flag_vals): user_flag_vals = { name: val for name, val in trial_flag_vals.items() if val is not None } label_template = (proto_run.get("op") or {}).get("label_template") return op_util.run_label(label_template, user_flag_vals, trial_flag_vals)
def _trial_label(proto_run, trial_flag_vals): label_template = (proto_run.get("op") or {}).get("label_template") return op_util.run_label(label_template, trial_flag_vals)
def _run_label(flag_vals, opts): return op_util.run_label(_label_template(opts), flag_vals)
def format_run_label(template, run): fmt_params = run.get("flags") or {} fmt_params["label"] = _run_label(run) return op_util.run_label(template, fmt_params).strip()
def _run_label(label_template, flags): if not label_template: return "" return op_util.run_label(label_template, flags)
def _op_init_label(op): op._label = op_util.run_label(op._label_template, op._user_flag_vals, op._op_flag_vals)