Skip to content

Commit b73bb4c

Browse files
committed
Fixing tests.
1 parent b1cc8a7 commit b73bb4c

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

Tests/python/unittest/SimExTest/Calculators/S2EReconstructionTest.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# #
1717
# You should have received a copy of the GNU General Public License #
1818
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
19-
# Include needed directories in sys.path. #
2019
# #
2120
##########################################################################
2221

@@ -46,7 +45,7 @@ class S2EReconstructionTest(unittest.TestCase):
4645
@classmethod
4746
def setUpClass(cls):
4847
""" Setting up the test class. """
49-
cls.input_h5 = TestUtilities.generateTestFilePath('diffr_out_0000001.h5')
48+
cls.input_h5 = TestUtilities.generateTestFilePath('diffr')
5049

5150
@classmethod
5251
def tearDownClass(cls):
@@ -84,6 +83,14 @@ def testBackengine(self):
8483
self.__files_to_remove.append('orient_out.h5')
8584
self.__files_to_remove.append('recon_out.h5')
8685

86+
emc_parameters = {'initial_number_of_quaternions' : 1,
87+
'max_number_of_quaternions' : 2,
88+
'max_number_of_iterations' : 10,
89+
'min_error' : 1.0e-6,
90+
'beamstop' : 1.0e-5,
91+
'detailed_output' : False
92+
}
93+
8794
dm_parameters = {'number_of_trials' : 5,
8895
'number_of_iterations' : 2,
8996
'averaging_start' : 15,
@@ -93,7 +100,7 @@ def testBackengine(self):
93100

94101

95102
# Construct the object.
96-
analyzer = S2EReconstruction(parameters={'EMC_Parameters' : None, 'DM_Parameters' : dm_parameters}, input_path=self.input_h5, output_path='recon_out.h5')
103+
analyzer = S2EReconstruction(parameters={'EMC_Parameters' : emc_parameters, 'DM_Parameters' : dm_parameters}, input_path=self.input_h5, output_path='recon_out.h5')
97104

98105
# Call backengine.
99106
status = analyzer.backengine()

Tests/python/unittest/SimExTest/PhotonExperimentSimulation/PhotonExperimentSimulationTest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,11 @@ def testSimS2EWorkflowSingleFile(self):
517517
'pmi/pmi_out_0000001.h5',
518518
'diffr/diffr_out_0000001.h5',
519519
'orient_out.h5',
520+
'recon.h5'
520521
]
521522

522523
# Ensure proper cleanup.
523524
self.__files_to_remove = expected_files
524-
self.__files_to_remove.append('prepHDF5.py')
525525
self.__dirs_to_remove = expected_dirs
526526

527527

@@ -560,9 +560,9 @@ def testSimS2EWorkflowSingleFile(self):
560560

561561
# Reconstruction: EMC+DM
562562
emc_parameters = {'initial_number_of_quaternions' : 1,
563-
'max_number_of_quaternions' : 9,
564-
'max_number_of_iterations' : 3,
565-
'min_error' : 1.0e-8,
563+
'max_number_of_quaternions' : 2,
564+
'max_number_of_iterations' : 10,
565+
'min_error' : 1.0e-6,
566566
'beamstop' : 1.0e-5,
567567
'detailed_output' : False
568568
}
@@ -575,7 +575,7 @@ def testSimS2EWorkflowSingleFile(self):
575575
}
576576

577577
reconstructor = S2EReconstruction(parameters={'EMC_Parameters' : emc_parameters, 'DM_Parameters' : dm_parameters},
578-
input_path='diffr',
578+
input_path=TestUtilities.generateTestFilePath('diffr'), # Cheeting here to provide more realistic data for emc.
579579
output_path = 'recon.h5'
580580
)
581581

0 commit comments

Comments
 (0)