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
3fbc6ea2
Commit
3fbc6ea2
authored
Dec 13, 2023
by
BO ZHANG
🏀
Browse files
add File class
parent
6c54c164
Changes
2
Hide whitespace changes
Inline
Side-by-side
csst_common/__init__.py
View file @
3fbc6ea2
...
@@ -14,5 +14,6 @@ from .pipeline import Pipeline
...
@@ -14,5 +14,6 @@ from .pipeline import Pipeline
from
.ccds
import
CCDS
from
.ccds
import
CCDS
from
.dfs
import
DFS
from
.dfs
import
DFS
from
.decorator
import
parameterized_module_decorator
from
.decorator
import
parameterized_module_decorator
from
.file
import
File
__version__
=
"0.0.2"
__version__
=
"0.0.2"
csst_common/file.py
0 → 100644
View file @
3fbc6ea2
import
os
class
File
:
def
__init__
(
self
,
file_path
:
str
=
"/path/to/file.fits"
):
self
.
file_path
=
file_path
self
.
file_path_prefix
,
self
.
file_path_ext
=
os
.
path
.
splitext
(
file_path
)
def
switch_extension
(
self
,
ext
=
"wht.fits"
)
->
str
:
if
ext
.
startswith
(
"."
):
return
self
.
file_path_prefix
+
ext
else
:
return
self
.
file_path_prefix
+
"_"
+
ext
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