diff --git a/suite_scripts/AnalyzeH5.py b/suite_scripts/AnalyzeH5.py index 2aad755..abdc2ee 100644 --- a/suite_scripts/AnalyzeH5.py +++ b/suite_scripts/AnalyzeH5.py @@ -40,6 +40,8 @@ def __init__(self): ##logging.info("Output dir: " + self.outputDir) self.label = args.label self.camera = 0 + self.seedCut = args.seedCut + self.isTestRun = 'testRun' in args.special def getFiles(self): fileNames = self.files.split(",") @@ -169,6 +171,10 @@ def analyzeSimpleClusters(self, clusters): for m in analyzedModules: modClusters = ancillaryMethods.getMatchedClusters(smallSquareClusters, "module", m) for i in range(rows): + # just do a single row when testing + if self.isTestRun and i > 0: + break + rowModClusters = ancillaryMethods.getMatchedClusters(modClusters, "row", i) for j in range(cols): diff --git a/tests/test_SuiteScripts.py b/tests/test_SuiteScripts.py index 326c403..ab7f129 100644 --- a/tests/test_SuiteScripts.py +++ b/tests/test_SuiteScripts.py @@ -127,6 +127,7 @@ def __init__(self): "test_histogram_flux_etc", "test_roi", "test_search_for_non_switching", + "test_analyze_h5", ] # lets have the 'real output' folders just be in /suite_scripts @@ -458,8 +459,29 @@ def test_HistogramFlux(suite_tester, command, output_dir_name): suite_tester.test_command(command, output_dir_name) +# this test uses input data from sdf filepath (available on s3df), +# and we remove r102_custers.npy from the correctness comparison b/c this file is around 10gb! +@pytest.mark.parametrize( + "command, output_dir_name", + [ + ( + [ + "bash", + "-c", + "time python AnalyzeH5.py -r 102 -f /sdf/data/lcls/ds/rix/rixx1005922/results/lowFlux/SimpleClusters__c0_r102_n100.h5 -p ./test_analyze_h5 --special testRun && rm ./test_analyze_h5/r102_clusters.npy", + ], + "test_analyze_h5", + ), + ], +) +def test_Analyze_h5(suite_tester, command, output_dir_name): + if not suite_tester.canTestsRun: + pytest.skip("Can only test with psana library on S3DF!") + suite_tester.test_command(command, output_dir_name) + + # non-working commands... -""" +''' @pytest.mark.parametrize("command, output_dir_name", [ (['bash', '-c', 'python persistenceCheck.py -r 102 -d Epix10ka2M --maxNevents 250 -p /test_persistence_check'], 'test_persistence_check'), @@ -470,4 +492,4 @@ def test_PersistenceCheck(suite_tester, command, output_dir_name): if not suite_tester.canTestsRun: pytest.skip("Can only test with psana library on S3DF!") suite_tester.test_command(command, output_dir_name) -""" +''' diff --git a/tests/test_data b/tests/test_data index 13b3223..9d4d6c8 160000 --- a/tests/test_data +++ b/tests/test_data @@ -1 +1 @@ -Subproject commit 13b3223222b517e983199cf8d6f4657f8333c00e +Subproject commit 9d4d6c855079f1191eec17368e3ec889de728416