Commit c70ee73d authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

updated params module

parent 4a53823c
import os
__version__ = "0.0.1"
PACKAGE_PATH = os.path.dirname(__file__)
......@@ -3,9 +3,10 @@ class BasicParams:
""" the basic parameter class """
def __repr__(self):
_class_name = self.__class__.__name__
_str = "<{}>\n{}\n".format(_class_name, "-" * (len(_class_name) + 2))
_str = "<{} length={}>".format(_class_name, len(self.__dict__))
_str += "\n{}\n".format("-" * len(_str))
for k, v in self.__dict__.items():
_str += "{}:{} \n".format(k, v)
_str += "{} : {} \n".format(k, v)
return _str
# def to_dict(self):
......@@ -20,13 +21,26 @@ class BasicParams:
class CsstParams(BasicParams):
""" CSST parameters -- a collection of """
def __init__(self):
"""
This class defines the CSST parameters.
Example
-------
>>> from csst_common.params import CsstParams
>>> cps = CsstParams()
See also
--------
CsstMbiParams, CsstSlsParams, CsstSimParams
"""
self.mbi = CsstMbiParams()
self.sls = CsstSlsParams()
self.sim = CsstSimParams()
def __repr__(self):
_class_name = self.__class__.__name__
_str = "<{}>\n{}\n".format(_class_name, "-"*(len(_class_name)+2))
_str = "<{} length={}>".format(_class_name, len(self.__dict__))
_str += "\n{}\n".format("-" * len(_str))
for k, v in self.__dict__.items():
_str += "{}: \n".format(k)
for kk in self.__getattribute__(k).__dict__.keys():
......@@ -79,6 +93,8 @@ class CsstSimParams(BasicParams):
self.VER_SIMS = ["C3", "C5.1", "C5.2"]
cp = CsstParams()
if __name__ == "__main__":
cp = CsstParams()
print(cp)
......
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