def run_name(run, label): parts = [run.short_id] if run.opref.model_name: parts.append("%s:%s" % (run.opref.model_name, run.opref.op_name)) else: parts.append(run.opref.op_name) parts.append(util.format_timestamp(run.get("started"))) if label: parts.append(label) return util.safe_filename(" ".join(parts))[:MAX_RUN_NAME_LEN]
def _format_run_name(run): parts = [run.short_id] if run.opref.model_name: parts.append("%s:%s" % (run.opref.model_name, run.opref.op_name)) else: parts.append(run.opref.op_name) parts.append(util.format_timestamp(run.get("started"))) label = run.get("label") if label: parts.append(label) return util.safe_filename(" ".join(parts))
def _ensure_run(self, name): safe_name = util.safe_filename(name) path = os.path.join(self.logdir, safe_name) _ensure_dir(path) return path