Commit 961b3253 authored by Hackmet's avatar Hackmet

Bugfix in SQLExport

parent 1258436c
......@@ -176,7 +176,7 @@ class SQLExport(QtWidgets.QDialog):
currentParticleInd = self.getPartIndicesOfSample(self.sampleSelector.currentText())
currentAnalysisInd = self.getAnalyisIndicesOfMethod(self.methodIndices[self.methodSelector.currentIndex()])
sizeCategories = self.getColFromTable('Size_category', 'size_fraction')
sizeCategories = self.getEntireTable('size_fraction')[1]
for index, polymerType in enumerate(self.polymerTypes):
if self.polymerCheckboxes[index].isChecked():
......@@ -287,26 +287,16 @@ class SQLExport(QtWidgets.QDialog):
def getSizeFraction(self, sizeList, size):
def isNumber(string):
try:
float(string)
return True
except:
return False
size = np.round(size)
for i in sizeList:
if i.find('>') != -1: #i.e., string is >10000
return i
if i[1].find('>') != -1: #i.e., string is '>100000'
return i[1]
else:
limits= [float(s) for s in i.split() if isNumber(s)]
try:
upper = float(limits[1])
lower = float(limits[0])
except:
print('error processing limits {} from {} with size {}'.format(limits, i, size))
raise
if lower <= np.round(size) <= upper:
return i
limits = [i[2], i[3]]
upper = float(limits[1])
lower = float(limits[0])
if lower <= size <= upper:
return i[1]
def getDateString(self, QDateObject):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment