Commit 40d93d8b authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

update

parent f51a7714
"""
Identifier: ifs_sim/tests/test_ifs_sim.py
Name: test_ifs_sim.py
Description: Test ifs sim.
Author: Zhaojun Yan
Created: 2024-04-09
Modified-History:
2024-04-09, Zhaojun Yan, created
"""
import unittest
import os
from csst_ifs_sim import csst_ifs_sim
import subprocess
import sys
class TestDemoFunction(unittest.TestCase):
def test_ifs_sim_1(self):
"""
Aim
---
Test ifs sim function: SCI case.
Criteria
--------
Pass if the demo function returns `1`.
Details
-------
The demo function returns the length of the input argument list.
This case aims to test whether the demo function returns `1` if input is `None`.
"""
# demo function test
dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/')
print(dir_path)
print(sys.version )
###configfile = dir_path+'IFS_inputdata/configData/IFS_sim_C90.config'
configfile = './ifs_data/IFS_sim_C90.config'
sourcein = 'SCI'
print(configfile)
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, 'no')
self.assertEqual(
1 , 1,
"case 1: SCI sim passes.",
)
# def test_ifs_sim_2(self):
# """
# Aim
# ---
# Test ifs sim function: BIAS case.
# Criteria
# --------
# Pass if the demo function returns `1`.
# Details
# -------
# The demo function returns the length of the input argument list.
# This case aims to test whether the demo function returns `1` if input is `None`.
# """
# # demo function test
# dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
# csst_ifs_sim(dir_path,BIAS)
# self.assertTrue(
# 1 == 1,
# "case 2 :BIAS sim passes.",
# )
# def test_ifs_sim_3(self):
# """
# Aim
# ---
# Test ifs sim function: DARK case.
# Criteria
# --------
# Pass if the demo function returns `1`.
# Details
# -------
# The demo function returns the length of the input argument list.
# This case aims to test whether the demo function returns `1` if input is `None`.
# """
# # demo function test
# dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
# csst_ifs_sim(dir_path,'DARK')
# self.assertTrue(
# 1 == 1,
# "case 3 :DARK sim passes.",
# )
# def test_ifs_sim_4(self):
# """
# Aim
# ---
# Test ifs sim function: LAMP case.
# Criteria
# --------
# Pass if the demo function returns `1`.
# Details
# -------
# The demo function returns the length of the input argument list.
# This case aims to test whether the demo function returns `1` if input is `None`.
# """
# # demo function test
# dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
# csst_ifs_sim(dir_path,'LAMP')
# self.assertTrue(
# 1 == 1,
# "case 4 :LAMP sim passes.",
# )
# def test_ifs_sim_5(self):
# """
# Aim
# ---
# Test ifs sim function: FLAT case.
# Criteria
# --------
# Pass if the demo function returns `1`.
# Details
# -------
# The demo function returns the length of the input argument list.
# This case aims to test whether the demo function returns `1` if input is `None`.
# """
# # demo function test
# dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
# csst_ifs_sim(dir_path,'FLAT')
# self.assertTrue(
# 1 == 1,
# "case 5 :FLAT sim passes.",
# )
# def test_ifs_sim_6(self):
# """
# Aim
# ---
# Test ifs sim function: hole case.
# Criteria
# --------
# Pass if the demo function returns `1`.
# Details
# -------
# The demo function returns the length of the input argument list.
# This case aims to test whether the demo function returns `1` if input is `None`.
# """
# # demo function test
# dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
# csst_ifs_sim(dir_path,'LAMP', 'yes')
# self.assertTrue(
# 1 == 1,
# "case 6 :Hole sim passes.",
# )
\ No newline at end of file
numpy~=1.23.3
scipy~=1.9.2
setuptools~=65.5.1
pandas~=1.2.3
julian~=0.14
astropy~=5.1
tqdm~=4.59.0
galsim~=2.4.5
import setuptools import setuptools
with open("README.md", "r") as fh: # 读取README.md作为长描述
long_description = fh.read() with open("README.md", "r") as f:
long_description = f.read()
setuptools.setup(
name='csst_mci_sim', # 读取依赖列表requirements.txt
version='1.0.1', # 忽略#开头或者版本号不明确指定的条目
author='CSST Team', with open("requirements.txt", "r") as f:
author_email='zhaojunyan@shao.ac.cn', requirements = [
description='The CSST - mci - sim', # short description req.strip()
long_description=long_description, for req in f.readlines()
long_description_content_type="text/markdown", if not req.startswith("#") and req.__contains__("~=")
url='https://csst-tb.bao.ac.cn/', ]
# project_urls={
# 'Source': 'https://csst-tb.bao.ac.cn/code/csst-l1/ifs/csst_mci_sim', setuptools.setup(
# }, name='csst_mci_sim',
packages=setuptools.find_packages(), # Internal_Version = '0.7.02',
license='MIT', version='1.0.0',
classifiers=["Development Status :: 5 - Production/Stable", author='CSST Team',
"Intended Audience :: Science/Research", author_email='zhaojunyan@shao.ac.cn',
"License :: OSI Approved :: MIT License", description='The CSST - mci - sim', # short description
"Operating System :: OS Independent", long_description=long_description,
"Programming Language :: Python :: 3.8", long_description_content_type="text/markdown",
"Topic :: Scientific/Engineering :: Physics", url='https://csst-tb.bao.ac.cn/',
"Topic :: Scientific/Engineering :: Astronomy"], # project_urls={
package_dir={'csst_mci_sim': 'csst_mci_sim'}, # 'Source': 'https://csst-tb.bao.ac.cn/code/csst-l1/ifs/csst_ifs_sim',
# include_package_data=True, # },
package_data={"": ["LICENSE", "README.md"], packages=setuptools.find_packages(),
"csst_mci_sim": ["mci_so/*", "mci_data/*"]}, license='MIT',
# install_requires=['sphinx', classifiers=["Development Status :: 5 - Production/Stable",
# 'numpy', "Intended Audience :: Science/Research",
# 'scipy', 'matplotlib', "License :: OSI Approved :: MIT License",
# 'astropy', 'healpy', 'ccdproc', 'deepCR', 'photutils'], "Operating System :: OS Independent",
python_requires='>=3.8', "Programming Language :: Python :: 3.8",
) "Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Astronomy"],
package_dir={'csst_ifs_sim': 'csst_ifs_sim'},
# include_package_data=True,
package_data={"": ["LICENSE", "README.md"],
"csst_mci_sim": ["mci_so/*", "mci_data/*","CTI/*", "support/*","mci_data/refs/*", "mci_data/refs/orbit20160925/*"]},
# install_requires=['sphinx',
# 'numpy',
# 'scipy', 'matplotlib',
# 'astropy', 'healpy', 'ccdproc', 'deepCR', 'photutils'],
python_requires='>=3.11',
install_requires=requirements,
)
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