Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 29, 2024
1 parent e280274 commit 2f6931c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/snapred/backend/recipe/ReductionRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ def _deleteWorkspace(self, workspace: str):
)
self.mantidSnapper.executeQueue()

def _prepareUnfocusedData(self, workspace: WorkspaceName, mask: Optional[WorkspaceName], units: str) -> WorkspaceName:
def _prepareUnfocusedData(
self, workspace: WorkspaceName, mask: Optional[WorkspaceName], units: str
) -> WorkspaceName:
unitsAbrev = ""
match units:
case "Wavelength":
Expand All @@ -111,7 +113,7 @@ def _prepareUnfocusedData(self, workspace: WorkspaceName, mask: Optional[Workspa
MaskWorkspace=mask,
OutputWorkspace=self.unfocWs,
)

self.mantidSnapper.ConvertUnits(
f"Converting unfocused data to {units} units",
InputWorkspace=self.unfocWs,
Expand Down
8 changes: 3 additions & 5 deletions tests/unit/backend/recipe/test_ReductionRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,17 @@ def test_prepareUnfocusedData_masking(self):
recipe._prepareUnfocusedData(workspace, None, units)
recipe.mantidSnapper.MaskDetectorFlags.assert_not_called()
recipe.mantidSnapper.reset_mock()

recipe._prepareUnfocusedData(workspace, maskWs, units)

recipe.mantidSnapper.MaskDetectorFlags.assert_called_once_with(
"Applying pixel mask to unfocused data",
MaskWorkspace=maskWs,
OutputWorkspace=outputWs
"Applying pixel mask to unfocused data", MaskWorkspace=maskWs, OutputWorkspace=outputWs
)
recipe.mantidSnapper.ConvertUnits.assert_called_once_with(
f"Converting unfocused data to {units} units",
InputWorkspace=outputWs,
OutputWorkspace=outputWs,
Target=units
Target=units,
)
recipe.mantidSnapper.executeQueue.assert_called()
recipe.mantidSnapper.reset_mock()
Expand Down

0 comments on commit 2f6931c

Please sign in to comment.