Commit f10cd910 authored by Yan's avatar Yan
Browse files

Pep8 fix, more fixes after uniting of spect vars

* spectrum variables were implemented into update_spectrum
* flake8 check of the whole project
parent c960cedf
#!/usr/bin/env python3
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import\
FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
from matplotlib.widgets import SpanSelector
from matplotlib.gridspec import GridSpec
from PyQt5 import QtCore
from PyQt5 import QtWidgets
from PyQt5 import QtGui
......@@ -14,7 +14,7 @@ from prasopes.predictmz import predict as getmzpattern
try:
from rawautoparams import load_params
autoparams = True
except:
except ImportError:
autoparams = False
import numpy as np
import prasopes.config as cf
......@@ -50,37 +50,40 @@ class QStatusBarLogger(logging.Handler):
class AugFigureCanvas(FigureCanvas):
#TODO: move the widget into graphtools when I'm done
# TODO: move the widget into graphtools when I'm done
def __init__(self):
self.figure = Figure(figsize=(5, 4), dpi=100, facecolor="None",
constrained_layout=True)
constrained_layout=True)
super().__init__(self.figure)
self.ds = []
self.ms = dict(annotation=[], name="Spectrum", xlabel="m/z",
ylabel="ion count", xtics=20, predict=None,
params=[], headers=[], texts=[])
self.chrom = dict(x=[0], y=[0], t_start=None, t_end=None, machtype=None,
name="Chromatogram", xlabel="time(min)",
ylabel="total ion count", timesarg=[])
self.chrom = dict(
x=[0], y=[0], t_start=None, t_end=None, machtype=None,
name="Chromatogram", xlabel="time(min)", ylabel="total ion count",
timesarg=[])
self.filename = None
self.drlcache = [None, None]
grid = self.figure.add_gridspec(2, 1)
self.chromplot = self.figure.add_subplot(grid[0,0], facecolor=(1, 1, 1, 0.8))
self.spectplot = self.figure.add_subplot(grid[1,0], facecolor=(1, 1, 1, 0.8))
self.chromplot = self.figure.add_subplot(grid[0, 0],
facecolor=(1, 1, 1, 0.8))
self.spectplot = self.figure.add_subplot(grid[1, 0],
facecolor=(1, 1, 1, 0.8))
self.setStyleSheet("background-color:transparent;")
self.setAutoFillBackground(False)
self.paramstable = dt.table(["","name","value"], 100)
self.paramstable = dt.table(["", "name", "value"], 100)
gt.pan_factory(self.chromplot)
gt.zoom_factory(self.chromplot, 1.15)
gt.pan_factory(self.spectplot, self.ms)
gt.zoom_factory(self.spectplot, 1.15, self.ms)
gt.textedit_factory(self.spectplot, self.ms)
self.mass_selector = gt.AugSpanSelector(self.spectplot, self.ms)
#TODO: rewrite timeSelector to better shape when I'm done
self.time_selector = SpanSelector(self.chromplot, lambda x_min, x_max:
gt.pick_times(x_min, x_max, self), 'horizontal',
useblit=True, rectprops=dict(alpha=0.15, facecolor='purple'),
button=3)
# TODO: rewrite timeSelector to better shape when I'm done
self.time_selector = SpanSelector(
self.chromplot, lambda x_min, x_max: gt.pick_times(
x_min, x_max, self), 'horizontal', useblit=True,
rectprops=dict(alpha=0.15, facecolor='purple'), button=3)
def load_file(parent, augCanvas, update, settings, loadthread, filename=None):
......@@ -89,18 +92,19 @@ def load_file(parent, augCanvas, update, settings, loadthread, filename=None):
filename = filename or QtWidgets.QFileDialog.getOpenFileName(
caption="Open spectrum", directory=directory,
filter="Finnigan RAW files (*.raw, *.RAW)")[0]
if filename is not '' and os.path.isfile(filename)\
and not os.path.isdir(filename):
if filename != '' and os.path.isfile(filename)\
and not os.path.isdir(filename):
error = update_signal()
errormsg = []
def runfnc():
try:
[i.clear() for i in (
augCanvas.ds, augCanvas.chrom['timesarg'],
augCanvas.ms['params'],augCanvas.ms['headers'])]
augCanvas.ds, augCanvas.chrom['timesarg'],
augCanvas.ms['params'], augCanvas.ms['headers'])]
[augCanvas.ds.append(dict(
chrom_dat=i[0], masses=i[1], matrix=i[2]))
for i in load_raw(filename, settings.value("tmp_location"))]
for i in load_raw(filename, settings.value("tmp_location"))]
except rawprasslib.ParsingException as pex:
errormsg.append("Opening of the file has failed!")
errormsg.append(
......@@ -109,14 +113,14 @@ def load_file(parent, augCanvas, update, settings, loadthread, filename=None):
"Error message:\n{}".format(pex.args[0]))
error.signal.emit()
return
if autoparams == True:
if autoparams:
try:
(augCanvas.ms['params'], rawheaders
, augCanvas.chrom['machtype']) = load_params(filename)
(augCanvas.ms['params'], rawheaders,
augCanvas.chrom['machtype']) = load_params(filename)
segments = [len(subset['chrom_dat'][0])
for subset in augCanvas.ds]
for subset in augCanvas.ds]
indicies = [sum(segments[:i+1])
for i in range(len(segments))]
for i in range(len(segments))]
augCanvas.ms['headers'] = np.split(
rawheaders, indicies)[:-1]
except Exception as pex:
......@@ -131,13 +135,13 @@ def load_file(parent, augCanvas, update, settings, loadthread, filename=None):
parent.setWindowTitle("Prasopes - {}".format(
os.path.basename(filename)))
update.signal.emit()
error.signal.connect(lambda:
QtWidgets.QMessageBox.critical(parent, errormsg[0], errormsg[1]))
error.signal.connect(lambda: QtWidgets.QMessageBox.critical(
parent, errormsg[0], errormsg[1]))
loadthread.run = runfnc
loadthread.start()
def print_graph(data_set, mass_spec, chrom_spec, spect, fn, table):
def print_graph(augCanvas):
def printimage(printdevice, img):
printer.setResolution(600)
painter = QtGui.QPainter(printdevice)
......@@ -145,70 +149,71 @@ def print_graph(data_set, mass_spec, chrom_spec, spect, fn, table):
linesize = printer.resolution()/15
font.setPixelSize(linesize)
painter.setFont(font)
painter.drawImage(0,0,img)
painter.drawImage(0, 0, img)
offset = img.size().height()
line = 1
spacing = 1.5
for row in range(table.rowCount()):
if table.cellWidget(row,0).checkState() == 2:
text = table.item(row,1).text() + table.item(row,2).text()
painter.drawText(300,int(offset+line*linesize*spacing), text)
for row in range(augCanvas.paramstable.rowCount()):
if augCanvas.paramstable.cellWidget(row, 0).checkState() == 2:
text = augCanvas.paramstable.item(row, 1).text() +\
augCanvas.paramstable.item(row, 2).text()
painter.drawText(300, int(offset+line*linesize*spacing), text)
line += 1
painter.end()
#TODO: substitute the QPrintPreviewDialog with QPrintPreviewWidget
# TODO: substitute the QPrintPreviewDialog with QPrintPreviewWidget
printPreview = QtPrintSupport.QPrintPreviewDialog()
printer = printPreview.printer()
printer.setPageSize(printer.A5)
printer.setDuplex(printer.DuplexNone)
image = imgt.paint_image(mass_spec, spect, printer)
image = imgt.paint_image(augCanvas.ms, augCanvas.spectplot,
augCanvas.filename, printer)
printPreview.paintRequested.connect(lambda:
printimage(printer, image))
printPreview.exec()
def update_spectrum(chromatogram, spect, ds, ms, fn, chrom, config):
if fn[0] is not None:
slims = [spect.get_xlim(), spect.get_ylim()]
ds.clear()
[ds.append(dict(chrom_dat=i[0], masses=i[1], matrix=i[2])) for i
in load_raw(fn[0], config.value("tmp_location"))]
gt.populate(chromatogram, spect, ds, ms, chrom)
spect.set_xlim(slims[0])
spect.set_ylim(slims[1])
gt.ann_spec(spect, ms)
spect.get_figure().canvas.draw()
def update_spectrum(augCanvas, config):
if augCanvas.filename:
slims = [augCanvas.spectplot.get_xlim(),
augCanvas.spectplot.get_ylim()]
augCanvas.ds.clear()
[augCanvas.ds.append(dict(chrom_dat=i[0], masses=i[1], matrix=i[2]))
for i in load_raw(augCanvas.filename, config.value("tmp_location"))]
gt.populate(augCanvas)
augCanvas.spectplot.set_xlim(slims[0])
augCanvas.spectplot.set_ylim(slims[1])
gt.ann_spec(augCanvas.spectplot, augCanvas.ms)
augCanvas.draw()
def dropped(event, parent, chromatogram, spectrum, ds, ms, filename,
chrom, update, config, loadthread):
def dropped(event, parent, augCanvas, update, config, loadthread):
dropurl = event.mimeData().urls()[0].toLocalFile()
load_file(parent, chromatogram, spectrum, ds, ms, filename,
chrom, update, config, loadthread, filename=dropurl)
load_file(parent, augCanvas, update, config, loadthread, filename=dropurl)
def drag_entered(event):
if event.mimeData().hasUrls() and event.mimeData().urls()[0]\
.toLocalFile().lower().endswith('.raw'):
.toLocalFile().lower().endswith('.raw'):
event.accept()
def predictmz(form, chromatogram, spect, ds, ms, chrom):
def predictmz(form, augCanvas):
text = form.text()
if text == "":
ms["predict"] = None
augCanvas.ms["predict"] = None
return
slims = [spect.get_xlim(), spect.get_ylim()]
ms["predict"] = getmzpattern(text)
gt.populate(chromatogram, spect, ds, ms, chrom)
spect.set_xlim(slims[0])
spect.set_ylim(slims[1])
spect.get_figure().canvas.draw()
slims = [augCanvas.spectplot.get_xlim(),
augCanvas.spectplot.get_ylim()]
augCanvas.ms["predict"] = getmzpattern(text)
gt.populate(augCanvas)
augCanvas.spectplot.set_xlim(slims[0])
augCanvas.spectplot.set_ylim(slims[1])
augCanvas.draw()
def oddeven_changed(chromatogram, spectrum, ds, ms, filename, chrom, config,
oddevenact):
def oddeven_changed(augCanvas, config, oddevenact):
config.setValue("view/oddeven", oddevenact.isChecked())
update_spectrum(chromatogram, spectrum, ds, ms, filename, chrom, config)
update_spectrum(augCanvas, config)
def key_pressed(event, augCanvas, config):
......@@ -221,8 +226,8 @@ def key_pressed(event, augCanvas, config):
else:
imgt.clip_spect_img(augCanvas.ms, augCanvas.spectplot,
augCanvas.filename)
if event.modifiers().__int__() == QtCore.Qt.ControlModifier+\
QtCore.Qt.ShiftModifier:
if event.modifiers().__int__() == QtCore.Qt.ControlModifier + \
QtCore.Qt.ShiftModifier:
dt.clip_spectstr(augCanvas)
if event.key() in (QtCore.Qt.Key_Left, QtCore.Qt.Key_Right):
gt.shift_times(event, augCanvas)
......@@ -246,22 +251,22 @@ def main():
config = cf.settings()
barHandler = QStatusBarLogger()
barHandler.trigger.signal.connect(lambda:
barHandler.statusBar.showMessage(barHandler.msg))
barHandler.trigger.signal.connect(
lambda: barHandler.statusBar.showMessage(barHandler.msg))
p_logger = logging.getLogger('parseLogger')
params_logger = logging.getLogger('acqLogLogger')
drl_logger = logging.getLogger('drlLogger')
zce_logger = logging.getLogger('zceLogger')
#mpl_logger = logging.getLogger('matplotlib')
#mpl_logger.setLevel("DEBUG")
# mpl_logger = logging.getLogger('matplotlib')
# mpl_logger.setLevel("DEBUG")
logging.basicConfig()
#p_logger.setLevel("WARN")
#p_logger.setLevel("DEBUG")
#drl_logger.setLevel("INFO")
# p_logger.setLevel("WARN")
# p_logger.setLevel("DEBUG")
# drl_logger.setLevel("INFO")
drl_logger.setLevel("DEBUG")
zce_logger.setLevel("DEBUG")
#params_logger.setLevel("DEBUG")
# params_logger.setLevel("DEBUG")
p_logger.addHandler(barHandler)
zce_logger.addHandler(barHandler)
params_logger.addHandler(barHandler)
......@@ -269,16 +274,16 @@ def main():
main_window = QtWidgets.QMainWindow(windowTitle="Prasopes")
if QtGui.QIcon.themeName() is "":
if QtGui.QIcon.themeName() == "":
QtGui.QIcon.setThemeName("TangoMFK")
consoledock = docks.consoleDockWidget(
locals(), "&Console", "view/consolevisible")
treedock = docks.treeDockWidget(
"&File browser", "view/filebrowservisible", update, load_file, main_window,
augCanvas, config, loadthread)
"&File browser", "view/filebrowservisible", update, load_file,
main_window, augCanvas, config, loadthread)
paramsdock = docks.augDock("Acquisition parameters", "&Acq parameters",
"view/acqparvisible")
"view/acqparvisible")
update.signal.connect(lambda: gt.update_paramstable(augCanvas))
paramsdock.setWidget(augCanvas.paramstable)
......@@ -321,18 +326,19 @@ def main():
autozoomy.triggered.connect(lambda: config.setValue(
"view/autozoomy", autozoomy.isChecked()))
autozoomy.triggered.connect(lambda: gt.autozoomy(augCanvas.spectrum))
intensitiesact = QtWidgets.QAction("&Show intensities", None,
checkable=True, checked=config.value("view/intensities",
type=bool))
intensitiesact = QtWidgets.QAction(
"&Show intensities", None, checkable=True, checked=config.value(
"view/intensities", type=bool))
intensitiesact.triggered.connect(lambda: config.setValue(
"view/intensities", intensitiesact.isChecked()))
intensitiesact.triggered.connect(lambda: gt.ann_spec(
augCanvas.spectplot, augCanvas.ms))
intensitiesact.triggered.connect(lambda: augCanvas.draw())
oddevenact = QtWidgets.QAction("&Odd / even", None, checkable=True,
checked=config.value("view/oddeven", type=bool))
oddevenact.triggered.connect(lambda:
oddeven_changed(augCanvas, config, oddevenact))
oddevenact = QtWidgets.QAction(
"&Odd / even", None, checkable=True, checked=config.value(
"view/oddeven", type=bool))
oddevenact.triggered.connect(
lambda: oddeven_changed(augCanvas, config, oddevenact))
predictform = QtWidgets.QLineEdit(maximumWidth=150)
predictform.editingFinished.connect(lambda: predictmz(
......@@ -354,7 +360,8 @@ def main():
tools_menu.addAction(drlact)
tools_menu.addSeparator()
view_menu = QtWidgets.QMenu('&View', main_window)
[view_menu.addAction(i.action) for i in (treedock, paramsdock, consoledock)]
[view_menu.addAction(i.action) for i in
(treedock, paramsdock, consoledock)]
[view_menu.addAction(i) for i in (autozoomy, intensitiesact)]
view_menu.addSeparator()
view_menu.addAction(oddevenact)
......@@ -384,7 +391,7 @@ def main():
main_window.dragEnterEvent = lambda event: drag_entered(event)
main_window.dropEvent = lambda event: dropped(
event, main_window, augCanvas, update, config)
event, main_window, augCanvas, update, config, loadthread)
main_window.setAcceptDrops(True)
main_window.keyPressEvent = lambda event: key_pressed(
event, augCanvas, config)
......
......@@ -2,11 +2,10 @@
from PyQt5 import QtCore
from PyQt5 import QtWidgets
from PyQt5 import QtGui
from PyQt5 import QtPrintSupport
def settings():
settings = QtCore.QSettings("Yansoft","Prasopes")
settings = QtCore.QSettings("Yansoft", "Prasopes")
defvals = {("view/autozoomy", True),
("view/filebrowservisible", True),
("view/consolevisible", True),
......@@ -21,13 +20,14 @@ def settings():
("imggen/yinch", 4),
("imggen/dpi", 300),
("imggen/xtics", 5)}
[settings.setValue(i[0], i[1]) for i in defvals if settings.value(i[0]) == None]
[settings.setValue(i[0], i[1])
for i in defvals if not settings.value(i[0])]
return settings
def pathsearch(text, value, config):
filename = QtWidgets.QFileDialog.getExistingDirectory()
if filename is not '':
if filename != '':
text.setText(filename)
config.setValue(value, filename)
......@@ -53,7 +53,7 @@ def posvarconf(label, value, config, num="int"):
textfield.editingFinished.connect(lambda: config.setValue(
value, textfield.text()))
validator = QtGui.QIntValidator() if num == "int"\
else QtGui.QDoubleValidator()
else QtGui.QDoubleValidator()
validator.setBottom(0)
textfield.setValidator(validator)
layout = QtWidgets.QHBoxLayout()
......@@ -67,7 +67,7 @@ def dial(parent):
"""constructs a dialog window"""
dialog = QtWidgets.QDialog(
parent, windowTitle='Settings')
dialog.resize(600,-1)
dialog.resize(600, -1)
config = settings()
......
......@@ -27,8 +27,9 @@ def specttostr(augCanvas, delim=" "):
strdata = []
for i in range(np.max([len(line.get_xdata()) for line in lines])):
pairs = [("{}"+delim+"{}").format(line.get_xdata()[i], line.get_ydata()[i]) if\
i < len(line.get_xdata()) else delim for line in lines]
pairs = [("{}"+delim+"{}").format(
line.get_xdata()[i], line.get_ydata()[i]) if
i < len(line.get_xdata()) else delim for line in lines]
strline = delim.join(pairs)+"\n"
strdata.append(strline)
strdata = "".join(strdata)
......@@ -37,7 +38,7 @@ def specttostr(augCanvas, delim=" "):
def clip_spectstr(augCanvas):
string = specttostr(augCanvas, delim="\t")
QApplication.clipboard().clear()
QtWidgets.QApplication.clipboard().clear()
[QtWidgets.QApplication.clipboard().setText(string, i) for i in range(2)]
......@@ -47,7 +48,7 @@ def clip_tablestr(augCanvas):
for row in range(augCanvas.paramstable.rowCount())
if augCanvas.paramstable.cellWidget(row, 0).checkState()]
text = ", ".join(pairs)
QApplication.clipboard().clear()
QtWidgets.QApplication.clipboard().clear()
[QtWidgets.QApplication.clipboard().setText(text, i) for i in range(2)]
......
......@@ -5,7 +5,6 @@ from code import InteractiveConsole
from io import StringIO
from os import path
import contextlib
import numpy as np
import prasopes.config as cf
......@@ -19,11 +18,13 @@ class augDock(QtWidgets.QDockWidget):
self.action = QtWidgets.QAction(
actionname, None, checkable=True,
checked=config.value(cfval, type=bool))
self.action.triggered.connect(lambda: self.show() if\
self.action.isChecked() == True else self.hide())
self.action.triggered.connect(
lambda: self.show() if self.action.isChecked()
else self.hide())
self.closeEvent = lambda event: self.closeOverride(event)
if not config.value(cfval, type=bool):
self.hide()
def closeOverride(self, event):
self.action.setChecked(False)
self.hide()
......@@ -42,8 +43,9 @@ def consoleDockWidget(localvars, actionname, cfval):
outtext = stream.getvalue()
if outtext == "":
with contextlib.redirect_stderr(StringIO()):
#If anybody knows better sanitization feel free to let me know
console.runcode("""print(eval('{}'.format(str('"""+text+"""'))))""")
# Brief sanitization
console.runcode("""print(eval('{}'.format(str('""" +
text + """'))))""")
outtext = stream.getvalue()
if outtext != "":
outp.append(outtext[:-1])
......@@ -71,9 +73,15 @@ def treeDockWidget(actionname, cfval, update, loadfnc, parent,
dirview.setModel(fileModel)
dock = augDock("Folder View", actionname, cfval)
[dock.layout.addWidget(i) for i in (treeview, dirview)]
def scrolltoonce():
fileModel.layoutChanged.disconnect(scrolltoonce)
treeview.scrollTo(fileModel.index(config.value("open_folder")), 1)
def clickload(index):
loadfnc(parent, augCanvas, update, config, loadthread,
filename=fileModel.filePath(index))
fileModel.directoryLoaded.connect(
lambda: treeview.resizeColumnToContents(0))
update.signal.connect(lambda: treeview.setCurrentIndex(fileModel.index(
......@@ -81,8 +89,7 @@ def treeDockWidget(actionname, cfval, update, loadfnc, parent,
update.signal.connect(lambda: dirview.setRootIndex(fileModel.index(
path.dirname(path.realpath(augCanvas.filename)))))
fileModel.layoutChanged.connect(scrolltoonce)
clickload = lambda index: loadfnc(parent, augCanvas, update, config,
loadthread, filename=fileModel.filePath(index))
for i in [treeview.doubleClicked, dirview.doubleClicked, dirview.clicked]:
i.connect(clickload)
return dock
#!/usr/bin/env python3
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import\
FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
from PyQt5 import QtCore
from PyQt5 import QtWidgets
......@@ -25,22 +26,20 @@ class StretchWidget(QtWidgets.QWidget):
def __init__(self):
super(StretchWidget, self).__init__()
self._main = QtWidgets.QWidget()
self.setSizePolicy(QtWidgets.QSizePolicy.Expanding
,QtWidgets.QSizePolicy.Preferred)
self.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
QtWidgets.QSizePolicy.Preferred)
def floatize(table, row, column, nonneg=True):
"""grabs the tableWidgetItem and transforms its text safely to
float, if the text is not acceptable as float, returns zero"""
imptext = table.item(row, column).text().replace(",",".")
imptext = table.item(row, column).text().replace(",", ".")
validator = QtGui.QDoubleValidator()
if nonneg == True:
if nonneg:
validator.setBottom(0)
status = validator.validate(imptext, 0)[0]
if status == QtGui.QValidator.Acceptable:
outfloat = float(imptext)
else:
outfloat = 0
outfloat = float(imptext) if status == QtGui.QValidator.Acceptable\
else 0
return outfloat
......@@ -60,27 +59,27 @@ def update_profile(pt, row, dataset):
spectrum = pt.cellWidget(row, 3).figure.get_axes()[0]
spectrum.clear()
limits = []
for i,subset in enumerate(dataset):
for i, subset in enumerate(dataset):
masses = subset['masses']
massargs = get_massargs(pt, row, subset)
yshape = np.mean(subset['matrix'], axis=0)
spectrum.plot(masses, yshape, ':', color='gray')
spectrum.plot(masses[massargs], yshape[massargs], color=
gt.colors[i % len(gt.colors)]/255)
limits.append((masses[massargs[[0,-1]]],max(yshape[massargs])))
spectrum.plot(masses[massargs], yshape[massargs], color=gt.colors[
i % len(gt.colors)]/255)
limits.append((masses[massargs[[0, -1]]], max(yshape[massargs])))
widest = np.argmax([abs(lim[0][1]-lim[0][0]) for lim in limits])
xmin, xmax = limits[widest][0]
xex = max((xmax-xmin)*0.25,0.20)
xex = max((xmax-xmin)*0.25, 0.20)
spectrum.set_xlim(xmin-xex, xmax+xex)
ymax = max(*[lim[1] for lim in limits],1)
ymax = max(*[lim[1] for lim in limits], 1)
spectrum.set_ylim(ymax*-0.1, ymax*1.2)
spectrum.figure.canvas.draw()
def get_intensity(row, ds, drls):
#prevent division by 0
# prevent division by 0
intensity = np.concatenate([np.divide(np.sum(subset['matrix'].T[
get_massargs(drls['pt'],row,subset)].T, axis=1),
get_massargs(drls['pt'], row, subset)].T, axis=1),
np.clip(subset['chrom_dat'][1], np.finfo(np.float32).eps, None))
for subset in ds])
return intensity
......@@ -90,7 +89,8 @@ def get_daughterset(ds, drls):
"""Fuction to acquire the curves of the daugher ions"""
logger.info("getting set of the daughter ions")
names = []
times = np.concatenate([sub['chrom_dat'][0, :] - drls['tshift'].value() for sub in ds])
times = np.concatenate([sub['chrom_dat'][0, :] - drls['tshift'].value()
for sub in ds])
intensities = []
for row in range(drls['dt'].rowCount()):
if drls['dt'].cellWidget(row, 0).checkState() == 2:
......@@ -103,8 +103,8 @@ def get_daughterset(ds, drls):
correction = get_intensity(cor, ds, drls) * factor
intensity = intensity - correction
corlist.append("{} * {}".format(
drls['dt'].item(row,2+i*2).text(),
drls['dt'].cellWidget(row,1+i*2).currentText()))
drls['dt'].item(row, 2+i*2).text(),
drls['dt'].cellWidget(row, 1+i*2).currentText()))
cortext = " + ".join(corlist)
intensities.append(intensity)
names.append("{} - ({})".format(
......@@ -127,9 +127,9 @@ def get_parentset(ds, drls):
rowlist.append(
drls['dt'].cellWidget(row, 1).currentIndex()-1)
for row in set(rowlist):
intensity = get_intensity(row, ds, drls)
intensities.append(intensity)
names.append(drls['dt'].item(row, 0).text())
intensity = get_intensity(row, ds, drls)
intensities.append(intensity)
names.append(drls['dt'].item(row, 0).text())
return names, times, intensities