diff --git a/csst_common/__init__.py b/csst_common/__init__.py index c047f6a23f17a03c96169e58acc2be3de46183a0..6d5187581b474ec5ec302959073223953f48d612 100644 --- a/csst_common/__init__.py +++ b/csst_common/__init__.py @@ -1,12 +1,12 @@ """ -Identifier: KSC-SJ4-csst_common/__init__.py +Identifier: csst_common/__init__.py Name: __init__.py Description: csst_common package Author: Bo Zhang Created: 2022-09-13 Modified-History: - 2022-09-13, Bo Zhang, created - 2022-09-13, Bo Zhang, fixed a bug + 2023-12-15, Bo Zhang, created + 2023-12-15, Bo Zhang, add module header """ from .status import CsstResult, CsstStatus diff --git a/csst_common/ccds/__init__.py b/csst_common/ccds/__init__.py index ad39fbc7ac53d87f31ec4d018ba786f76a096e6d..748749b6b11d6e14f7c364822efc95b0af5bd430 100644 --- a/csst_common/ccds/__init__.py +++ b/csst_common/ccds/__init__.py @@ -1 +1,11 @@ +""" +Identifier: csst_common/ccds/__init__.py +Name: __init__.py +Description: CCDS wrapper +Author: Bo Zhang +Created: 2022-09-13 +Modified-History: + 2023-12-15, Bo Zhang, created + 2023-12-15, Bo Zhang, add CCDS wrapper +""" from .ccds import CCDS diff --git a/csst_common/ccds/ccds.py b/csst_common/ccds/ccds.py index 5cad353b04c55b1561c5a60792d023d61892d3c9..bbee3770f9f60befccc7c24a92756c23bf559763 100644 --- a/csst_common/ccds/ccds.py +++ b/csst_common/ccds/ccds.py @@ -1,3 +1,13 @@ +""" +Identifier: csst_common/__init__.py +Name: __init__.py +Description: csst_common package +Author: Bo Zhang +Created: 2022-09-13 +Modified-History: + 2023-07-08, Bo Zhang, created + 2023-12-15, Bo Zhang, add module header +""" import functools import os diff --git a/csst_common/ccds/slsconf.py b/csst_common/ccds/slsconf.py index 381a0ea82951e385953048012a426898b49af8f9..0ef2de2fe7b7d31041b5bb0f127d5704dead9f58 100644 --- a/csst_common/ccds/slsconf.py +++ b/csst_common/ccds/slsconf.py @@ -1,9 +1,18 @@ +""" +Identifier: csst_common/ccds/slsconf.py +Name: slsconf.py +Description: csst_common package +Author: Bo Zhang +Created: 2022-09-13 +Modified-History: + 2023-12-15, Bo Zhang, created + 2023-12-15, Bo Zhang, add module header +""" import json import os import re import astropy.io.fits as pyfits - from ccds import client diff --git a/csst_common/decorator.py b/csst_common/decorator.py index 39b7b088be4e499cb7c2106fd3a987c95f615368..f62dd3261175a185556dbd1f979b8e2033a4e8f2 100644 --- a/csst_common/decorator.py +++ b/csst_common/decorator.py @@ -1,11 +1,21 @@ +""" +Identifier: csst_common/decorator.py +Name: decorator.py +Description: module wrapper +Author: Bo Zhang +Created: 2022-09-13 +Modified-History: + 2023-12-15, Bo Zhang, created + 2023-12-15, Bo Zhang, add module header +""" import functools import logging import time import traceback from typing import Callable, NamedTuple, Optional -from csst_common.status import CsstResult, CsstStatus from csst_common.logger import get_logger +from csst_common.status import CsstResult, CsstStatus __all__ = ["ModuleResult", "parameterized_module_decorator"] diff --git a/csst_common/file.py b/csst_common/file.py index df0414be41c2935a21049e18013965f175949c4b..cd639d695a139600d0d681ea7f5a26263927d250 100644 --- a/csst_common/file.py +++ b/csst_common/file.py @@ -1,3 +1,15 @@ +""" +Identifier: csst_common/__init__.py +Name: __init__.py +Description: csst_common package +Author: Bo Zhang +Created: 2023-12-13 +Modified-History: + 2023-12-13, Bo Zhang, created + 2023-12-13, Bo Zhang, add File + 2023-12-15, Bo Zhang, use re to match file name + 2023-12-15, Bo Zhang, add module header +""" import os import re from typing import Optional diff --git a/csst_common/time.py b/csst_common/time.py index 7c14655bc04d19d3ed0c183a16c1e574a8c02374..4585138d6fa0fa418f14ec3a2be8bdc43ef36457 100644 --- a/csst_common/time.py +++ b/csst_common/time.py @@ -1,11 +1,21 @@ +""" +Identifier: csst_common/time.py +Name: time.py +Description: time module +Author: Bo Zhang +Created: 2023-03-09 +Modified-History: + 2023-03-09, Bo Zhang, created + 2023-03-09, Bo Zhang, add two time formats +""" import datetime def now(): - """ Return ISOT8601 format datetime, for time stamps in data products. """ - return datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%f') + """Return ISOT8601 format datetime, for time stamps in data products.""" + return datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%f") def now_dfs(): - """ Return ISOT8601 format datetime, for DFS usage only. """ - return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') + """Return ISOT8601 format datetime, for DFS usage only.""" + return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") diff --git a/csst_common/utils/tempfile.py b/csst_common/utils/tempfile.py index cfcb4930bf41b190d4f266063c1579f9308cda3d..f49b88df306dbb7f8bbdc3be8b7a2e4e61a405f5 100644 --- a/csst_common/utils/tempfile.py +++ b/csst_common/utils/tempfile.py @@ -1,3 +1,4 @@ + import secrets import string diff --git a/tests/test_status.py b/tests/test_status.py index 6966f60e3d869bbe5bb190373b2c4e813bf5ae3d..b7efd612b9452875257aca11b9c8d7541e08b923 100644 --- a/tests/test_status.py +++ b/tests/test_status.py @@ -1,3 +1,13 @@ +""" +Identifier: tests/test_status.py +Name: test_status.py +Description: test CsstStatus +Author: Bo Zhang +Created: 2022-09-13 +Modified-History: + 2022-09-13, Bo Zhang, created + 2022-09-13, Bo Zhang, added CsstMbiDataManager +""" import unittest from csst_common.status import CsstStatus