From 355e76b6240c230048f655395cde880869a7be2b Mon Sep 17 00:00:00 2001 From: "zhaojunyan@shao.ac.cn" Date: Thu, 16 May 2024 05:30:50 +0800 Subject: [PATCH] test --- csst_ifs_sim/csst_ifs_sim.py | 15 +++++++++------ tests/test_ifs_sim.py | 3 +++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/csst_ifs_sim/csst_ifs_sim.py b/csst_ifs_sim/csst_ifs_sim.py index d4d2316..4937a58 100644 --- a/csst_ifs_sim/csst_ifs_sim.py +++ b/csst_ifs_sim/csst_ifs_sim.py @@ -1934,7 +1934,7 @@ class IFSsimulator(): ############################################################################### ############################################################################### - def configure(self, simnumber): + def configure(self, simnumber,dir_path, result_path): """ @@ -1958,6 +1958,10 @@ class IFSsimulator(): self.processConfigs() self._createEmpty() + + self.information['dir_path']=dir_path + + self.information['result_path']=result_path ############################################################ @@ -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: os.mkdir(self.result_path) @@ -5456,7 +5461,7 @@ class IFSsimulator(): self.source = sourcein 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'] @@ -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 simulate[iLoop].information['result_path'] = result_path - - simulate[iLoop].simulate(sourcein, iLoop) return 1 diff --git a/tests/test_ifs_sim.py b/tests/test_ifs_sim.py index d7bedfe..444146e 100644 --- a/tests/test_ifs_sim.py +++ b/tests/test_ifs_sim.py @@ -155,9 +155,11 @@ class TestDemoFunction(unittest.TestCase): print(configfile) debug=True + result_path=dir_path+'ifs_sim_result' csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no') + self.assertEqual( 1 , 1, "case 4: sim passes.", @@ -227,6 +229,7 @@ class TestDemoFunction(unittest.TestCase): print(configfile) debug=True + result_path=dir_path+'ifs_sim_result' csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no') -- GitLab