Skip to content

Commit 94b6307

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b720b8c commit 94b6307

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

src/snapred/backend/recipe/PixelDiffCalRecipe.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, List, Optional, Set
1+
from typing import Any, Dict, List, Set
22

33
import numpy as np
44
from pydantic import BaseModel, ConfigDict
@@ -10,7 +10,8 @@
1010
from snapred.backend.recipe.Recipe import Recipe
1111
from snapred.meta.Config import Config
1212
from snapred.meta.decorators.classproperty import classproperty
13-
from snapred.meta.mantid.WorkspaceNameGenerator import WorkspaceName, WorkspaceNameGenerator as wng
13+
from snapred.meta.mantid.WorkspaceNameGenerator import WorkspaceName
14+
from snapred.meta.mantid.WorkspaceNameGenerator import WorkspaceNameGenerator as wng
1415

1516
logger = snapredLogger.getLogger(__name__)
1617

@@ -21,7 +22,7 @@ class PixelDiffCalServing(BaseModel):
2122
maskWorkspace: WorkspaceName | None = None
2223
calibrationTable: str
2324
outputWorkspace: str
24-
25+
2526
model_config = ConfigDict(arbitrary_types_allowed=True)
2627

2728

src/snapred/backend/recipe/algorithm/FitMultiplePeaksAlgorithm.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@ def PyExec(self):
7878
)
7979
self.chopIngredients(reducedPeakList)
8080
self.unbagGroceries()
81-
81+
8282
numHisto = self.mantidSnapper.mtd[self.inputWorkspaceName].getNumberHistograms()
8383
if numHisto < len(self.groupIDs):
84-
raise ValueError(f"Number of histograms and number of GroupPeakLists do not match: {numHisto} vs {len(self.groupIDs)}")
85-
84+
raise ValueError(
85+
f"Number of histograms and number of GroupPeakLists do not match: {numHisto} vs {len(self.groupIDs)}"
86+
)
8687

8788
for index, groupID in enumerate(self.groupIDs):
8889
spectrumInfo = self.mantidSnapper.mtd[self.inputWorkspaceName].spectrumInfo()
@@ -91,7 +92,7 @@ def PyExec(self):
9192
raise ValueError(
9293
f"Spectrum with NO DETECTORS encountered on {self.inputWorkspaceName} at index {index}"
9394
)
94-
95+
9596
tmpSpecName = mtd.unique_name(prefix=f"__tmp_fitspec_{index}_")
9697
outputNameTmp = mtd.unique_name(prefix=f"__tmp_fitdiag_{index}_")
9798
outputNamesTmp = {x: f"{outputNameTmp}{self.outputSuffix[x]}_{index}" for x in FitOutputEnum}

src/snapred/backend/service/SousChef.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ def prepDiffractionCalibrationIngredients(
337337
self, ingredients: FarmFreshIngredients, combinedPixelMask: Optional[WorkspaceName] = None
338338
) -> DiffractionCalibrationIngredients:
339339
self.verifyCalibrationExists(ingredients.runNumber, ingredients.useLiteMode)
340-
pixelGroup=self.prepPixelGroup(ingredients, pixelMask=combinedPixelMask)
341-
groupedPeakLists=self.prepDetectorPeaks(ingredients, pixelMask=combinedPixelMask)
340+
pixelGroup = self.prepPixelGroup(ingredients, pixelMask=combinedPixelMask)
341+
groupedPeakLists = self.prepDetectorPeaks(ingredients, pixelMask=combinedPixelMask)
342342
return DiffractionCalibrationIngredients(
343343
runConfig=self.prepRunConfig(ingredients.runNumber),
344344
pixelGroup=pixelGroup,

src/snapred/ui/workflow/DiffCalWorkflow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,9 @@ def _renewFocus(self, groupingIndex):
540540
return response
541541

542542
def _renewFitPeaks(self, peakFunction):
543-
logger.info(f"there are {len(self.ingredients.pixelGroup.groupIDs)} groups, and {len(self.ingredients.groupedPeakLists)} peak lists")
543+
logger.info(
544+
f"there are {len(self.ingredients.pixelGroup.groupIDs)} groups, and {len(self.ingredients.groupedPeakLists)} peak lists"
545+
)
544546

545547
payload = FitMultiplePeaksRequest(
546548
inputWorkspace=self.focusedWorkspace,

0 commit comments

Comments
 (0)