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
f5d67757
Commit
f5d67757
authored
Dec 28, 2023
by
BO ZHANG
🏀
Browse files
refactor Pipeline.info
parent
00950c15
Pipeline
#2792
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_common/pipeline.py
View file @
f5d67757
...
...
@@ -33,14 +33,16 @@ class Pipeline:
"""
CSST pipeline configuration class.
It s
hould be
used for e
very
pipeline to initialize environment.
It
i
s used for e
ach
pipeline to initialize environment.
Parameters
----------
dir_input : str
Input
path
.
Input
directory
.
dir_output : str
Output path.
Output directory.
dir_temp : str
Temp directory.
dir_aux : str
Aux path.
dfs_root : str
...
...
@@ -129,14 +131,15 @@ class Pipeline:
if
filter_warnings
:
self
.
filter_warnings
()
def
in
spect
(
self
):
def
in
fo
(
self
):
"""List environment variables such as `PIPELINE_ID`, etc."""
print
(
f
"PIPELINE_ID=
{
self
.
pipeline_id
}
"
)
print
(
f
"BUILD=
{
self
.
build
}
"
)
print
(
f
"CREATED=
{
self
.
created
}
"
)
print
(
f
"VERBOSE=
{
self
.
verbose
}
"
)
def
summary
(
self
)
->
fits
.
Header
:
@
property
def
info_header
(
self
)
->
fits
.
Header
:
"""Summarize pipeline info into a `astropy.io.fits.Header`."""
h
=
fits
.
Header
()
h
.
set
(
"PIPELINE_ID"
,
self
.
pipeline_id
,
comment
=
"pipeline ID"
)
...
...
@@ -144,6 +147,10 @@ class Pipeline:
h
.
set
(
"CREATED"
,
self
.
pipeline_id
,
comment
=
"pipeline build time"
)
return
reformat_header
(
h
,
strip
=
False
,
comment
=
"Pipeline summary"
)
def
summarize
(
self
):
"""Summarize this run."""
pass
def
clean_output
(
self
):
"""Clean output directory."""
self
.
clean_directory
(
self
.
dir_output
)
...
...
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