Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_common
Commits
6ccec825
Commit
6ccec825
authored
Dec 30, 2023
by
BO ZHANG
🏀
Browse files
tweaks
parent
7aacc78b
Pipeline
#2880
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_common/pipeline.py
View file @
6ccec825
...
...
@@ -150,11 +150,11 @@ class Pipeline:
h
.
set
(
"CREATED"
,
self
.
pipeline_id
,
comment
=
"pipeline build time"
)
return
reformat_header
(
h
,
strip
=
False
,
comment
=
"Pipeline summary"
)
def
summar
y
(
self
):
def
summar
ize
(
self
):
"""Summarize this run."""
t_stop
:
Time
=
Time
.
now
()
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
:
.
1
f
}
sec"
)
def
clean_output
(
self
):
"""Clean output directory."""
...
...
@@ -294,10 +294,10 @@ class Message:
for
d
in
dlist
:
f
.
write
(
self
.
dict2msg
(
d
)
+
"
\n
"
)
def
preview
(
self
,
dlist
:
list
[
dict
])
->
str
:
"""Preview messages."""
def
preview
(
self
,
dlist
:
list
[
dict
]
,
n
:
int
=
10
)
->
None
:
"""Preview
top `n`
messages."""
s
=
""
for
d
in
dlist
:
for
d
in
dlist
[:
n
]
:
s
+=
self
.
dict2msg
(
d
)
+
"
\n
"
print
(
s
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment