-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from nstelter-slac/local_h5_test
Add local test scripts for h5 and parallel slice
- Loading branch information
Showing
43 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ jobs: | |
- name: Run tests | ||
run: | | ||
pytest tests/testFitFunctions.py | ||
pytest tests/test_FitFunctions.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
tests/test | ||
tests/scan | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
# beamtime-calibration-suite | ||
[![Build Status](https://github.com/slaclab/beamtime-calibration-suite/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/slaclab/beamtime-calibration-suite/actions/workflows/run-tests.yml) | ||
[![Build Status](https://github.com/slaclab/beamtime-calibration-suite/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/slaclab/beamtime-calibration-suite/actions/workflows/run-tests.yml) | ||
|
||
To run tests: | ||
ssh onto psana | ||
source /sdf/group/lcls/ds/ana/sw/conda2/manage/bin/psconda.sh | ||
clone this repo | ||
cd beamtime-calibration-suite/tests | ||
pytest . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+18.6 KB
tests/testData/expected/analyzeH5Expected/AnalyzeH5_r666_c0_r1_c14_testLabel_E.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.06 KB
tests/testData/expected/analyzeH5Expected/AnalyzeH5_r666_c0_r1_c14_testLabel_fitInfo.npy
Binary file not shown.
Binary file added
BIN
+13.8 KB
tests/testData/expected/analyzeH5Expected/AnalyzeH5_r666_c0_testLabel_E.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
...ata/expected/analyzeH5Expected/AnalyzeH5_r666_c0_testLabel_gainDistribution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+70 KB
tests/testData/expected/eventScanParallelSliceExpected/EventScanParallel_c0_r349_n1.h5
Binary file not shown.
Binary file added
BIN
+18.4 KB
...ed/eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_All1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.7 KB
...ed/eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_ROI0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.7 KB
...ed/eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_ROI1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.4 KB
.../eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.8 KB
...tScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel0_hist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.1 KB
.../eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.1 KB
...tScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel1_hist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.1 KB
.../eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.5 KB
...tScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel2_hist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.3 KB
.../eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.6 KB
...tScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel3_hist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.9 KB
.../eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.7 KB
...tScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel4_hist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.5 KB
.../eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.7 KB
...tScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel5_hist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.2 KB
.../eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
...tScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel6_hist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.5 KB
.../eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.1 KB
...tScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel7_hist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.9 KB
.../eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.3 KB
...tScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel8_hist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.2 KB
.../eventScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.2 KB
...tScanParallelSliceExpected/EventScanParallel_r349_c0_timestamps_pixel9_hist.png
Oops, something went wrong.
Binary file added
BIN
+54.1 KB
tests/testData/expected/eventScanParallelSliceExpected/bitSlice_c0_r349_rixx1003721.npy
Binary file not shown.
Binary file added
BIN
+208 Bytes
tests/testData/expected/eventScanParallelSliceExpected/eventNumbers_c0_r349_rixx1003721.npy
Binary file not shown.
Binary file added
BIN
+288 Bytes
tests/testData/expected/eventScanParallelSliceExpected/means_c0_r349_rixx1003721.npy
Binary file not shown.
Binary file added
BIN
+208 Bytes
tests/testData/expected/eventScanParallelSliceExpected/pulseIds_c0_r349_rixx1003721.npy
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import subprocess | ||
import os | ||
import shutil | ||
|
||
def test_run_analyzeh5_and_compare(): | ||
|
||
# Delete existing 'test' directory if it exists and make new one | ||
if os.path.exists('test'): | ||
shutil.rmtree('test') | ||
os.makedirs('test') | ||
|
||
result = subprocess.run(["python", "../scripts/AnalyzeH5.py", "-f", "testData/lowFlux/SimpleClusters_c0_r334_n100.h5", "-p", "test", "-r", "666", "-s", "2,15"]) | ||
|
||
#print(result.stdout) | ||
#print(result.stderr) | ||
|
||
# List of file pairs | ||
file_pairs = [ | ||
("test/AnalyzeH5_r666_c0_r1_c14_testLabel_E.png", "testData/expected/analyzeH5Expected/AnalyzeH5_r666_c0_r1_c14_testLabel_E.png"), | ||
("test/AnalyzeH5_r666_c0_testLabel_E.png", "testData/expected/analyzeH5Expected/AnalyzeH5_r666_c0_testLabel_E.png"), | ||
("test/AnalyzeH5_r666_c0_testLabel_gainDistribution.png", "testData/expected/analyzeH5Expected/AnalyzeH5_r666_c0_testLabel_gainDistribution.png"), | ||
("test/AnalyzeH5_r666_c0_r1_c14_testLabel_fitInfo.npy", "testData/expected/analyzeH5Expected/AnalyzeH5_r666_c0_r1_c14_testLabel_fitInfo.npy") | ||
] | ||
|
||
for file1, file2 in file_pairs: | ||
diff_result = subprocess.run(["diff", file1, file2]) | ||
assert diff_result.returncode == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import subprocess | ||
import os | ||
import shutil | ||
|
||
def test_run_event_scan_parallel_slice_and_compare(): | ||
|
||
# Delete existing 'scan' directory if it exists and make new one | ||
if os.path.exists('scan'): | ||
shutil.rmtree('scan') | ||
os.makedirs('scan') | ||
|
||
# run scripts | ||
result1 = subprocess.run(["python", "../scripts/EventScanParallelSlice.py", "-r", "349", "-p", "scan", "--maxNevents", "10"]) | ||
result2 = subprocess.run(["python", "../scripts/EventScanParallelSlice.py", "-r", "349", "-f", "scan/EventScanParallel_c0_r349_n1.h5", "-p", "scan"]) | ||
|
||
#print(result1.stdout) | ||
#print(result1.stderr) | ||
#print(result2.stdout) | ||
#print(result2.stderr) | ||
|
||
diff_result = subprocess.run(["diff", "-r", "scan", "testData/expected/eventScanParallelSliceExpected/"]) | ||
assert diff_result.returncode == 0 |
File renamed without changes.