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
16e95ca5
Commit
16e95ca5
authored
May 15, 2024
by
Yan Zhaojun
Browse files
test
parent
97c55956
Changes
2
Hide whitespace changes
Inline
Side-by-side
csst_mci_sim/csst_mci_sim.py
View file @
16e95ca5
...
@@ -1034,18 +1034,19 @@ class MCIsimulator():
...
@@ -1034,18 +1034,19 @@ class MCIsimulator():
#data_time=now.strftime("%Y-%m-%d-%H-%M-%S")
#data_time=now.strftime("%Y-%m-%d-%H-%M-%S")
result_day
=
now
.
strftime
(
"%Y-%m-%d"
)
result_day
=
now
.
strftime
(
"%Y-%m-%d"
)
if
self
.
information
[
'dir_path'
]
==
'/nfsdata/share/simulation-unittest/mci_sim/'
:
#
if self.information['dir_path'] =='/nfsdata/share/simulation-unittest/mci_sim/':
self
.
result_path
=
self
.
information
[
'dir_path'
]
+
'mci_sim_result/'
+
result_day
#
self.result_path = self.information['dir_path'] +'mci_sim_result/'+result_day
else
:
#
else:
home_path
=
os
.
environ
[
'HOME'
]
#
home_path = os.environ['HOME']
if
home_path
==
'/home/yan'
:
#
if home_path == '/home/yan':
self
.
result_path
=
'../MCI_simResult/'
+
self
.
source
+
"_"
+
result_day
#
self.result_path = '../MCI_simResult/'+self.source+"_"+result_day
else
:
#
else:
self
.
result_path
=
'/data/mcisimdata/'
+
result_day
#
self.result_path = '/data/mcisimdata/'+result_day
self
.
result_path
=
self
.
information
[
'result_path'
]
+
self
.
source
+
"_"
+
result_day
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
)
...
@@ -4908,7 +4909,7 @@ class MCIsimulator():
...
@@ -4908,7 +4909,7 @@ class MCIsimulator():
################################################################################################
################################################################################################
def
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
debug
,
iLoop
):
def
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
debug
,
iLoop
):
print
(
'Path Test:dir_path'
,
dir_path
)
print
(
'Path Test:dir_path'
,
dir_path
)
...
@@ -4919,7 +4920,8 @@ def runMCIsim(sourcein,configfile,dir_path, debug, iLoop):
...
@@ -4919,7 +4920,8 @@ def runMCIsim(sourcein,configfile,dir_path, debug, iLoop):
sim
[
iLoop
].
configure
(
iLoop
,
sourcein
,
dir_path
)
# load the configfile;
sim
[
iLoop
].
configure
(
iLoop
,
sourcein
,
dir_path
)
# load the configfile;
sim
[
iLoop
].
information
[
'sourcein'
]
=
sourcein
sim
[
iLoop
].
information
[
'sourcein'
]
=
sourcein
sim
[
iLoop
].
information
[
'debug'
]
=
debug
sim
[
iLoop
].
information
[
'debug'
]
=
debug
sim
[
iLoop
].
information
[
'result_path'
]
=
result_path
sim
[
iLoop
].
simulate
(
iLoop
)
sim
[
iLoop
].
simulate
(
iLoop
)
...
...
tests/test_mci_sim.py
View file @
16e95ca5
...
@@ -48,8 +48,10 @@ class TestDemoFunction(unittest.TestCase):
...
@@ -48,8 +48,10 @@ class TestDemoFunction(unittest.TestCase):
print
(
configfile
)
print
(
configfile
)
debug
=
True
debug
=
True
result_path
=
dir_path
+
'mci_sim_result/'
csst_mci_sim
.
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
debug
,
1
)
csst_mci_sim
.
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
debug
,
1
)
self
.
assertEqual
(
self
.
assertEqual
(
1
,
1
,
1
,
1
,
...
@@ -89,7 +91,9 @@ class TestDemoFunction(unittest.TestCase):
...
@@ -89,7 +91,9 @@ class TestDemoFunction(unittest.TestCase):
debug
=
True
debug
=
True
csst_mci_sim
.
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
debug
,
1
)
result_path
=
dir_path
+
'mci_sim_result/'
csst_mci_sim
.
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
debug
,
1
)
self
.
assertEqual
(
self
.
assertEqual
(
1
,
1
,
1
,
1
,
...
@@ -130,7 +134,9 @@ class TestDemoFunction(unittest.TestCase):
...
@@ -130,7 +134,9 @@ class TestDemoFunction(unittest.TestCase):
debug
=
True
debug
=
True
csst_mci_sim
.
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
debug
,
1
)
result_path
=
dir_path
+
'mci_sim_result/'
csst_mci_sim
.
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
debug
,
1
)
self
.
assertEqual
(
self
.
assertEqual
(
1
,
1
,
1
,
1
,
...
@@ -170,7 +176,9 @@ class TestDemoFunction(unittest.TestCase):
...
@@ -170,7 +176,9 @@ class TestDemoFunction(unittest.TestCase):
debug
=
True
debug
=
True
csst_mci_sim
.
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
debug
,
1
)
result_path
=
dir_path
+
'mci_sim_result/'
csst_mci_sim
.
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
debug
,
1
)
self
.
assertEqual
(
self
.
assertEqual
(
1
,
1
,
1
,
1
,
...
@@ -210,7 +218,9 @@ class TestDemoFunction(unittest.TestCase):
...
@@ -210,7 +218,9 @@ class TestDemoFunction(unittest.TestCase):
debug
=
True
debug
=
True
csst_mci_sim
.
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
debug
,
1
)
result_path
=
dir_path
+
'mci_sim_result/'
csst_mci_sim
.
runMCIsim
(
sourcein
,
configfile
,
dir_path
,
result_path
,
debug
,
1
)
self
.
assertEqual
(
self
.
assertEqual
(
1
,
1
,
1
,
1
,
...
...
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