-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test ensuring Swift data can be used in the UI layer
The Swift data and responses are read in, and the statistic calculated (for all data and a subset of data) for a chi-square and Poisson-based variant. The results are compared to values caluclated using XSPEC 12.9.1b. The ARF and RMF have to be modified before being used, to replace the energy-bin edge equal to 0. Asserts are used to check that the data really contains the problem value, in case the I/O layer is ever changed to "fudge" problem data like this (XSPEC does it when the RMF is read in, with the message ***Warning: Detected response matrix energy bin value = 0 (or neg). XSPEC will instead use small finite value (response file will not be altered). The 0-value bin causes a division-by-zero warning (if it is not fixed). This warning is checked for, but at present there doesn't seem to be an obvious way to tell the pytext fixture in sherpa/conftest.py, namely capture_all_warnings, that this warning should only be ignored for this test. I have tried (in other PRs) to use the recwarn fixture to remove the warning from the system, but it did not seem reliable (e.g. would work if a single test file was run, but not when all tests were run).
- Loading branch information
Showing
2 changed files
with
121 additions
and
1 deletion.
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
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