From a5ee2b51ee07ac67bd907fce15465cb4caf02f2b Mon Sep 17 00:00:00 2001 From: BO ZHANG Date: Fri, 15 Dec 2023 22:15:25 +0800 Subject: [PATCH] update module headers --- csst_common/__init__.py | 11 ++++++----- csst_common/data_manager.py | 3 +-- csst_common/decorator.py | 4 ++-- csst_common/dfs.py | 2 +- csst_common/file.py | 6 +++--- csst_common/io.py | 10 ++++++++++ csst_common/logger.py | 3 ++- csst_common/params.py | 2 +- csst_common/pipeline.py | 15 ++++++++++++++- csst_common/status.py | 2 +- csst_common/utils/__init__.py | 11 +++++++++++ csst_common/utils/_module_docstr.py | 9 +++++---- csst_common/utils/tempfile.py | 10 ++++++++++ 13 files changed, 67 insertions(+), 21 deletions(-) diff --git a/csst_common/__init__.py b/csst_common/__init__.py index 6d51875..bd486b3 100644 --- a/csst_common/__init__.py +++ b/csst_common/__init__.py @@ -3,17 +3,18 @@ Identifier: csst_common/__init__.py Name: __init__.py Description: csst_common package Author: Bo Zhang -Created: 2022-09-13 +Created: 2022-09-21 Modified-History: - 2023-12-15, Bo Zhang, created + 2022-09-21, Bo Zhang, created + 2023-09-22, Bo Zhang, updates 2023-12-15, Bo Zhang, add module header """ -from .status import CsstResult, CsstStatus -from .pipeline import Pipeline from .ccds import CCDS -from .dfs import DFS from .decorator import parameterized_module_decorator +from .dfs import DFS from .file import File +from .pipeline import Pipeline +from .status import CsstResult, CsstStatus __version__ = "0.0.2" diff --git a/csst_common/data_manager.py b/csst_common/data_manager.py index 6cc9b47..efff6b4 100644 --- a/csst_common/data_manager.py +++ b/csst_common/data_manager.py @@ -30,11 +30,10 @@ from csst_dfs_api.facility.level1prc import Level1PrcApi from csst_dfs_api.mbi.level2 import Level2DataApi as MbiLevel2DataApi from csst_dfs_api.sls.level2spectra import Level2SpectraApi as SlsLevel2DataApi +from .dfs import DFS from .logger import get_logger from .params import CSST_PARAMS as CP from .time import now -from .ccds import CCDS -from .dfs import DFS class CsstMsDataManager: diff --git a/csst_common/decorator.py b/csst_common/decorator.py index f62dd32..ec413fd 100644 --- a/csst_common/decorator.py +++ b/csst_common/decorator.py @@ -3,9 +3,9 @@ Identifier: csst_common/decorator.py Name: decorator.py Description: module wrapper Author: Bo Zhang -Created: 2022-09-13 +Created: 2023-12-10 Modified-History: - 2023-12-15, Bo Zhang, created + 2023-12-10, Bo Zhang, rewrite ModuleResult and decorator 2023-12-15, Bo Zhang, add module header """ import functools diff --git a/csst_common/dfs.py b/csst_common/dfs.py index 0ea1fd6..6e4e03a 100644 --- a/csst_common/dfs.py +++ b/csst_common/dfs.py @@ -1,7 +1,7 @@ """ Identifier: csst_common/dfs.py Name: dfs.py -Description: csst_common package +Description: DFS wrapper Author: Bo Zhang Created: 2023-07-08 Modified-History: diff --git a/csst_common/file.py b/csst_common/file.py index cd639d6..25136ba 100644 --- a/csst_common/file.py +++ b/csst_common/file.py @@ -1,7 +1,7 @@ """ -Identifier: csst_common/__init__.py -Name: __init__.py -Description: csst_common package +Identifier: csst_common/file.py +Name: file.py +Description: file operation Author: Bo Zhang Created: 2023-12-13 Modified-History: diff --git a/csst_common/io.py b/csst_common/io.py index 230a9f4..e97da4f 100644 --- a/csst_common/io.py +++ b/csst_common/io.py @@ -1,3 +1,13 @@ +""" +Identifier: csst_common/io.py +Name: io.py +Description: IO module +Author: Bo Zhang +Created: 2023-12-13 +Modified-History: + 2023-12-10, Bo Zhang, created + 2023-12-15, Bo Zhang, add verify_checksum and append_header, add module header +""" import warnings from copy import deepcopy diff --git a/csst_common/logger.py b/csst_common/logger.py index a78ac22..40faa59 100644 --- a/csst_common/logger.py +++ b/csst_common/logger.py @@ -1,5 +1,5 @@ """ -Identifier: KSC-SJ4-csst_common/logger.py +Identifier: csst_common/logger.py Name: logger.py Description: CSST logger Author: Bo Zhang @@ -8,6 +8,7 @@ Modified-History: 2022-10-04, Bo Zhang, created 2022-10-04, Bo Zhang, added get_logger 2022-10-07, Bo Zhang, added Numpydoc docstring + 2023-12-10, Bo Zhang, add type annotation """ import logging from typing import Optional diff --git a/csst_common/params.py b/csst_common/params.py index d67d59f..675bec8 100644 --- a/csst_common/params.py +++ b/csst_common/params.py @@ -1,5 +1,5 @@ """ -Identifier: KSC-SJ4-csst_common/params.py +Identifier: csst_common/params.py Name: params.py Description: CSST parameters Author: Bo Zhang diff --git a/csst_common/pipeline.py b/csst_common/pipeline.py index 16d2fe5..94a3e05 100644 --- a/csst_common/pipeline.py +++ b/csst_common/pipeline.py @@ -1,3 +1,15 @@ +""" +Identifier: csst_common/pipeline.py +Name: file.py +Description: pipeline operation +Author: Bo Zhang +Created: 2023-12-13 +Modified-History: + 2023-07-11, Bo Zhang, created + 2023-07-11, Bo Zhang, add Pipeline class + 2023-12-10, Bo Zhang, update Pipeline + 2023-12-15, Bo Zhang, add module header +""" import json import os import subprocess @@ -5,9 +17,10 @@ import warnings from typing import Any from astropy import time -from .file import File + from .ccds import CCDS from .dfs import DFS +from .file import File from .logger import get_logger diff --git a/csst_common/status.py b/csst_common/status.py index 170807c..0b0980c 100644 --- a/csst_common/status.py +++ b/csst_common/status.py @@ -1,5 +1,5 @@ """ -Identifier: KSC-SJ4-csst_common/status.py +Identifier: csst_common/status.py Name: status.py Description: CSST status Author: Bo Zhang diff --git a/csst_common/utils/__init__.py b/csst_common/utils/__init__.py index 1f3135f..219871d 100644 --- a/csst_common/utils/__init__.py +++ b/csst_common/utils/__init__.py @@ -1,2 +1,13 @@ +""" +Identifier: csst_common/utils/__init__.py +Name: __init__.py +Description: CSST utils +Author: Bo Zhang +Created: 2022-09-19 +Modified-History: + 2022-09-19, Bo Zhang, created + 2023-12-15, Bo Zhang, add module header +""" + from ._module_docstr import ModuleHeader from .tempfile import randfile diff --git a/csst_common/utils/_module_docstr.py b/csst_common/utils/_module_docstr.py index e7c9300..d4f120b 100644 --- a/csst_common/utils/_module_docstr.py +++ b/csst_common/utils/_module_docstr.py @@ -1,12 +1,13 @@ """ -Identifier: KSC-SJ4-csst_common/utils.py -Name: utils.py -Description: This module collects a set of utilities for CSST L1 pipeline. +Identifier: csst_common/utils/_module_docstr.py +Name: _module_docstr.py +Description: module docstring Author: Bo Zhang Created: 2022-09-06 Modified-History: 2022-09-06, Bo Zhang, Added header_str - 2022-09-13, Bo Zhang, Added ModuleHeader class + 2022-09-19, Bo Zhang, Added ModuleHeader class + 2023-12-15, Bo Zhang, reformat module headers """ import datetime import glob diff --git a/csst_common/utils/tempfile.py b/csst_common/utils/tempfile.py index f49b88d..0b2b505 100644 --- a/csst_common/utils/tempfile.py +++ b/csst_common/utils/tempfile.py @@ -1,3 +1,13 @@ +""" +Identifier: csst_common/utils/__init__.py +Name: __init__.py +Description: CSST utils +Author: Bo Zhang +Created: 2022-09-19 +Modified-History: + 2022-09-19, Bo Zhang, created + 2023-12-15, Bo Zhang, add module header +""" import secrets import string -- GitLab