Skip to content

Commit f10fbf3

Browse files
Fix typos from code review
1 parent 68abc66 commit f10fbf3

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/mvesuvio/analysis_reduction.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _initialize_table_fit_parameters(self):
185185
table.addColumn(type="float", name=f"{key} Width")
186186
table.addColumn(type="float", name=f"{key} Center ")
187187
table.addColumn(type="float", name="Normalised Chi2")
188-
table.addColumn(type="float", name="Number of Iteraions")
188+
table.addColumn(type="float", name="Number of Iterations")
189189
return table
190190

191191

@@ -235,7 +235,7 @@ def _set_up_kinematic_arrays(self):
235235

236236
def run(self):
237237

238-
assert len(self.profiles) > 0, "Add profiles before atempting to run the routine!"
238+
assert len(self.profiles) > 0, "Add profiles before attempting to run the routine!"
239239

240240
self._create_table_initial_parameters()
241241

@@ -318,7 +318,7 @@ def _fit_neutron_compton_profiles(self):
318318
Performs the fit of neutron compton profiles to the workspace being fit.
319319
The profiles are fit on a spectrum by spectrum basis.
320320
"""
321-
print("\nFitting Neutron Compron Prolfiles:\n")
321+
print("\nFitting Neutron Compton Prolfiles:\n")
322322

323323
self._row_being_fit = 0
324324
while self._row_being_fit != len(self._dataY):
@@ -402,7 +402,7 @@ def calculateKinematicsArrays(self, instrPars):
402402

403403

404404
def convertDataXToYSpacesForEachMass(self, dataX, delta_Q, delta_E):
405-
"Calculates y spaces from TOF data, each row corresponds to one mass"
405+
""""Calculates y spaces from TOF data, each row corresponds to one mass"""
406406

407407
# Prepare arrays to broadcast
408408
dataX = dataX[np.newaxis, :, :]
@@ -570,10 +570,10 @@ def filterWidthsAndIntensities(self, widthsIn, intensitiesIn):
570570
assert not (np.all(np.isnan(betterIntensities))), "All filtered intensities are nan"
571571
assert np.nanmax(betterWidths) != np.nanmin(
572572
betterWidths
573-
), f"All fitered widths have the same value: {np.nanmin(betterWidths)}"
573+
), f"All filtered widths have the same value: {np.nanmin(betterWidths)}"
574574
assert np.nanmax(betterIntensities) != np.nanmin(
575575
betterIntensities
576-
), f"All fitered widths have the same value: {np.nanmin(betterIntensities)}"
576+
), f"All filtered intensities have the same value: {np.nanmin(betterIntensities)}"
577577

578578
return betterWidths, betterIntensities
579579

@@ -644,7 +644,7 @@ def errorFunction(self, pars):
644644

645645
def _neutron_compton_profiles(self, pars):
646646
"""
647-
Neutron Compron Profile distribution on TOF space for a single spectrum.
647+
Neutron Compton Profile distribution on TOF space for a single spectrum.
648648
Calculated from kinematics, J(y) and resolution functions.
649649
"""
650650

@@ -836,7 +836,7 @@ def _replace_zero_columns_with_ncp_fit(self):
836836
OutputWorkspace=self._workspace_for_corrections.name() + "_CorrectionsInput"
837837
)
838838
for row in range(self._workspace_for_corrections.getNumberHistograms()):
839-
# TODO: Once the option to chage point to hist is removed, remove [:len(ncp)]
839+
# TODO: Once the option to change point to hist is removed, remove [:len(ncp)]
840840
self._workspace_for_corrections.dataY(row)[self._zero_columns_boolean_mask] = ncp[row, self._zero_columns_boolean_mask[:len(ncp[row])]]
841841

842842
SumSpectra(
@@ -919,7 +919,7 @@ def createSlabGeometry(self, wsNCPM):
919919
def calcMSCorrectionSampleProperties(self, meanWidths, meanIntensityRatios):
920920
masses = [p.mass for p in self._profiles.values()]
921921

922-
# If Backsscattering mode and H is present in the sample, add H to MS properties
922+
# If Backscattering mode and H is present in the sample, add H to MS properties
923923
if self._mode_running == "BACKWARD":
924924
if self._h_ratio is not None: # If H is present, ratio is a number
925925
masses = np.append(masses, 1.0079)

src/mvesuvio/util/analysis_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def maskBinsWithZeros(ws, maskTOFRange):
108108

109109

110110
def extractWS(ws):
111-
"""Directly exctracts data from workspace into arrays"""
111+
"""Directly extracts data from workspace into arrays"""
112112
return ws.extractX(), ws.extractY(), ws.extractE()
113113

114114

@@ -123,7 +123,7 @@ def histToPointData(dataY, dataX, dataE):
123123
histWidths = dataX[:, 1:] - dataX[:, :-1]
124124
assert np.min(histWidths) == np.max(
125125
histWidths
126-
), "Histogram widhts need to be the same length"
126+
), "Histogram widths need to be the same length"
127127

128128
dataYp = dataY[:, :-1]
129129
dataEp = dataE[:, :-1]

src/mvesuvio/util/process_inputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def completeICFromInputs(IC, wsIC):
8282
IC.normVoigt = True
8383

8484
#Create default for H ratio
85-
# Only for completeness sake, will be removed anyway
85+
# Only for completeness' sake, will be removed anyway
8686
# when transition to new interface is complete
8787
try:
8888
IC.HToMassIdxRatio

0 commit comments

Comments
 (0)