Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-sims
csst_mci_sim
Commits
40d93d8b
Commit
40d93d8b
authored
Apr 12, 2024
by
Yan Zhaojun
Browse files
update
parent
f51a7714
Changes
4
Show whitespace changes
Inline
Side-by-side
csst_mci_sim/tests/.gitkeep
0 → 100644
View file @
40d93d8b
csst_mci_sim/tests/test_mci_sim.py
0 → 100644
View file @
40d93d8b
"""
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
requirements.txt
0 → 100644
View file @
40d93d8b
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
setup.py
View file @
40d93d8b
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
()
# 读取依赖列表requirements.txt
# 忽略#开头或者版本号不明确指定的条目
with
open
(
"requirements.txt"
,
"r"
)
as
f
:
requirements
=
[
req
.
strip
()
for
req
in
f
.
readlines
()
if
not
req
.
startswith
(
"#"
)
and
req
.
__contains__
(
"~="
)
]
setuptools
.
setup
(
setuptools
.
setup
(
name
=
'csst_mci_sim'
,
name
=
'csst_mci_sim'
,
version
=
'1.0.1'
,
# Internal_Version = '0.7.02',
version
=
'1.0.0'
,
author
=
'CSST Team'
,
author
=
'CSST Team'
,
author_email
=
'zhaojunyan@shao.ac.cn'
,
author_email
=
'zhaojunyan@shao.ac.cn'
,
description
=
'The CSST - mci - sim'
,
# short description
description
=
'The CSST - mci - sim'
,
# short description
...
@@ -13,7 +24,7 @@ setuptools.setup(
...
@@ -13,7 +24,7 @@ setuptools.setup(
long_description_content_type
=
"text/markdown"
,
long_description_content_type
=
"text/markdown"
,
url
=
'https://csst-tb.bao.ac.cn/'
,
url
=
'https://csst-tb.bao.ac.cn/'
,
# project_urls={
# project_urls={
# 'Source': 'https://csst-tb.bao.ac.cn/code/csst-l1/ifs/csst_
mci
_sim',
# 'Source': 'https://csst-tb.bao.ac.cn/code/csst-l1/ifs/csst_
ifs
_sim',
# },
# },
packages
=
setuptools
.
find_packages
(),
packages
=
setuptools
.
find_packages
(),
license
=
'MIT'
,
license
=
'MIT'
,
...
@@ -24,13 +35,14 @@ setuptools.setup(
...
@@ -24,13 +35,14 @@ setuptools.setup(
"Programming Language :: Python :: 3.8"
,
"Programming Language :: Python :: 3.8"
,
"Topic :: Scientific/Engineering :: Physics"
,
"Topic :: Scientific/Engineering :: Physics"
,
"Topic :: Scientific/Engineering :: Astronomy"
],
"Topic :: Scientific/Engineering :: Astronomy"
],
package_dir
=
{
'csst_
mci
_sim'
:
'csst_
mci
_sim'
},
package_dir
=
{
'csst_
ifs
_sim'
:
'csst_
ifs
_sim'
},
# include_package_data=True,
# include_package_data=True,
package_data
=
{
""
:
[
"LICENSE"
,
"README.md"
],
package_data
=
{
""
:
[
"LICENSE"
,
"README.md"
],
"csst_mci_sim"
:
[
"mci_so/*"
,
"mci_data/*"
]},
"csst_mci_sim"
:
[
"mci_so/*"
,
"mci_data/*"
,
"CTI/*"
,
"support/*"
,
"mci_data/refs/*"
,
"mci_data/refs/orbit20160925/*"
]},
# install_requires=['sphinx',
# install_requires=['sphinx',
# 'numpy',
# 'numpy',
# 'scipy', 'matplotlib',
# 'scipy', 'matplotlib',
# 'astropy', 'healpy', 'ccdproc', 'deepCR', 'photutils'],
# 'astropy', 'healpy', 'ccdproc', 'deepCR', 'photutils'],
python_requires
=
'>=3.8'
,
python_requires
=
'>=3.11'
,
install_requires
=
requirements
,
)
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment