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
b7a1a9ce
Commit
b7a1a9ce
authored
Dec 15, 2023
by
BO ZHANG
🏀
Browse files
add docstrings
parent
4e92892c
Pipeline
#2425
failed with stage
in 0 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
csst_common/__init__.py
View file @
b7a1a9ce
...
...
@@ -10,11 +10,11 @@ Modified-History:
2023-12-15, Bo Zhang, add module header
"""
from
.ccds
import
CCDS
from
.decorator
import
parameterized_module_decorator
from
.dfs
import
DFS
from
.file
import
File
from
.pipeline
import
Pipeline
from
.status
import
CsstResult
,
CsstStatus
__version__
=
"0.0.2"
__all__
=
[
"Pipeline"
,
"File"
,
"CsstResult"
]
csst_common/file.py
View file @
b7a1a9ce
...
...
@@ -16,7 +16,22 @@ from typing import Optional
class
File
:
def
__init__
(
self
,
file_path
:
str
=
"/path/to/file.fits"
,
new_dir
=
None
):
"""
CSST MSC standard file path parser.
It can be used for parse CSST MSC file paths and generate corresponding output file paths.
Parameters
----------
file_path : str
File path.
new_dir : str
New directory.
"""
def
__init__
(
self
,
file_path
:
str
=
"/path/to/file.fits"
,
new_dir
:
Optional
[
str
]
=
None
):
self
.
file_path
=
file_path
# get dir name
self
.
dirname
=
os
.
path
.
dirname
(
self
.
file_path
)
...
...
csst_common/pipeline.py
View file @
b7a1a9ce
...
...
@@ -25,6 +25,35 @@ from .logger import get_logger
class
Pipeline
:
"""
CSST pipeline configuration class.
It should be used for every pipeline to initialize environment.
Parameters
----------
dir_input : str
Input path.
dir_output : str
Output path.
dir_aux : str
Aux path.
dfs_root : str
DFS root path.
ccds_root : str
CCDS root path.
ccds_cache : str
CCDS cache path.
filter_warnings : bool
If `True`, filter warnings.
dfs : bool
If `True`, initialize DFS.
ccds : bool
If `True`, initialize CCDS.
**kwargs : Any
Additional keyword arguments.
"""
def
__init__
(
self
,
dir_input
:
str
=
"/pipeline/input"
,
...
...
csst_common/status.py
View file @
b7a1a9ce
...
...
@@ -15,10 +15,10 @@ from typing import Optional, Any
class
CsstStatus
(
IntEnum
):
"""
The CSST
S
tatus class.
The CSST
standard s
tatus class.
This class provides a set of status which should be returned
from each CSST L1 functional module
.
This class provides a set of status which should be returned
from each CSST algorithm module.
0, 1, 2 stands for PERFECT, WARNING, ERROR, respectively
.
Examples
--------
...
...
@@ -36,6 +36,19 @@ class CsstStatus(IntEnum):
class
CsstResult
:
"""
CSST standard result class.
This is designed for all algorithm modules.
Parameters
----------
status : CsstStatus
The final status of the algorithm.
files : Optional[list[str]]
The files to which changes are made.
**output : Any
Additional results.
Examples
--------
>>> CsstResult(CsstStatus.PERFECT, ["file1.fits", "file2.fits"])
...
...
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