Skip to content
Snippets Groups Projects
Commit 5551241d authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #24333 flake8 fixes

parent 4b188774
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# SPDX - License - Identifier: GPL - 3.0 + # SPDX - License - Identifier: GPL - 3.0 +
#pylint: disable=no-init #pylint: disable=no-init
from mantid.api import PythonAlgorithm, AlgorithmFactory, ITableWorkspaceProperty, WorkspaceFactory from mantid.api import PythonAlgorithm, AlgorithmFactory, ITableWorkspaceProperty
from mantid.kernel import Direction from mantid.kernel import Direction
from mantid.simpleapi import * from mantid.simpleapi import *
from mantid import mtd from mantid import mtd
...@@ -30,7 +30,7 @@ class OptimizeCrystalPlacementByRun(PythonAlgorithm): ...@@ -30,7 +30,7 @@ class OptimizeCrystalPlacementByRun(PythonAlgorithm):
self.declareProperty(ITableWorkspaceProperty("InputWorkspace", "", Direction.Input), self.declareProperty(ITableWorkspaceProperty("InputWorkspace", "", Direction.Input),
"The name of the peaks workspace that will be optimized.") "The name of the peaks workspace that will be optimized.")
self.declareProperty("Tolerance", 0.15, "Tolerance of indexing of peaks.") self.declareProperty("Tolerance", 0.15, "Tolerance of indexing of peaks.")
self.declareProperty("OutputWorkspace", "", self.declareProperty("OutputWorkspace", "",
"The name of the peaks workspace that will be created.") "The name of the peaks workspace that will be created.")
def PyExec(self): def PyExec(self):
...@@ -47,11 +47,10 @@ class OptimizeCrystalPlacementByRun(PythonAlgorithm): ...@@ -47,11 +47,10 @@ class OptimizeCrystalPlacementByRun(PythonAlgorithm):
minR = int(stats.column('RunNumber')[stat_col.index('Minimum')]) minR = int(stats.column('RunNumber')[stat_col.index('Minimum')])
maxR = int(stats.column('RunNumber')[stat_col.index('Maximum')]) + 1 maxR = int(stats.column('RunNumber')[stat_col.index('Maximum')]) + 1
AnalysisDataService.remove(stats.getName()) AnalysisDataService.remove(stats.getName())
group = [] group = []
for run in range(minR, maxR): for run in range(minR, maxR):
FilterPeaks(InputWorkspace=ws, OutputWorkspace=str(run), FilterVariable='RunNumber', FilterPeaks(InputWorkspace=ws, OutputWorkspace=str(run), FilterVariable='RunNumber',
FilterValue=run, Operator='=') FilterValue=run, Operator='=')
run = mtd[str(run)] run = mtd[str(run)]
peaks = run.getNumberPeaks() peaks = run.getNumberPeaks()
if peaks == 0: if peaks == 0:
...@@ -59,10 +58,8 @@ class OptimizeCrystalPlacementByRun(PythonAlgorithm): ...@@ -59,10 +58,8 @@ class OptimizeCrystalPlacementByRun(PythonAlgorithm):
else: else:
group.append(str(run)) group.append(str(run))
GroupWorkspaces(InputWorkspaces=group, OutputWorkspace=ws_group) GroupWorkspaces(InputWorkspaces=group, OutputWorkspace=ws_group)
OptimizeCrystalPlacement(PeaksWorkspace=ws_group, ModifiedPeaksWorkspace=ws_group, AdjustSampleOffsets=True,
OptimizeCrystalPlacement(PeaksWorkspace=ws_group, ModifiedPeaksWorkspace=ws_group, AdjustSampleOffsets=True, MaxSamplePositionChangeMeters=0.005,MaxIndexingError=tolerance)
MaxSamplePositionChangeMeters=0.005,MaxIndexingError=tolerance)
RenameWorkspace(InputWorkspace=str(minR),OutputWorkspace=ws_append) RenameWorkspace(InputWorkspace=str(minR),OutputWorkspace=ws_append)
for run in range(minR+1, maxR): for run in range(minR+1, maxR):
if AnalysisDataService.doesExist(str(run)): if AnalysisDataService.doesExist(str(run)):
...@@ -72,7 +69,6 @@ class OptimizeCrystalPlacementByRun(PythonAlgorithm): ...@@ -72,7 +69,6 @@ class OptimizeCrystalPlacementByRun(PythonAlgorithm):
num,err=IndexPeaks(PeaksWorkspace=ws_append,Tolerance=tolerance) num,err=IndexPeaks(PeaksWorkspace=ws_append,Tolerance=tolerance)
logger.notice('After Optimization Number indexed: %s error: %s\n'%(num, err)) logger.notice('After Optimization Number indexed: %s error: %s\n'%(num, err))
AnalysisDataService.remove(ws_group) AnalysisDataService.remove(ws_group)
self.setProperty("OutputWorkspace", ws_append) self.setProperty("OutputWorkspace", ws_append)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment