Commit 62bb13ae authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

debug

parent 4716160c
Pipeline #4103 passed with stage
in 0 seconds
...@@ -5355,11 +5355,7 @@ class IFSsimulator(): ...@@ -5355,11 +5355,7 @@ class IFSsimulator():
self.simnumber = simnumber self.simnumber = simnumber
self.configure(simnumber) # print the configfile name and path; self.configure(simnumber) # print the configfile name and path;
if self.information['debug']=='yes': self.debug = self.information['debug']
self.debug = True
else:
self.debug = False
self.dt = datetime.utcnow() self.dt = datetime.utcnow()
...@@ -5617,7 +5613,7 @@ class IFSsimulator(): ...@@ -5617,7 +5613,7 @@ class IFSsimulator():
############################################################################ ############################################################################
def runIFSsim(sourcein, configfile, dir_path, iLoop, applyhole='no'): def runIFSsim(sourcein, configfile, dir_path, iLoop, debug, applyhole='no'):
""" """
...@@ -5650,6 +5646,8 @@ def runIFSsim(sourcein, configfile, dir_path, iLoop, applyhole='no'): ...@@ -5650,6 +5646,8 @@ def runIFSsim(sourcein, configfile, dir_path, iLoop, applyhole='no'):
### dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'], 'ifs_sim/') ### dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'], 'ifs_sim/')
simulate[iLoop].information['dir_path'] = dir_path simulate[iLoop].information['dir_path'] = dir_path
simulate[iLoop].information['debug'] =debug
simulate[iLoop].simulate(sourcein, iLoop) simulate[iLoop].simulate(sourcein, iLoop)
return 1 return 1
......
...@@ -41,8 +41,9 @@ class TestDemoFunction(unittest.TestCase): ...@@ -41,8 +41,9 @@ class TestDemoFunction(unittest.TestCase):
sourcein = 'SCI' sourcein = 'SCI'
print(configfile) print(configfile)
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, 'no') debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
"case 1: SCI sim passes.", "case 1: SCI sim passes.",
...@@ -75,7 +76,9 @@ class TestDemoFunction(unittest.TestCase): ...@@ -75,7 +76,9 @@ class TestDemoFunction(unittest.TestCase):
sourcein = 'BIAS' sourcein = 'BIAS'
print(configfile) print(configfile)
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, 'no') debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
"case 2: sim passes.", "case 2: sim passes.",
...@@ -108,7 +111,9 @@ class TestDemoFunction(unittest.TestCase): ...@@ -108,7 +111,9 @@ class TestDemoFunction(unittest.TestCase):
sourcein = 'DARK' sourcein = 'DARK'
print(configfile) print(configfile)
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, 'no') debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
"case 3: sim passes.", "case 3: sim passes.",
...@@ -141,7 +146,8 @@ class TestDemoFunction(unittest.TestCase): ...@@ -141,7 +146,8 @@ class TestDemoFunction(unittest.TestCase):
sourcein = 'LAMP' sourcein = 'LAMP'
print(configfile) print(configfile)
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, 'no') debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
"case 4: sim passes.", "case 4: sim passes.",
...@@ -174,7 +180,8 @@ class TestDemoFunction(unittest.TestCase): ...@@ -174,7 +180,8 @@ class TestDemoFunction(unittest.TestCase):
sourcein = 'LAMP' sourcein = 'LAMP'
print(configfile) print(configfile)
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, 'yes') debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
"case 5: sim passes.", "case 5: sim passes.",
...@@ -207,7 +214,8 @@ class TestDemoFunction(unittest.TestCase): ...@@ -207,7 +214,8 @@ class TestDemoFunction(unittest.TestCase):
sourcein = 'FLAT' sourcein = 'FLAT'
print(configfile) print(configfile)
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, 'no') debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
"case 6: sim passes.", "case 6: sim passes.",
......
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