Commit 8ef667d1 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

refactor CsstResult

parent 29c0f9f6
Pipeline #1223 passed with stage
......@@ -10,6 +10,7 @@ Modified-History:
2022-10-07, Bo Zhang, added Numpydoc docstring
"""
from enum import IntEnum
from typing import Optional
class CsstStatus(IntEnum):
......@@ -26,6 +27,7 @@ class CsstStatus(IntEnum):
>>> return CsstStatus.PERFECT
>>> return CsstStatus.ERROR
"""
PERFECT = 0
WARNING = 1
ERROR = 2
......@@ -38,17 +40,23 @@ class CsstResult:
--------
>>> CsstResult(CsstStatus.PERFECT, ["file1.fits", "file2.fits"])
"""
def __init__(self, status: CsstStatus = CsstStatus.ERROR, file_list=[], **additional_output):
def __init__(
self,
status: CsstStatus = CsstStatus.ERROR,
file_list: Optional = None,
**output,
):
if file_list is None:
file_list = []
assert isinstance(status, CsstStatus)
assert type(file_list) is list
self.status = status
self.file_list = file_list
self.additional_output = additional_output
self.output = output
def __repr__(self):
return f""" <CsstResult status={self.status}>
- file_list: {self.file_list}
- addtional_output: {self.additional_output} \n
- output: {self.output} \n
"""
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