Skip to content

Commit

Permalink
More warnings. Refs #10945
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiSavici committed Jan 22, 2015
1 parent d00cf06 commit b4bac8f
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 52 deletions.
Expand Up @@ -163,13 +163,13 @@ def _createReflectionWorkspace(self, hkldict):

tablews.addColumn("int", "H")
tablews.addColumn("int", "K")
tablews.addColumn("int", "L");
tablews.addColumn("double", "Alpha");
tablews.addColumn("double", "Beta");
tablews.addColumn("double", "Sigma2");
tablews.addColumn("double", "Gamma");
tablews.addColumn("double", "FWHM");
tablews.addColumn("double", "PeakHeight");
tablews.addColumn("int", "L")
tablews.addColumn("double", "Alpha")
tablews.addColumn("double", "Beta")
tablews.addColumn("double", "Sigma2")
tablews.addColumn("double", "Gamma")
tablews.addColumn("double", "FWHM")
tablews.addColumn("double", "PeakHeight")

# 2. Add rows
for hkl in sorted(hkldict.keys()):
Expand Down
Expand Up @@ -228,7 +228,7 @@ def PyExec(self):

x_extents = self.__extents_in_current_projection(to_cut, 0)
y_extents = self.__extents_in_current_projection(to_cut, 1)
z_extents = self.__extents_in_current_projection(to_cut, 2);
z_extents = self.__extents_in_current_projection(to_cut, 2)

projection = self.__uvw_from_projection_table(projection_table)
target_units = self.__units_from_projection_table(projection_table)
Expand All @@ -242,7 +242,7 @@ def PyExec(self):
if not p4_bins_property.isDefault:
if (ndims == 4):
n_args = len(p4_bins)
min, max = self.__extents_in_current_projection(to_cut, 3);
min, max = self.__extents_in_current_projection(to_cut, 3)
d_range = max - min
if n_args == 1:
step_size = p4_bins[0]
Expand Down
Expand Up @@ -383,14 +383,14 @@ def weightedMean(self, data_array, error_array):
sz = len(data_array)

# calculate the numerator of mean
dataNum = 0;
dataNum = 0
for i in range(sz):
if not (data_array[i] == 0):
tmpFactor = float(data_array[i]) / float((pow(error_array[i],2)))
dataNum += tmpFactor

# calculate denominator
dataDen = 0;
dataDen = 0
for i in range(sz):
if not (error_array[i] == 0):
tmpFactor = 1./float((pow(error_array[i],2)))
Expand Down Expand Up @@ -444,7 +444,7 @@ def _average_y_of_same_x_(self):
for j in range(len(data_y_i)):

if data_y[j]>0 and data_y_i[j]>0:
[data_y[j], data_e[j]] = self.weightedMean([data_y[j], data_y_i[j]], [data_e[j], data_e_i[j]]);
[data_y[j], data_e[j]] = self.weightedMean([data_y[j], data_y_i[j]], [data_e[j], data_e_i[j]])
elif (data_y[j] == 0) and (data_y_i[j]>0):
data_y[j] = data_y_i[j]
data_e[j] = data_e_i[j]
Expand Down Expand Up @@ -1122,12 +1122,12 @@ def _plot_data_count_vs_tof_2d(self):
#mantidplot.app.connect(mantidplot.app.mantidUI, QtCore.SIGNAL("python_peak_back_tof_range_update(double,double,double,double,double,double)"), call_back)
#mantidplot.app.connect(mantidplot.app.RefDetectorViewer, QtCore.SIGNAL("python_peak_back_tof_range_update(double,double,double,double,double,double)"), call_back)

peak_min = int(self._summary.data_peak_from_pixel.text());
peak_max = int(self._summary.data_peak_to_pixel.text());
back_min = int(self._summary.data_background_from_pixel1.text());
back_max = int(self._summary.data_background_to_pixel1.text());
tof_min = int(self._summary.data_from_tof.text());
tof_max = int(self._summary.data_to_tof.text());
peak_min = int(self._summary.data_peak_from_pixel.text())
peak_max = int(self._summary.data_peak_to_pixel.text())
back_min = int(self._summary.data_background_from_pixel1.text())
back_max = int(self._summary.data_background_to_pixel1.text())
tof_min = int(self._summary.data_from_tof.text())
tof_max = int(self._summary.data_to_tof.text())

import mantidqtpython
self.ref_det_view = mantidqtpython.MantidQt.RefDetectorViewer.RefMatrixWSImageView(ws_output_base, peak_min, peak_max, back_min, back_max, tof_min, tof_max)
Expand Down
Expand Up @@ -964,12 +964,12 @@ def _plot_data_count_vs_tof_2d(self):
#mantidplot.app.connect(mantidplot.app.mantidUI, QtCore.SIGNAL("python_peak_back_tof_range_update(double,double,double,double,double,double)"), call_back)
#mantidplot.app.connect(mantidplot.app.RefDetectorViewer, QtCore.SIGNAL("python_peak_back_tof_range_update(double,double,double,double,double,double)"), call_back)

peak_min = int(self._summary.data_peak_from_pixel.text());
peak_max = int(self._summary.data_peak_to_pixel.text());
back_min = int(self._summary.data_background_from_pixel1.text());
back_max = int(self._summary.data_background_to_pixel1.text());
tof_min = int(self._summary.data_from_tof.text());
tof_max = int(self._summary.data_to_tof.text());
peak_min = int(self._summary.data_peak_from_pixel.text())
peak_max = int(self._summary.data_peak_to_pixel.text())
back_min = int(self._summary.data_background_from_pixel1.text())
back_max = int(self._summary.data_background_to_pixel1.text())
tof_min = int(self._summary.data_from_tof.text())
tof_max = int(self._summary.data_to_tof.text())

import mantidqtpython
self.ref_det_view = mantidqtpython.MantidQt.RefDetectorViewer.RefMatrixWSImageView(ws_output_base_ff+'_2D', peak_min, peak_max, back_min, back_max, tof_min, tof_max)
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/scripts/Interface/ui/reflectometer/refl_save.py
Expand Up @@ -17,7 +17,7 @@
class Ui_SaveWindow(object):
def __init__(self):

self.__has_mount_point = True;
self.__has_mount_point = True

self.__instrument = config['default.instrument'].strip().upper()

Expand All @@ -26,7 +26,7 @@ def __init__(self):
self.__mountpoint = usersettings.get_named_setting("DataMountPoint")
except KeyError:
print "DataMountPoint is missing from the config.xml file."
self.__has_mount_point = False;
self.__has_mount_point = False

def setupUi(self, SaveWindow):
self.SavePath=""
Expand Down
18 changes: 9 additions & 9 deletions Code/Mantid/scripts/PyChop/fluxGUI.py
Expand Up @@ -29,7 +29,7 @@ def __init__(self, parent=None):
QtCore.QObject.connect(self.ui.actionMAPS,QtCore.SIGNAL("triggered()"), lambda : self.otherInstrumentSelected('MAP'))


self.graph=None;
self.graph=None

self.loadData()

Expand All @@ -56,7 +56,7 @@ def loadData(self):
self.res_energies = array.array( 'f', [0.2, 0.4, 0.6, 0.8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] )
self.frequencies = np.arange(30,310,10)

self.ei="";
self.ei=""
self.ei_min = 0.2 # max(min(self.flux_energies),min(self.res_energies))
self.ei_max = 40. #min(max(self.flux_energies),max(self.res_energies))

Expand Down Expand Up @@ -133,7 +133,7 @@ def calculate(self):
self.ei = float (self.ei)

if self.ei< self.ei_min or self.ei > self.ei_max:
self.ei="";
self.ei=""
QtGui.QMessageBox.warning(self, "LETFlux", "Energy out of range.\n Please, Provide value between "+str(self.ei_min)+" and "+str(self.ei_max)+" meV \n")
else:
self.setUpTable()
Expand All @@ -142,7 +142,7 @@ def calculate(self):
self.ui.list.insertItem(0,string)
string_title = 'Frequency(Hz) Flux(n/s/cm^2) Resolution[ueV]'
self.ui.list.insertItem(1,string_title)
t=self.t;
t=self.t
for i in xrange(0, len(self.frequencies)):
string1 = str(self.frequencies[i])+' '+ "%e" % t.cell(2,i+1)+' '+ "%e"% t.cell(3,i+1)
self.ui.list.insertItem(2+i,string1)
Expand Down Expand Up @@ -171,15 +171,15 @@ def plotData(self):

self.graph = newGraph("Flux and Resolution",2,1,2)

l1 = self.graph.layer(1);
l1 = self.graph.layer(1)
l1.setAntialiasing()
l1.setTitle("Flux")
l1.setAxisTitle(Layer.Bottom, "Frequency [Hz]")
l1.setAxisTitle(Layer.Left, "Flux [n/s/cm^2]")
l1.showGrid()
# self.graphFlux.insertCurve(self.t, "Flux/Frequency_2", Layer.Scatter)
# legend = self.graphFlux.newLegend(str(self.ei))
l2 = self.graph.layer(2);
l2 = self.graph.layer(2)
l2.setAntialiasing()
l2.setTitle("Resolution")
l2.setAxisTitle(Layer.Bottom, "Frequency [Hz]")
Expand All @@ -188,9 +188,9 @@ def plotData(self):
# self.graphRes.insertCurve(self.t, "Resolution/Frequency_2", Layer.Scatter)
l2.showGrid()

self.addPlot();
self.addPlot()

self.raise_();
self.raise_()
self.show()

return self
Expand All @@ -199,7 +199,7 @@ def addPlot(self):
""" Adds plot to an existing graph
"""
if self.graph==None:
self.plotData();
self.plotData()
else:
self.calculate()
if self.ei == "":
Expand Down
Expand Up @@ -264,8 +264,8 @@ def removeoutlayer(wksp):
for j in range(len(x)-1):
y=a1.readY(i)[j]
if (y<2):
a1.dataY(i)[j]=0.0;
a1.dataE(i)[j]=0.0;
a1.dataY(i)[j]=0.0
a1.dataE(i)[j]=0.0

def nrSESANSFn(runList,nameList,P0runList,P0nameList,minSpec,maxSpec,upPeriod,downPeriod,existingP0,SEConstants,gparams,convertToSEL,lnPOverLam,diagnostics="0",removeoutlayer="0",floodfile="none",):
nlist=parseNameList(nameList)
Expand Down
Expand Up @@ -420,7 +420,7 @@ def convertWorkspaceToQ(ws_data,
a = y_range[y]

_tmp_y_axis = mt1.readY(int(a))[:]
_y_axis[int(y), :] = _tmp_y_axis;
_y_axis[int(y), :] = _tmp_y_axis
_tmp_y_error_axis = mt1.readE(int(a))[:]
_y_error_axis[int(y),:] = _tmp_y_error_axis

Expand Down Expand Up @@ -486,19 +486,19 @@ def angleUnitConversion(value, from_units='degree', to_units='rad'):
"""

if (from_units == to_units):
return value;
return value

from_factor = 1;
from_factor = 1
#convert everything into rad
if (from_units == 'degree'):
from_factor = 1.745329252e-2;
value_rad = from_factor * value;
from_factor = 1.745329252e-2
value_rad = from_factor * value

if (to_units == 'rad'):
return value_rad;
return value_rad
else:
to_factor = 57.2957795;
return to_factor * value_rad;
to_factor = 57.2957795
return to_factor * value_rad

def convertToThetaVsLambda(_tof_axis,
_pixel_axis,
Expand Down Expand Up @@ -980,7 +980,7 @@ def rebinNeXus(inputWorkspace, params, type):
print '--> rebin ', type
ws_histo_data = Rebin(InputWorkspace=inputWorkspace,
Params=params,
PreserveEvents=True);
PreserveEvents=True)
return ws_histo_data

def cropTOF(inputWorkspace, min, max, type):
Expand Down Expand Up @@ -1145,7 +1145,7 @@ def weightedMean(data_array, error_array, error_0):
sz = len(data_array)

# calculate the numerator of mean
dataNum = 0;
dataNum = 0
for i in range(sz):
if (error_array[i] == 0):
error_array[i] = error_0
Expand All @@ -1154,7 +1154,7 @@ def weightedMean(data_array, error_array, error_0):
dataNum += tmpFactor

# calculate denominator
dataDen = 0;
dataDen = 0
for i in range(sz):
if (error_array[i] == 0):
error_array[i] = error_0
Expand Down Expand Up @@ -1309,7 +1309,7 @@ def ouput_ascii_file(file_name,

sz_x_axis = len(x_axis)
for i in range(sz_x_axis-1):
f.write(str(x_axis[i]) + "," + str(y_axis[i]) + "," + str(y_error_axis[i]) + "\n");
f.write(str(x_axis[i]) + "," + str(y_axis[i]) + "," + str(y_error_axis[i]) + "\n")

f.close

Expand Down Expand Up @@ -1925,8 +1925,8 @@ def cropAxisToOnlyNonzeroElements(q_rebin, dataPeakRange):
x_axis = q_rebin.readX(0)[:]
sz = x_axis.shape[0]-1

index_first_non_zero_value = sz;
index_last_non_zero_value = 0;
index_first_non_zero_value = sz
index_last_non_zero_value = 0

for x in range(nbrPixel):
_pixel_axis = q_rebin.readY(x)[:]
Expand Down Expand Up @@ -2011,7 +2011,7 @@ def cleanupData1D(final_data_y_axis, final_data_y_error_axis):
sz = final_data_y_axis.shape
nbrTof = sz[0]

notYetRemoved = True;
notYetRemoved = True

for t in range(nbrTof):

Expand Down

0 comments on commit b4bac8f

Please sign in to comment.