diff --git a/csst_ifs_sim/csst_ifs_sim.py b/csst_ifs_sim/csst_ifs_sim.py index a0c4bfccbc8b1da7c59d0a46b5d71987b7b63023..e8d213444121ead3147e1815f2541efc1b3cf066 100644 --- a/csst_ifs_sim/csst_ifs_sim.py +++ b/csst_ifs_sim/csst_ifs_sim.py @@ -5355,11 +5355,7 @@ class IFSsimulator(): self.simnumber = simnumber self.configure(simnumber) # print the configfile name and path; - if self.information['debug']=='yes': - - self.debug = True - else: - self.debug = False + self.debug = self.information['debug'] self.dt = datetime.utcnow() @@ -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'): ### dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'], 'ifs_sim/') simulate[iLoop].information['dir_path'] = dir_path + simulate[iLoop].information['debug'] =debug + simulate[iLoop].simulate(sourcein, iLoop) return 1 diff --git a/tests/test_ifs_sim.py b/tests/test_ifs_sim.py index 62b0cdce42c81da2ec83c13968e327555bbbf74f..2e9feec08b49d2511046b725a53b6c414215acfb 100644 --- a/tests/test_ifs_sim.py +++ b/tests/test_ifs_sim.py @@ -41,8 +41,9 @@ class TestDemoFunction(unittest.TestCase): sourcein = 'SCI' 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( 1 , 1, "case 1: SCI sim passes.", @@ -75,7 +76,9 @@ class TestDemoFunction(unittest.TestCase): sourcein = 'BIAS' 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( 1 , 1, "case 2: sim passes.", @@ -108,7 +111,9 @@ class TestDemoFunction(unittest.TestCase): sourcein = 'DARK' 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( 1 , 1, "case 3: sim passes.", @@ -141,7 +146,8 @@ class TestDemoFunction(unittest.TestCase): sourcein = 'LAMP' 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( 1 , 1, "case 4: sim passes.", @@ -174,7 +180,8 @@ class TestDemoFunction(unittest.TestCase): sourcein = 'LAMP' 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( 1 , 1, "case 5: sim passes.", @@ -207,7 +214,8 @@ class TestDemoFunction(unittest.TestCase): sourcein = 'FLAT' 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( 1 , 1, "case 6: sim passes.",