diff --git a/docs/source/api/snapred.backend.recipe.rst b/docs/source/api/snapred.backend.recipe.rst index 23ad6c027..3b4fe6d83 100644 --- a/docs/source/api/snapred.backend.recipe.rst +++ b/docs/source/api/snapred.backend.recipe.rst @@ -20,18 +20,18 @@ snapred.backend.recipe.CrystallographicInfoRecipe module :undoc-members: :show-inheritance: -snapred.backend.recipe.algorithm.PixelDiffractionCalibration module +snapred.backend.recipe.PixelDiffCalRecipe module --------------------------------------------------------------------- -.. automodule:: snapred.backend.recipe.algorithm.PixelDiffractionCalibration +.. automodule:: snapred.backend.recipe.PixelDiffCalRecipe :members: :undoc-members: :show-inheritance: -snapred.backend.recipe.algorithm.GroupDiffractionCalibration module +snapred.backend.recipe.algorithm.GroupDiffCalRecipe module --------------------------------------------------------------------- -.. automodule:: snapred.backend.recipe.algorithm.GroupDiffractionCalibration +.. automodule:: snapred.backend.recipe.GroupDiffCalRecipe :members: :undoc-members: :show-inheritance: diff --git a/src/snapred/backend/recipe/DiffractionCalibrationRecipe.py b/src/snapred/backend/recipe/DiffractionCalibrationRecipe.py index 2a82ef9a5..160bfbc6a 100644 --- a/src/snapred/backend/recipe/DiffractionCalibrationRecipe.py +++ b/src/snapred/backend/recipe/DiffractionCalibrationRecipe.py @@ -2,8 +2,8 @@ from snapred.backend.dao.ingredients import DiffractionCalibrationIngredients as Ingredients from snapred.backend.log.logger import snapredLogger -from snapred.backend.recipe.algorithm.GroupDiffractionCalibration import GroupDiffCalRecipe -from snapred.backend.recipe.algorithm.PixelDiffractionCalibration import PixelDiffCalRecipe +from snapred.backend.recipe.GroupDiffCalRecipe import GroupDiffCalRecipe +from snapred.backend.recipe.PixelDiffCalRecipe import PixelDiffCalRecipe from snapred.meta.decorators.Singleton import Singleton logger = snapredLogger.getLogger(__name__) diff --git a/src/snapred/backend/recipe/algorithm/GroupDiffractionCalibration.py b/src/snapred/backend/recipe/GroupDiffCalRecipe.py similarity index 97% rename from src/snapred/backend/recipe/algorithm/GroupDiffractionCalibration.py rename to src/snapred/backend/recipe/GroupDiffCalRecipe.py index 43b0e5bc7..365b988c7 100644 --- a/src/snapred/backend/recipe/algorithm/GroupDiffractionCalibration.py +++ b/src/snapred/backend/recipe/GroupDiffCalRecipe.py @@ -13,14 +13,6 @@ logger = snapredLogger.getLogger(__name__) -""" -NOTE this file in fact defines a RECIPE. It needs to be renamed to GroupDiffCalRecipe.py -and moved into the recipe folder as soon as it has been reviewed. It is being temporarily -stored in the wrong location to make reviewing this story easier, to ensure nothing is -missing from the former algorithm implementation. -""" - - class GroupDiffCalServing(BaseModel): result: bool diagnosticWorkspace: str diff --git a/src/snapred/backend/recipe/algorithm/PixelDiffractionCalibration.py b/src/snapred/backend/recipe/PixelDiffCalRecipe.py similarity index 97% rename from src/snapred/backend/recipe/algorithm/PixelDiffractionCalibration.py rename to src/snapred/backend/recipe/PixelDiffCalRecipe.py index 59277577d..827c18e57 100644 --- a/src/snapred/backend/recipe/algorithm/PixelDiffractionCalibration.py +++ b/src/snapred/backend/recipe/PixelDiffCalRecipe.py @@ -13,14 +13,6 @@ logger = snapredLogger.getLogger(__name__) -""" -NOTE this file in fact defines a RECIPE. It needs to be renamed to PixelDiffCalRecipe.py -and moved into the recipe folder as soon as it has been reviewed. It is being temporarily -stored in the wrong location to make reviewing this story easier, to ensure nothing is -missing from the former algorithm implementation. -""" - - class PixelDiffCalServing(BaseModel): result: bool medianOffsets: List[float] diff --git a/src/snapred/backend/recipe/algorithm/__init__.py b/src/snapred/backend/recipe/algorithm/__init__.py index 1b2c251ac..bd118c0e9 100644 --- a/src/snapred/backend/recipe/algorithm/__init__.py +++ b/src/snapred/backend/recipe/algorithm/__init__.py @@ -44,16 +44,6 @@ def loadModule(x): # but it also is dead code and never used continue - if x == "PixelDiffractionCalibration": - # this is actually a recipe being temporarily stored here - # move it to recipe folder and delete this once review passes - continue - - if x == "GroupDiffractionCalibration": - # this is actually a recipe being temporarily stored here - # move it to recipe folder and delete this once review passes - continue - loadModule(x) # cleanup diff --git a/tests/cis_tests/artificial_norm_script.py b/tests/cis_tests/artificial_norm_script.py index feebdef0c..5618ea44c 100644 --- a/tests/cis_tests/artificial_norm_script.py +++ b/tests/cis_tests/artificial_norm_script.py @@ -16,8 +16,8 @@ from snapred.backend.data.GroceryService import GroceryService ## the code to test -from snapred.backend.recipe.algorithm.PixelDiffractionCalibration import PixelDiffCalRecipe as PixelRx -from snapred.backend.recipe.algorithm.GroupDiffractionCalibration import GroupDiffCalRecipe as GroupRx +from snapred.backend.recipe.PixelDiffCalRecipe import PixelDiffCalRecipe as PixelRx +from snapred.backend.recipe.GroupDiffCalRecipe import GroupDiffCalRecipe as GroupRx from snapred.backend.recipe.algorithm.CreateArtificialNormalizationAlgo import CreateArtificialNormalizationAlgo as FakeNormAlgo from snapred.backend.recipe.DiffractionCalibrationRecipe import DiffractionCalibrationRecipe as Recipe diff --git a/tests/cis_tests/diffcal_integration_test_script.py b/tests/cis_tests/diffcal_integration_test_script.py index 16791a932..2c06ee256 100644 --- a/tests/cis_tests/diffcal_integration_test_script.py +++ b/tests/cis_tests/diffcal_integration_test_script.py @@ -23,8 +23,8 @@ from snapred.backend.data.GroceryService import GroceryService ## the code to test -from snapred.backend.recipe.algorithm.PixelDiffractionCalibration import PixelDiffCalRecipe as PixelDiffCalRx -from snapred.backend.recipe.algorithm.GroupDiffractionCalibration import GroupDiffCalRecipe as GroupDiffCalRx +from snapred.backend.recipe.PixelDiffCalRecipe import PixelDiffCalRecipe as PixelDiffCalRx +from snapred.backend.recipe.GroupDiffCalRecipe import GroupDiffCalRecipe as GroupDiffCalRx from snapred.backend.recipe.DiffractionCalibrationRecipe import DiffractionCalibrationRecipe as Recipe # for running through service layer diff --git a/tests/cis_tests/diffcal_masking_script.py b/tests/cis_tests/diffcal_masking_script.py index 5ef297771..a23fd151a 100644 --- a/tests/cis_tests/diffcal_masking_script.py +++ b/tests/cis_tests/diffcal_masking_script.py @@ -14,8 +14,8 @@ SNAPRed_module_root = Path(snapred.__file__).parent.parent -from snapred.backend.recipe.algorithm.PixelDiffractionCalibration import PixelDiffCalRecipe as PixelRx -from snapred.backend.recipe.algorithm.GroupDiffractionCalibration import GroupDiffCalRecipe as GroupRx +from snapred.backend.recipe.PixelDiffCalRecipe import PixelDiffCalRecipe as PixelRx +from snapred.backend.recipe.GroupDiffCalRecipe import GroupDiffCalRecipe as GroupRx from snapred.backend.recipe.DiffractionCalibrationRecipe import DiffractionCalibrationRecipe as Recipe from snapred.backend.dao.ingredients import DiffractionCalibrationIngredients from snapred.backend.service.CalibrationService import CalibrationService diff --git a/tests/cis_tests/diffcal_pixel_diffraction_background_subtraction_script.py b/tests/cis_tests/diffcal_pixel_diffraction_background_subtraction_script.py index 81403f5ed..80ee2da83 100644 --- a/tests/cis_tests/diffcal_pixel_diffraction_background_subtraction_script.py +++ b/tests/cis_tests/diffcal_pixel_diffraction_background_subtraction_script.py @@ -15,7 +15,7 @@ from snapred.backend.data.GroceryService import GroceryService ## the code to test -from snapred.backend.recipe.algorithm.PixelDiffractionCalibration import PixelDiffCalRecipe as PixelRx +from snapred.backend.recipe.PixelDiffCalRecipe import PixelDiffCalRecipe as PixelRx from snapred.backend.recipe.DiffractionCalibrationRecipe import DiffractionCalibrationRecipe as Recipe # for running through service layer diff --git a/tests/cis_tests/lazy_rebin_ragged.py b/tests/cis_tests/lazy_rebin_ragged.py index 8cff9a4a6..7875411d1 100644 --- a/tests/cis_tests/lazy_rebin_ragged.py +++ b/tests/cis_tests/lazy_rebin_ragged.py @@ -10,7 +10,7 @@ from snapred.backend.dao.DetectorPeak import DetectorPeak from snapred.backend.dao.GroupPeakList import GroupPeakList from snapred.backend.dao.ingredients import DiffractionCalibrationIngredients -from snapred.backend.recipe.algorithm.GroupDiffractionCalibration import GroupDiffCalRecipe as GroupRx +from snapred.backend.recipe.GroupDiffCalRecipe import GroupDiffCalRecipe as GroupRx # needed to make mocked ingredients from snapred.backend.dao.RunConfig import RunConfig diff --git a/tests/cis_tests/new_diffcal_script.py b/tests/cis_tests/new_diffcal_script.py index b3cd74a84..3170b3b3f 100644 --- a/tests/cis_tests/new_diffcal_script.py +++ b/tests/cis_tests/new_diffcal_script.py @@ -15,8 +15,8 @@ from snapred.backend.data.GroceryService import GroceryService ## the code to test -from snapred.backend.recipe.algorithm.PixelDiffractionCalibration import PixelDiffCalRecipe as PixelDiffCalRx -from snapred.backend.recipe.algorithm.GroupDiffractionCalibration import GroupDiffCalRecipe as GroupDiffCalRx +from snapred.backend.recipe.PixelDiffCalRecipe import PixelDiffCalRecipe as PixelDiffCalRx +from snapred.backend.recipe.GroupDiffCalRecipe import GroupDiffCalRecipe as GroupDiffCalRx from snapred.backend.recipe.DiffractionCalibrationRecipe import DiffractionCalibrationRecipe as Recipe # for running through service layer diff --git a/tests/unit/backend/recipe/algorithm/test_GroupDiffractionCalibration.py b/tests/unit/backend/recipe/test_GroupDiffCalRecipe.py similarity index 99% rename from tests/unit/backend/recipe/algorithm/test_GroupDiffractionCalibration.py rename to tests/unit/backend/recipe/test_GroupDiffCalRecipe.py index 7ed015a97..48aea96c8 100644 --- a/tests/unit/backend/recipe/algorithm/test_GroupDiffractionCalibration.py +++ b/tests/unit/backend/recipe/test_GroupDiffCalRecipe.py @@ -9,7 +9,7 @@ from snapred.backend.log.logger import snapredLogger # the algorithm to test -from snapred.backend.recipe.algorithm.GroupDiffractionCalibration import ( +from snapred.backend.recipe.GroupDiffCalRecipe import ( GroupDiffCalRecipe as Recipe, # noqa: E402 ) from util.diffraction_calibration_synthetic_data import SyntheticData diff --git a/tests/unit/backend/recipe/algorithm/test_PixelDiffractionCalibration.py b/tests/unit/backend/recipe/test_PixelDiffCalRecipe.py similarity index 98% rename from tests/unit/backend/recipe/algorithm/test_PixelDiffractionCalibration.py rename to tests/unit/backend/recipe/test_PixelDiffCalRecipe.py index 4320f6447..68a11fc8d 100644 --- a/tests/unit/backend/recipe/algorithm/test_PixelDiffractionCalibration.py +++ b/tests/unit/backend/recipe/test_PixelDiffCalRecipe.py @@ -8,7 +8,7 @@ # needed to make mocked ingredients # the algorithm to test -from snapred.backend.recipe.algorithm.PixelDiffractionCalibration import PixelDiffCalRecipe as Recipe +from snapred.backend.recipe.PixelDiffCalRecipe import PixelDiffCalRecipe as Recipe from snapred.meta.Config import Config from util.diffraction_calibration_synthetic_data import SyntheticData from util.helpers import maskSpectra, setSpectraToZero @@ -22,7 +22,7 @@ """ -class TestPixelDiffractionCalibration(unittest.TestCase): +class TestPixelDiffCalRecipe(unittest.TestCase): def setUp(self): """Create a set of mocked ingredients for calculating DIFC corrected by offsets""" inputs = SyntheticData()