Commit 6ccec825 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

tweaks

parent 7aacc78b
Pipeline #2880 passed with stage
in 0 seconds
...@@ -150,11 +150,11 @@ class Pipeline: ...@@ -150,11 +150,11 @@ class Pipeline:
h.set("CREATED", self.pipeline_id, comment="pipeline build time") h.set("CREATED", self.pipeline_id, comment="pipeline build time")
return reformat_header(h, strip=False, comment="Pipeline summary") return reformat_header(h, strip=False, comment="Pipeline summary")
def summary(self): def summarize(self):
"""Summarize this run.""" """Summarize this run."""
t_stop: Time = Time.now() t_stop: Time = Time.now()
t_cost: float = (t_stop - self.t_start).value * 86400.0 t_cost: float = (t_stop - self.t_start).value * 86400.0
self.pipeline_logger.info(f"Total cost: {t_cost} sec") self.pipeline_logger.info(f"Total cost: {t_cost:.1f} sec")
def clean_output(self): def clean_output(self):
"""Clean output directory.""" """Clean output directory."""
...@@ -294,10 +294,10 @@ class Message: ...@@ -294,10 +294,10 @@ class Message:
for d in dlist: for d in dlist:
f.write(self.dict2msg(d) + "\n") f.write(self.dict2msg(d) + "\n")
def preview(self, dlist: list[dict]) -> str: def preview(self, dlist: list[dict], n: int = 10) -> None:
"""Preview messages.""" """Preview top `n` messages."""
s = "" s = ""
for d in dlist: for d in dlist[:n]:
s += self.dict2msg(d) + "\n" s += self.dict2msg(d) + "\n"
print(s) print(s)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment