def _run_data(self, run): opref = run.opref started = run.get("started") stopped = run.get("stopped") status = run.status return { "id": run.id, "run": run.short_id, "model": opref.model_name, "operation": run_util.format_operation(run), "from": run_util.format_pkg_name(run), "op": opref.op_name, "sourcecode": util.short_digest(run.get("sourcecode_digest")), "started": util.format_timestamp(started), "stopped": util.format_timestamp(stopped), "status": status, "time": self._duration(status, started, stopped), }
def _format_run_detail(run, index): lines = [ "Id: %s" % run.id, "Operation: %s" % run_util.format_operation(run), "From: %s" % run_util.format_pkg_name(run), "Status: %s" % run.status, "Started: %s" % util.format_timestamp(run.get("started")), "Stopped: %s" % util.format_timestamp(run.get("stopped")), "Label: %s" % (run.get("label") or ""), ] flags = run.get("flags") if flags: lines.append("Flags:") for name, val in sorted(flags.items()): val = val if val is not None else "" lines.append(" {}: {}".format(name, val)) scalars = list(index.run_scalars(run)) if scalars: lines.append("Scalars:") for s in scalars: lines.append(" %s" % run_util.run_scalar_key(s)) return "\n".join(lines)
def f(run): op = run_util.format_operation(run, nowarn=True) pkg = run_util.format_pkg_name(run) full_op = "%s/%s" % (pkg, op) return any((ref in full_op for ref in op_refs))