Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
ca65fe28
Commit
ca65fe28
authored
9 years ago
by
Mathieu Doucet
Browse files
Options
Downloads
Patches
Plain Diff
Fix pylint errors
parent
3a6ff7c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/PythonInterface/plugins/algorithms/LRDirectBeamSort.py
+6
-11
6 additions, 11 deletions
...rk/PythonInterface/plugins/algorithms/LRDirectBeamSort.py
with
6 additions
and
11 deletions
Framework/PythonInterface/plugins/algorithms/LRDirectBeamSort.py
+
6
−
11
View file @
ca65fe28
#pylint: disable=no-init,invalid-name
import
math
import
time
import
numpy
as
np
import
mantid
from
mantid.api
import
*
from
mantid.simpleapi
import
*
from
mantid.kernel
import
*
import
logging
class
CompareTwoNXSDataForSFcalculator
(
object
):
"""
will return -1, 0 or 1 according to the position of the nexusToPosition in relation to the
will return -1, 0 or 1 according to the position of the nexusToPosition in relation to the
nexusToCompareWith based on the following criteria
#1: number of attenuators (ascending order)
#2: lambda requested (descending order)
...
...
@@ -58,9 +54,9 @@ class CompareTwoNXSDataForSFcalculator(object):
resultLessThan
=
1
resultMoreThan
=
-
1
if
(
_paramNexusToPosition
<
_paramNexusToCompareWith
)
:
if
_paramNexusToPosition
<
_paramNexusToCompareWith
:
return
resultLessThan
elif
(
_paramNexusToPosition
>
_paramNexusToCompareWith
)
:
elif
_paramNexusToPosition
>
_paramNexusToCompareWith
:
return
resultMoreThan
else
:
return
0
...
...
@@ -74,7 +70,7 @@ def sorter_function(r1, r2):
"""
return
CompareTwoNXSDataForSFcalculator
(
r2
,
r1
).
result
()
class
LRDirectBeamSort
(
PythonAlgorithm
):
def
category
(
self
):
...
...
@@ -140,7 +136,7 @@ class LRDirectBeamSort(PythonAlgorithm):
def
_compute_scaling_factors
(
self
,
lr_data_sorted
):
"""
If we need to compute the scaling factors, group the runs by their wavelength request
If we need to compute the scaling factors, group the runs by their wavelength request
@param lr_data_sorted: ordered list of workspaces
"""
group_list
=
[]
...
...
@@ -155,7 +151,7 @@ class LRDirectBeamSort(PythonAlgorithm):
if
len
(
current_group
)
>
0
:
group_list
.
append
(
current_group
)
current_group
=
[]
current_group
.
append
(
r
)
# Add in the last group
...
...
@@ -169,7 +165,6 @@ class LRDirectBeamSort(PythonAlgorithm):
for
g
in
group_list
:
if
len
(
g
)
==
0
:
continue
runs
=
[
r
.
getRunNumber
()
for
r
in
g
]
direct_beam_runs
=
[]
peak_ranges
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment