Commit 3fbc6ea2 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

add File class

parent 6c54c164
...@@ -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"
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
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