Skip to content

Commit

Permalink
ruff fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
Kort Travis committed Nov 14, 2024
1 parent 353be09 commit 90f526a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/snapred/backend/recipe/EffectiveInstrumentRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
logger = snapredLogger.getLogger(__name__)

Pallet = Tuple[Ingredients, Dict[str, str]]

def _to_degree(radian: float) -> float:
return radian * 180.0 / np.pi

@Singleton
class EffectiveInstrumentRecipe(Recipe[Ingredients]):
Expand All @@ -33,7 +30,7 @@ def queueAlgos(self):
self.mantidSnapper.EditInstrumentGeometry(
f"Editing instrument geometry for grouping '{self.unmaskedPixelGroup.focusGroup.name}'",
Workspace=self.inputWS,
# :( Anyone ever heard of SI units?!
# TODO: Mantid defect: allow SI units here!
L2=np.rad2deg(self.unmaskedPixelGroup.L2),
Polar=np.rad2deg(self.unmaskedPixelGroup.twoTheta),
Azimuthal=np.rad2deg(self.unmaskedPixelGroup.azimuth),
Expand Down
2 changes: 1 addition & 1 deletion src/snapred/ui/workflow/DiffCalWorkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def purgeBadPeaks(self, maxChiSq):
self._tweakPeakView,
"Too Few Peaks",
"Purging would result in fewer than the required 2 peaks for calibration. "
"The current set of peaks will be retained.",
+ "The current set of peaks will be retained.",
QMessageBox.Ok,
)
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/backend/recipe/test_EffectiveInstrumentRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestEffectiveInstrumentRecipe:
sculleryBoy = SculleryBoy()

@pytest.fixture(autouse=True)
def setup(self):
def _setup(self):
self.ingredients = mock.Mock(
spec=Ingredients,
unmaskedPixelGroup=mock.Mock(
Expand Down Expand Up @@ -115,7 +115,7 @@ def test_cater(self):

groceriess = [{"inputWorkspace": mock.Mock()}, {"inputWorkspace": mock.Mock()}]

output = recipe.cater(zip(ingredientss, groceriess))
recipe.cater(zip(ingredientss, groceriess))

assert mockSnapper.EditInstrumentGeometry.call_count == 2
mockSnapper.EditInstrumentGeometry.assert_any_call(
Expand Down
2 changes: 1 addition & 1 deletion tests/util/SculleryBoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def prepDetectorPeaks(self, ingredients: FarmFreshIngredients, purgePeaks=False)
except (TypeError, AttributeError):
return [mock.Mock(spec_set=GroupPeakList)]

def prepReductionIngredients(self, ingredients: FarmFreshIngredients, combinedPixelMask: Optional[WorkspaceName] = None): # noqa ARG002
def prepReductionIngredients(self, _ingredients: FarmFreshIngredients, _combinedPixelMask: Optional[WorkspaceName] = None):
path = Resource.getPath("/inputs/calibration/ReductionIngredients.json")
return parse_file_as(ReductionIngredients, path)

Expand Down

0 comments on commit 90f526a

Please sign in to comment.