From f7e79bc6e05cc9d74f029c0348d951838890c950 Mon Sep 17 00:00:00 2001 From: BO ZHANG Date: Fri, 15 Dec 2023 22:03:26 +0800 Subject: [PATCH] add module headers --- csst_common/__init__.py | 6 +++--- csst_common/ccds/__init__.py | 10 ++++++++++ csst_common/ccds/ccds.py | 10 ++++++++++ csst_common/ccds/slsconf.py | 11 ++++++++++- csst_common/decorator.py | 12 +++++++++++- csst_common/file.py | 12 ++++++++++++ csst_common/time.py | 18 ++++++++++++++---- csst_common/utils/tempfile.py | 1 + tests/test_status.py | 10 ++++++++++ 9 files changed, 81 insertions(+), 9 deletions(-) diff --git a/csst_common/__init__.py b/csst_common/__init__.py index c047f6a..6d51875 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 ad39fbc..748749b 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 5cad353..bbee377 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 381a0ea..0ef2de2 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 39b7b08..f62dd32 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 df0414b..cd639d6 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 7c14655..4585138 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 cfcb493..f49b88d 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 6966f60..b7efd61 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 -- GitLab