-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
un-reverso the removeBackground flag (#473)
* un-reverso the removeBackground flag * rebin the dpsaced data to avoid errors at low-d edge * make it a toggle * fixup! make it a toggle * disable the toggle until remove event background fixed --------- Co-authored-by: Boston S R <4rx@analysis-node19.sns.gov>
- Loading branch information
1 parent
6dd7e2c
commit b721a42
Showing
9 changed files
with
89 additions
and
48 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
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
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
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
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,44 @@ | ||
from unittest.mock import sentinel | ||
|
||
import pytest | ||
from pydantic import ValidationError | ||
from snapred.backend.dao.ingredients.DiffractionCalibrationIngredients import DiffractionCalibrationIngredients | ||
from snapred.backend.dao.request.DiffractionCalibrationRequest import DiffractionCalibrationRequest | ||
|
||
""" | ||
This is just a collection of tests verifying that extra inputs to certain DAOs | ||
are fobidden and generate errors. Pydantic offers several different ways to | ||
set this, so this test ensures consistent behavior. | ||
Please add more DAO tests to this file as you encounter them. | ||
""" | ||
|
||
|
||
def test_forbid_exta_diffcalingredients(): | ||
with pytest.raises(ValidationError) as e: | ||
DiffractionCalibrationIngredients( | ||
runConfig=sentinel.runConfig, | ||
pixelGroup=sentinel.pixelGroup, | ||
groupedPeakLists=sentinel.peakList, | ||
notPartOfThis=True, | ||
) | ||
# there will be errors corresponding to the mandatory arguments | ||
# we only want to make sure the last one complains about extras | ||
errors = e.value.errors() | ||
errors[-1]["loc"] == ["notPartOfThis"] | ||
errors[-1]["msg"] = "Extra inputs are not permitted" | ||
|
||
|
||
def test_forbid_exta_diffcalrequest(): | ||
with pytest.raises(ValidationError) as e: | ||
DiffractionCalibrationRequest( | ||
runNumber=sentinel.runNumber, | ||
calibrationSamplePath=sentinel.calibrationSamplePath, | ||
focusGroup=sentinel.focusGroup, | ||
useLiteMode=True, | ||
notPartOfThis=True, | ||
) | ||
# there will be errors corresponding to the mandatory arguments | ||
# we only want to make sure the last one complains about extras | ||
errors = e.value.errors() | ||
errors[-1]["loc"] == ["notPartOfThis"] | ||
errors[-1]["msg"] = "Extra inputs are not permitted" |
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