Skip to content

Commit

Permalink
Update test_SST1DBLoader.py by testing scan ID 87758
Browse files Browse the repository at this point in the history
Added a set of tests for scan ID 87758 to check that the loadRun function continues to work for a more recent scan and that it works for a case in which a single energy and two polarizations are run.
  • Loading branch information
PriyankaKetkarBNL authored Sep 4, 2024
1 parent eae8b46 commit 8644d34
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/test_SST1DBLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,24 @@ def test_SST1DB_load_snake_scan_explicit_dims(sstdb):
assert 'sam_th' in run.indexes
assert 'polarization' in run.indexes


## This is intended to test a scan that was run at a single energy and two polarizations
@must_have_tiled
def test_SST1DB_load_single_scan_legacy_hinted_dims(sstdb):
run = sstdb.loadRun(87758).unstack('system')
assert 'energy' in run.indexes
assert 'polarization' in run.indexes
@must_have_tiled
def test_SST1DB_load_single_scan_legacy_explicit_dims(sstdb):
run = sstdb.loadRun(87758,dims=['energy','polarization']).unstack('system')
assert type(run) == xr.DataArray
assert 'energy' in run.indexes
assert 'polarization' in run.indexes


@must_have_tiled
def test_SST1DB_exposurewarnings(sstdb):
with pytest.warns(UserWarning, match="Wide Angle CCD Detector is reported as underexposed"):
sstdb.loadRun(83192)
with pytest.warns(UserWarning, match="Wide Angle CCD Detector is reported as saturated"):
sstdb.loadRun(67522)
sstdb.loadRun(67522)

0 comments on commit 8644d34

Please sign in to comment.