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_ifs_sim
Commits
355e76b6
Commit
355e76b6
authored
May 16, 2024
by
Yan Zhaojun
Browse files
test
parent
37df3ac8
Pipeline
#4624
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
csst_ifs_sim/csst_ifs_sim.py
View file @
355e76b6
...
@@ -1934,7 +1934,7 @@ class IFSsimulator():
...
@@ -1934,7 +1934,7 @@ class IFSsimulator():
###############################################################################
###############################################################################
###############################################################################
###############################################################################
def
configure
(
self
,
simnumber
):
def
configure
(
self
,
simnumber
,
dir_path
,
result_path
):
"""
"""
...
@@ -1958,6 +1958,10 @@ class IFSsimulator():
...
@@ -1958,6 +1958,10 @@ class IFSsimulator():
self
.
processConfigs
()
self
.
processConfigs
()
self
.
_createEmpty
()
self
.
_createEmpty
()
self
.
information
[
'dir_path'
]
=
dir_path
self
.
information
[
'result_path'
]
=
result_path
############################################################
############################################################
...
@@ -1991,7 +1995,8 @@ class IFSsimulator():
...
@@ -1991,7 +1995,8 @@ class IFSsimulator():
self
.
result_path
=
self
.
information
[
'result_path'
]
+
'/'
+
self
.
source
+
ss
+
result_day
self
.
result_path
=
self
.
information
[
'result_path'
]
+
'/'
+
self
.
source
+
ss
+
result_day
print
(
self
.
information
[
'result_path'
])
if
os
.
path
.
isdir
(
self
.
result_path
)
==
False
:
if
os
.
path
.
isdir
(
self
.
result_path
)
==
False
:
os
.
mkdir
(
self
.
result_path
)
os
.
mkdir
(
self
.
result_path
)
...
@@ -5456,7 +5461,7 @@ class IFSsimulator():
...
@@ -5456,7 +5461,7 @@ class IFSsimulator():
self
.
source
=
sourcein
self
.
source
=
sourcein
self
.
simnumber
=
simnumber
self
.
simnumber
=
simnumber
self
.
configure
(
simnumber
)
# print the configfile name and path;
self
.
configure
(
simnumber
,
dir_path
,
result_path
)
)
# print the configfile name and path;
self
.
debug
=
self
.
information
[
'debug'
]
self
.
debug
=
self
.
information
[
'debug'
]
...
@@ -5726,7 +5731,7 @@ class IFSsimulator():
...
@@ -5726,7 +5731,7 @@ class IFSsimulator():
############################################################################
############################################################################
def
runIFSsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
iLoop
,
debug
,
applyhole
=
'no'
):
def
runIFSsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
iLoop
,
debug
,
applyhole
=
'no'
):
"""
"""
...
@@ -5763,8 +5768,6 @@ def runIFSsim(sourcein, configfile, dir_path, result_path,iLoop, debug, applyhol
...
@@ -5763,8 +5768,6 @@ def runIFSsim(sourcein, configfile, dir_path, result_path,iLoop, debug, applyhol
simulate
[
iLoop
].
information
[
'result_path'
]
=
result_path
simulate
[
iLoop
].
information
[
'result_path'
]
=
result_path
simulate
[
iLoop
].
simulate
(
sourcein
,
iLoop
)
simulate
[
iLoop
].
simulate
(
sourcein
,
iLoop
)
return
1
return
1
...
...
tests/test_ifs_sim.py
View file @
355e76b6
...
@@ -155,9 +155,11 @@ class TestDemoFunction(unittest.TestCase):
...
@@ -155,9 +155,11 @@ class TestDemoFunction(unittest.TestCase):
print
(
configfile
)
print
(
configfile
)
debug
=
True
debug
=
True
result_path
=
dir_path
+
'ifs_sim_result'
result_path
=
dir_path
+
'ifs_sim_result'
csst_ifs_sim
.
runIFSsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
1
,
debug
,
'no'
)
csst_ifs_sim
.
runIFSsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
1
,
debug
,
'no'
)
self
.
assertEqual
(
self
.
assertEqual
(
1
,
1
,
1
,
1
,
"case 4: sim passes."
,
"case 4: sim passes."
,
...
@@ -227,6 +229,7 @@ class TestDemoFunction(unittest.TestCase):
...
@@ -227,6 +229,7 @@ class TestDemoFunction(unittest.TestCase):
print
(
configfile
)
print
(
configfile
)
debug
=
True
debug
=
True
result_path
=
dir_path
+
'ifs_sim_result'
result_path
=
dir_path
+
'ifs_sim_result'
csst_ifs_sim
.
runIFSsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
1
,
debug
,
'no'
)
csst_ifs_sim
.
runIFSsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
1
,
debug
,
'no'
)
...
...
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