Loading csst_common/data_manager.py +3 −3 Original line number Diff line number Diff line Loading @@ -880,7 +880,7 @@ class CsstMsDataManager: self.logger_ppl.info( f"Results from DFS CATAPI:\n" f" - code = {cat['code']}\n" f" - msg = {cat['msg']}\n" f" - message = {cat['message']}\n" f" - totalCount = {cat['totalCount']}\n" f" - columns = {cat['columns']}" ) Loading @@ -889,7 +889,7 @@ class CsstMsDataManager: self.logger_ppl.info( f"Results from DFS CATAPI:\n" f" - code = {cat['code']}\n" f" - msg = {cat['msg']}" f" - message = {cat['message']}" ) raise ValueError("Bad catalog query result!") Loading Loading @@ -921,7 +921,7 @@ class CsstMsDataManager: # query for L0 data print(f"Query obs_id={obs_id} ...", end="") recs = Level0DataApi().find(obs_id=obs_id) print("MessageWriter: \n", recs) print("Message: \n", recs) print(f"{recs['totalCount']} records obtained!") assert recs["code"] == 0 assert recs["totalCount"] > 0 Loading csst_common/logger.py +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ def get_logger(name: str = "CSST pipeline", filename: Optional[str] = None): # logging formatter formatter = logging.Formatter( "%(asctime)s - %(levelname)s - %(module)s.py:%(lineno)d - %(msg)s" "%(asctime)s - %(levelname)s - %(module)s.py:%(lineno)d - %(message)s" ) # stream handler Loading csst_common/pipeline.py +9 −9 Original line number Diff line number Diff line Loading @@ -98,8 +98,8 @@ class Pipeline: os.chdir(self.dir_output) # Frequently used files self.msg = MessageWriter(os.path.join(self.dir_output, "message.txt")) self.tsr = TimestampRecorder(os.path.join(self.dir_output, "timestamp.txt")) self.message = Message(os.path.join(self.dir_output, "message.txt")) self.timestamp = Timestamp(os.path.join(self.dir_output, "timestamp.txt")) # self.exit_code = ExitCode(os.path.join(self.dir_output, "exit_code")) # self.error_trace = ErrorTrace(os.path.join(self.dir_output, "error_trace")) Loading Loading @@ -168,10 +168,10 @@ class Pipeline: # f.write(s) class MessageWriter: class Message: """Write JSON format messages to file.""" def __init__(self, file_path=""): def __init__(self, file_path: str = ""): self.file_path = file_path def __repr__(self): Loading Loading @@ -211,12 +211,12 @@ class MessageWriter: # print(f"Exit with code {code} (written to '{self.file_path}')") class TimestampRecorder: def __init__(self, file_path: str = "tsr.txt"): class Timestamp: def __init__(self, file_path: str = "timestamp.txt"): """ TimestampRecorder Class. Timestamp Class. Initialize a TimestampRecorder object anc connect it to `file_path`. Initialize a Timestamp object anc connect it to `file_path`. Parameters ---------- Loading @@ -226,7 +226,7 @@ class TimestampRecorder: self.file_path = file_path def __repr__(self): return f"< TimestampRecorder [{self.file_path}] >" return f"< Timestamp [{self.file_path}] >" def empty(self): """Clean time stamp file.""" Loading Loading
csst_common/data_manager.py +3 −3 Original line number Diff line number Diff line Loading @@ -880,7 +880,7 @@ class CsstMsDataManager: self.logger_ppl.info( f"Results from DFS CATAPI:\n" f" - code = {cat['code']}\n" f" - msg = {cat['msg']}\n" f" - message = {cat['message']}\n" f" - totalCount = {cat['totalCount']}\n" f" - columns = {cat['columns']}" ) Loading @@ -889,7 +889,7 @@ class CsstMsDataManager: self.logger_ppl.info( f"Results from DFS CATAPI:\n" f" - code = {cat['code']}\n" f" - msg = {cat['msg']}" f" - message = {cat['message']}" ) raise ValueError("Bad catalog query result!") Loading Loading @@ -921,7 +921,7 @@ class CsstMsDataManager: # query for L0 data print(f"Query obs_id={obs_id} ...", end="") recs = Level0DataApi().find(obs_id=obs_id) print("MessageWriter: \n", recs) print("Message: \n", recs) print(f"{recs['totalCount']} records obtained!") assert recs["code"] == 0 assert recs["totalCount"] > 0 Loading
csst_common/logger.py +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ def get_logger(name: str = "CSST pipeline", filename: Optional[str] = None): # logging formatter formatter = logging.Formatter( "%(asctime)s - %(levelname)s - %(module)s.py:%(lineno)d - %(msg)s" "%(asctime)s - %(levelname)s - %(module)s.py:%(lineno)d - %(message)s" ) # stream handler Loading
csst_common/pipeline.py +9 −9 Original line number Diff line number Diff line Loading @@ -98,8 +98,8 @@ class Pipeline: os.chdir(self.dir_output) # Frequently used files self.msg = MessageWriter(os.path.join(self.dir_output, "message.txt")) self.tsr = TimestampRecorder(os.path.join(self.dir_output, "timestamp.txt")) self.message = Message(os.path.join(self.dir_output, "message.txt")) self.timestamp = Timestamp(os.path.join(self.dir_output, "timestamp.txt")) # self.exit_code = ExitCode(os.path.join(self.dir_output, "exit_code")) # self.error_trace = ErrorTrace(os.path.join(self.dir_output, "error_trace")) Loading Loading @@ -168,10 +168,10 @@ class Pipeline: # f.write(s) class MessageWriter: class Message: """Write JSON format messages to file.""" def __init__(self, file_path=""): def __init__(self, file_path: str = ""): self.file_path = file_path def __repr__(self): Loading Loading @@ -211,12 +211,12 @@ class MessageWriter: # print(f"Exit with code {code} (written to '{self.file_path}')") class TimestampRecorder: def __init__(self, file_path: str = "tsr.txt"): class Timestamp: def __init__(self, file_path: str = "timestamp.txt"): """ TimestampRecorder Class. Timestamp Class. Initialize a TimestampRecorder object anc connect it to `file_path`. Initialize a Timestamp object anc connect it to `file_path`. Parameters ---------- Loading @@ -226,7 +226,7 @@ class TimestampRecorder: self.file_path = file_path def __repr__(self): return f"< TimestampRecorder [{self.file_path}] >" return f"< Timestamp [{self.file_path}] >" def empty(self): """Clean time stamp file.""" Loading