Skip to content

Commit 1818ac6

Browse files
committed
Allow hkl variables in specific files
1 parent 32d4696 commit 1818ac6

File tree

17 files changed

+115
-98
lines changed

17 files changed

+115
-98
lines changed

Framework/PythonInterface/plugins/algorithms/AngularAutoCorrelationsSingleAxis.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
# pylint: disable=too-many-branches,too-many-locals, invalid-name
8+
# ruff: noqa: E741 # Ambiguous variable name
89
from mantid.api import AlgorithmFactory, FileAction, FileProperty, PythonAlgorithm, WorkspaceProperty
910
from mantid.kernel import Direction
1011
from mantid.simpleapi import logger, CreateWorkspace
@@ -188,8 +189,8 @@ def PyExec(self):
188189

189190
for k in species_one:
190191
sum_position_species_one += cartesian_configuration[k]
191-
for L in species_two:
192-
sum_position_species_two += cartesian_configuration[L]
192+
for l in species_two:
193+
sum_position_species_two += cartesian_configuration[l]
193194
avg_position_species_one = 1.0 * sum_position_species_one / len(species_one)
194195
avg_position_species_two = 1.0 * sum_position_species_two / len(species_two)
195196

Framework/PythonInterface/plugins/algorithms/AngularAutoCorrelationsTwoAxes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
# pylint: disable=too-many-branches,too-many-locals, invalid-name
8+
# ruff: noqa: E741 # Ambiguous variable name
89
from mantid.api import AlgorithmFactory, FileAction, FileProperty, PythonAlgorithm, WorkspaceProperty
910
from mantid.kernel import Direction
1011
from mantid.simpleapi import logger, CreateWorkspace
@@ -195,8 +196,8 @@ def PyExec(self):
195196
sum_position_species_two = np.zeros((n_timesteps, n_dimensions))
196197
for k in species_one:
197198
sum_position_species_one += cartesian_configuration[k]
198-
for L in species_two:
199-
sum_position_species_two += cartesian_configuration[L]
199+
for l in species_two:
200+
sum_position_species_two += cartesian_configuration[l]
200201
avg_position_species_one = 1.0 * sum_position_species_one / float(len(species_one))
201202
avg_position_species_two = 1.0 * sum_position_species_two / float(len(species_two))
202203
# Choose the 1st element of species_three to build the 2nd vector

Framework/PythonInterface/plugins/algorithms/CreateLeBailFitInput.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
# pylint: disable=no-init,invalid-name
8+
# ruff: noqa: E741 # Ambiguous variable name
89
import mantid.simpleapi as api
910
from mantid.api import (
1011
AlgorithmFactory,
@@ -172,14 +173,14 @@ def generateBraggReflections(self, hklmax):
172173
hkldict = {}
173174
for h in range(0, max_m):
174175
for k in range(h, max_m):
175-
for L in range(k, max_m):
176-
dsq = h * h + k * k + L * L
176+
for l in range(k, max_m):
177+
dsq = h * h + k * k + l * l
177178
if dsq <= max_hkl_sq:
178179
if (dsq in hkldict) is False:
179180
hkldict[dsq] = []
180-
hkldict[dsq].append([h, k, L])
181+
hkldict[dsq].append([h, k, l])
181182
# ENDIF
182-
# ENDFOR (L)
183+
# ENDFOR (l)
183184
# ENDFOR (k)
184185
# ENDFOR (h)
185186

Framework/PythonInterface/plugins/algorithms/DeltaPDF3D.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# NScD Oak Ridge National Laboratory, European Spallation Source,
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
7+
# ruff: noqa: E741 # Ambiguous variable name
78
from mantid.api import PythonAlgorithm, AlgorithmFactory, IMDHistoWorkspaceProperty, PropertyMode, WorkspaceProperty, Progress
89
from mantid.kernel import (
910
Direction,
@@ -261,12 +262,12 @@ def _punch_and_fill(self, signal, dimX, dimY, dimZ):
261262
if cut_shape == "cube":
262263
for h in range(int(np.ceil(Xmin)), int(Xmax) + 1):
263264
for k in range(int(np.ceil(Ymin)), int(Ymax) + 1):
264-
for L in range(int(np.ceil(Zmin)), int(Zmax) + 1):
265-
if not check_space_group or sg.isAllowedReflection([h, k, L]):
265+
for l in range(int(np.ceil(Zmin)), int(Zmax) + 1):
266+
if not check_space_group or sg.isAllowedReflection([h, k, l]):
266267
signal[
267268
int((h - size[0] - Xmin) / Xwidth + 1) : int((h + size[0] - Xmin) / Xwidth),
268269
int((k - size[1] - Ymin) / Ywidth + 1) : int((k + size[1] - Ymin) / Ywidth),
269-
int((L - size[2] - Zmin) / Zwidth + 1) : int((L + size[2] - Zmin) / Zwidth),
270+
int((l - size[2] - Zmin) / Zwidth + 1) : int((l + size[2] - Zmin) / Zwidth),
270271
] = np.nan
271272
else: # sphere
272273
mask = (X - np.round(X)) ** 2 / size[0] ** 2 + (Y - np.round(Y)) ** 2 / size[1] ** 2 + (Z - np.round(Z)) ** 2 / size[2] ** 2 < 1
@@ -275,12 +276,12 @@ def _punch_and_fill(self, signal, dimX, dimY, dimZ):
275276
if check_space_group:
276277
for h in range(int(np.ceil(Xmin)), int(Xmax) + 1):
277278
for k in range(int(np.ceil(Ymin)), int(Ymax) + 1):
278-
for L in range(int(np.ceil(Zmin)), int(Zmax) + 1):
279-
if not sg.isAllowedReflection([h, k, L]):
279+
for l in range(int(np.ceil(Zmin)), int(Zmax) + 1):
280+
if not sg.isAllowedReflection([h, k, l]):
280281
mask[
281282
int((h - 0.5 - Xmin) / Xwidth + 1) : int((h + 0.5 - Xmin) / Xwidth),
282283
int((k - 0.5 - Ymin) / Ywidth + 1) : int((k + 0.5 - Ymin) / Ywidth),
283-
int((L - 0.5 - Zmin) / Zwidth + 1) : int((L + 0.5 - Zmin) / Zwidth),
284+
int((l - 0.5 - Zmin) / Zwidth + 1) : int((l + 0.5 - Zmin) / Zwidth),
284285
] = False
285286

286287
signal[mask] = np.nan

Framework/PythonInterface/plugins/algorithms/GSASIIRefineFitPeaks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# NScD Oak Ridge National Laboratory, European Spallation Source,
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
7+
# ruff: noqa: E741 # Ambiguous variable name
78
from contextlib import contextmanager
89
import numpy
910
import os
@@ -294,11 +295,11 @@ def _generate_pawley_reflections(self, phase):
294295
reflections = numpy.array(GSASIIlattice.GenHLaue(d_min, space_group, A))
295296

296297
peaks = []
297-
for h, k, L, d in reflections:
298-
forbidden_by_symmetry, multiplicity = GSASIIspc.GenHKLf([h, k, L], space_group)[:2]
298+
for h, k, l, d in reflections:
299+
forbidden_by_symmetry, multiplicity = GSASIIspc.GenHKLf([h, k, l], space_group)[:2]
299300
if not forbidden_by_symmetry:
300301
multiplicity *= 2
301-
peaks.append([h, k, L, multiplicity, d, True, 100.0, 1.0])
302+
peaks.append([h, k, l, multiplicity, d, True, 100.0, 1.0])
302303
GSASIImath.sortArray(peaks, 4, reverse=True)
303304
return peaks
304305

Framework/PythonInterface/plugins/algorithms/LinkedUBs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# NScD Oak Ridge National Laboratory, European Spallation Source,
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
7+
# ruff: noqa: E741 # Ambiguous variable name
78
from mantid.api import DataProcessorAlgorithm, mtd, AlgorithmFactory, WorkspaceProperty, PropertyMode, ITableWorkspaceProperty
89
from mantid.simpleapi import CalculateUMatrix, PredictPeaks, FilterPeaks, DeleteWorkspace, CreatePeaksWorkspace
910
from mantid.kernel import Direction, FloatBoundedValidator, IntBoundedValidator, StringMandatoryValidator, StringListValidator, V3D
@@ -324,8 +325,8 @@ def PyExec(self):
324325
and qz_pred - qtol_var <= qz_obs <= qz_pred + qtol_var
325326
and d_pred - self._dtol <= d_obs <= d_pred + self._dtol
326327
):
327-
h, k, L = HKL_ordered[j]
328-
p_obs.setHKL(h, k, L)
328+
h, k, l = HKL_ordered[j]
329+
p_obs.setHKL(h, k, l)
329330
p_obs.setIntHKL(p_obs.getHKL())
330331
linked_peaks.addPeak(p_obs)
331332

Framework/PythonInterface/plugins/algorithms/LoadFullprofFile.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
# pylint: disable=no-init,invalid-name
8+
# ruff: noqa: E741 # Ambiguous variable name
89
from mantid.api import (
910
PythonAlgorithm,
1011
AlgorithmFactory,
@@ -124,7 +125,7 @@ def _importFullprofHKLFile(self, hklfilename):
124125

125126
h = int(terms[0])
126127
k = int(terms[1])
127-
L = int(terms[2])
128+
l = int(terms[2])
128129
if len(terms) >= 9:
129130
dsp = float(terms[3])
130131
tof = float(terms[4])
@@ -146,17 +147,17 @@ def _importFullprofHKLFile(self, hklfilename):
146147
elif len(terms) >= 9:
147148
fwhm = math.sqrt(sigma2) * 2.0
148149

149-
dkey = (h, k, L)
150+
dkey = (h, k, l)
150151

151152
if dkey in hkldict:
152153
if _OUTPUTLEVEL == "INFORMATION":
153-
self.warning("Warning! Duplicate HKL %d, %d, %d" % (h, k, L))
154+
self.warning("Warning! Duplicate HKL %d, %d, %d" % (h, k, l))
154155
continue
155156

156157
if fwhm < 1.0e-5:
157158
# Peak width is too small/annihilated peak
158159
if _OUTPUTLEVEL == "INFORMATION":
159-
self.log().information("Peak (%d, %d, %d) has an unreasonable small FWHM. Peak does not exist. " % (h, k, L))
160+
self.log().information("Peak (%d, %d, %d) has an unreasonable small FWHM. Peak does not exist. " % (h, k, l))
160161
continue
161162

162163
hkldict[dkey] = {}

Framework/PythonInterface/plugins/algorithms/VelocityCrossCorrelations.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
# pylint: disable=too-many-branches,too-many-locals, invalid-name
8+
# ruff: noqa: E741 # Ambiguous variable name
89
from mantid.api import AlgorithmFactory, FileAction, FileProperty, PythonAlgorithm, WorkspaceProperty
910
from mantid.kernel import logger, Direction
1011
from mantid.simpleapi import CreateWorkspace
@@ -155,16 +156,16 @@ def PyExec(self):
155156
# Retrieve particle indices from the 'particles' dictionary and
156157
# determine the relevant position in the 'correlations' matrices
157158
k = elements.index(atoms_to_species[i])
158-
L = elements.index(atoms_to_species[j])
159+
l = elements.index(atoms_to_species[j])
159160
# Check for the order of elements (ensures upper triangular matrix form & consistent order of operations)
160-
if k <= L:
161+
if k <= l:
161162
correlation_temp = self.cross_correlation(velocities[i], velocities[j])
162-
correlations[k, L] += correlation_temp
163-
correlation_count[k, L] += 1
163+
correlations[k, l] += correlation_temp
164+
correlation_count[k, l] += 1
164165
else:
165166
correlation_temp = self.cross_correlation(velocities[j], velocities[i])
166-
correlations[L, k] += correlation_temp
167-
correlation_count[L, k] += 1
167+
correlations[l, k] += correlation_temp
168+
correlation_count[l, k] += 1
168169

169170
logger.information(str(time.time() - start_time) + " s")
170171

Testing/SystemTests/tests/framework/HB3AWorkflowTests.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
# pylint: disable=no-init,too-few-public-methods
8+
# ruff: noqa: E741 # Ambiguous variable name
89
import numpy as np
910
import systemtesting
1011
from mantid.simpleapi import (
@@ -306,23 +307,23 @@ def runTest(self):
306307

307308
for h in range(0, 6):
308309
for k in range(0, 6):
309-
for L in range(0, 11):
310-
if sg.isAllowedReflection([h, k, L]):
311-
if h == k == L == 0:
310+
for l in range(0, 11):
311+
if sg.isAllowedReflection([h, k, l]):
312+
if h == k == l == 0:
312313
continue
313-
q = V3D(h, k, L)
314+
q = V3D(h, k, l)
314315
q_sample = ol.qFromHKL(q)
315316
if not np.any(np.array(q_sample) > 5):
316317
hkl.append(q)
317318
FakeMDEventData(MD_Q_sample, PeakParams="1000,{},{},{},0.05".format(*q_sample))
318319
# satellite peaks at 0,0,+1.5
319-
q = V3D(h, k, L + 1.5)
320+
q = V3D(h, k, l + 1.5)
320321
q_sample = ol.qFromHKL(q)
321322
if not np.any(np.array(q_sample) > 5):
322323
sat_hkl.append(q)
323324
FakeMDEventData(MD_Q_sample, PeakParams="100,{},{},{},0.02".format(*q_sample))
324325
# satellite peaks at 0,0,-1.5
325-
q = V3D(h, k, L - 1.5)
326+
q = V3D(h, k, l - 1.5)
326327
q_sample = ol.qFromHKL(q)
327328
if not np.any(np.array(q_sample) > 5):
328329
sat_hkl.append(q)

qt/python/mantidqtinterfaces/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/gsas2/call_G2sc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# NScD Oak Ridge National Laboratory, European Spallation Source,
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
7+
# ruff: noqa: E741 # Ambiguous variable name
78
import os
89
import sys
910
import json
@@ -56,8 +57,8 @@ def add_pawley_reflections(pawley_reflections, project, d_min):
5657
phase.data["General"]["doPawley"] = True
5758
gsas_reflections = []
5859
for reflection in pawley_reflections[iphase]:
59-
[h, k, L], d, multiplicity = reflection
60-
gsas_reflections.append([int(h), int(k), int(L), int(multiplicity), float(d), True, 100.0, d_min])
60+
[h, k, l], d, multiplicity = reflection
61+
gsas_reflections.append([int(h), int(k), int(l), int(multiplicity), float(d), True, 100.0, d_min])
6162
phase.data["Pawley ref"] = gsas_reflections
6263

6364

0 commit comments

Comments
 (0)