Skip to content

Commit

Permalink
rename recipes now that approved (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
rboston628 committed Oct 25, 2024
1 parent 4d4a562 commit 49df776
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 45 deletions.
8 changes: 4 additions & 4 deletions docs/source/api/snapred.backend.recipe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/snapred/backend/recipe/DiffractionCalibrationRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
10 changes: 0 additions & 10 deletions src/snapred/backend/recipe/algorithm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/cis_tests/artificial_norm_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/cis_tests/diffcal_integration_test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/cis_tests/diffcal_masking_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/cis_tests/lazy_rebin_ragged.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/cis_tests/new_diffcal_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 49df776

Please sign in to comment.