[med-svn] [pycorrfit] 01/04: Imported Upstream version 0.9.5+dfsg
Alex Mestiashvili
malex-guest at moszumanska.debian.org
Wed Jan 6 14:06:16 UTC 2016
This is an automated email from the git hooks/post-receive script.
malex-guest pushed a commit to branch master
in repository pycorrfit.
commit b05cce74833ca313aeffd491de27b04c9207fed0
Author: Alexandre Mestiashvili <alex at biotec.tu-dresden.de>
Date: Wed Jan 6 14:05:37 2016 +0100
Imported Upstream version 0.9.5+dfsg
---
ChangeLog.txt | 6 ++++++
pycorrfit/fcs_data_set.py | 4 ----
pycorrfit/frontend.py | 1 +
pycorrfit/openfile.py | 21 +++++++++++++++++----
pycorrfit/page.py | 12 +++++++++---
pycorrfit/tools/batchcontrol.py | 15 ++++++++-------
6 files changed, 41 insertions(+), 18 deletions(-)
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 70ef36c..e2cd638 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,9 @@
+0.9.5
+- Bugfixes
+ - Closing the batch control window causes segfault bug (#142)
+ - Closing page causes error when batch control is active (#143)
+ - Plot normalization causes "Save Session" to fail (#144)
+ - Plot normalization not loaded from session (#145)
0.9.4
- Batch control allows to select individual parameters (#108)
- Allow to exclude pages from batch fitting (#107)
diff --git a/pycorrfit/fcs_data_set.py b/pycorrfit/fcs_data_set.py
index 3deaa0f..8a21b07 100644
--- a/pycorrfit/fcs_data_set.py
+++ b/pycorrfit/fcs_data_set.py
@@ -548,9 +548,6 @@ class Correlation(object):
"""fitted data values, same shape as self.correlation_fit"""
toplot = self.modeled_fit
toplot[:,1] *= self.normalize_factor
- if toplot[-1,1] == 0.1:
- import IPython
- IPython.embed()
return toplot
@property
@@ -559,7 +556,6 @@ class Correlation(object):
if self.normparm is None:
# nothing to do
return 1
-
if self.normparm < self.fit_parameters.shape[0]:
nfactor = self.fit_parameters[self.normparm]
else:
diff --git a/pycorrfit/frontend.py b/pycorrfit/frontend.py
index 1ef782d..402c745 100644
--- a/pycorrfit/frontend.py
+++ b/pycorrfit/frontend.py
@@ -1820,6 +1820,7 @@ class MyFrame(wx.Frame):
# New feature in 0.7.8 includes normalization to a fitting
# parameter.
Page.corr.normparm = Parms[8]
+ Page.apply_parameters_reverse()
Page.OnAmplitudeCheck("init")
if len(Parms) >= 10:
Page.corr.fit_parameters_range = np.array(Parms[9])
diff --git a/pycorrfit/openfile.py b/pycorrfit/openfile.py
index 85ee8db..abe2239 100644
--- a/pycorrfit/openfile.py
+++ b/pycorrfit/openfile.py
@@ -328,22 +328,35 @@ def SaveSessionData(sessionfile, Infodict):
for idparm in ParmsKeys:
# Make sure we do not accidently save arrays.
# This would not work correctly with yaml.
+ # Parameters
Parms[idparm][2] = np.array(Parms[idparm][2],dtype="float").tolist()
- Parms[idparm][3] = np.array(Parms[idparm][3],dtype="bool").tolist()
- # Range of fitting parameters
+ # Parameter varied
+ Parms[idparm][3] = np.array(Parms[idparm][3],dtype="bool").tolist()
+ # Channel selection
+ Parms[idparm][4] = np.array(Parms[idparm][4],dtype="int").tolist()
+ # Background selection
+ for ii in range(len(Parms[idparm][6])):
+ if Parms[idparm][6][ii] is not None:
+ Parms[idparm][6][ii] = int(Parms[idparm][6][ii])
+ # Plot normalization
+ if Parms[idparm][8] is not None:
+ Parms[idparm][8] = int(Parms[idparm][8])
+ # Fit parameter range
Parms[idparm][9] = np.array(Parms[idparm][9],dtype="float").tolist()
Parmlist.append(Parms[idparm])
+
try:
# We would like to perform safe_dump, because in the
# Windoes x64 version, some integers are exported
# like this: `!!python/long '105'` using `yaml.dump`.
with open(parmsfilename, "wb") as yamlfd:
yaml.safe_dump(Parmlist, yamlfd)
- except:# yaml.representer.RepresenterError:
- # This error occured once on Mac OS 10.8.5:
+ except yaml.representer.RepresenterError:
# `RepresenterError: cannot represent an object: 0`
# In this case, we choose to use the normal dump
# and pray.
+ # However, this should not happen, because in the above
+ # for-loop we set the correct dtype for each parameter .
if os.path.exists(parmsfilename):
os.remove(parmsfilename)
with open(parmsfilename, "wb") as yamlfd:
diff --git a/pycorrfit/page.py b/pycorrfit/page.py
index 07f14b6..0334eab 100644
--- a/pycorrfit/page.py
+++ b/pycorrfit/page.py
@@ -191,8 +191,8 @@ class FittingPanel(wx.Panel):
self._bg2selected = value
def apply_parameters(self, event=None):
- """ Read the values from the form and write it to the
- pages parameters.
+ """ Read the values from the GUI form and write it to the
+ pages parameters / correlation class.
This function is called when the "Apply" button is hit.
"""
modelid = self.corr.fit_model.id
@@ -263,7 +263,7 @@ class FittingPanel(wx.Panel):
def apply_parameters_reverse(self, event=None):
""" Read the values from the pages parameters and write
- it to the form.
+ it to the GUI form.
"""
modelid = self.corr.fit_model.id
#
@@ -287,6 +287,12 @@ class FittingPanel(wx.Panel):
List[1] = "spline ("+str(self.FitKnots)+" knots)"
self.Fitbox[1].SetItems(List)
self.Fitbox[1].SetSelection(idf)
+ # Normalization
+ if self.corr.normparm is None:
+ normsel = 0
+ else:
+ normsel = self.corr.normparm + 1
+ self.AmplitudeInfo[2].SetSelection(normsel)
# Fitting algorithm
keys = pcfbase.GetAlgorithmStringList()[0]
idalg = keys.index(self.corr.fit_algorithm)
diff --git a/pycorrfit/tools/batchcontrol.py b/pycorrfit/tools/batchcontrol.py
index 727a4cd..5a41488 100644
--- a/pycorrfit/tools/batchcontrol.py
+++ b/pycorrfit/tools/batchcontrol.py
@@ -146,14 +146,17 @@ class BatchCtrl(wx.Frame):
if trigger in ["fit_batch", "fit_finalize", "init",
"parm_batch", "parm_finalize"]:
return
-
+
+ oldpage = self.curpage
+ self.curpage = self.parent.notebook.GetCurrentPage()
+
if Page is not None:
# redraw this tool if necessary
- if self.curpage is not None:
+ if oldpage is not None and not isinstance(oldpage, wx._core._wxPyDeadObject):
oldmodelid = self.curpage.modelid
else:
oldmodelid = 0
- newmodelid = Page.modelid
+ newmodelid = self.curpage.modelid
if oldmodelid != newmodelid:
self.RedrawParameterBox()
@@ -167,7 +170,7 @@ class BatchCtrl(wx.Frame):
self.dropdown.SetItems(DDlist)
self.dropdown.SetSelection(0)
- self.curpage = self.parent.notebook.GetCurrentPage()
+
def OnRadioHere(self, event=None):
@@ -249,7 +252,6 @@ check box.""")
## Parameter selection
boxright = wx.StaticBox(panel, label="Selected parameters")
rightSizer = wx.StaticBoxSizer(boxright, wx.VERTICAL)
- boxright.SetSizer(rightSizer)
self.parameter_sizer = rightSizer
self.RedrawParameterBox()
@@ -310,9 +312,8 @@ for batch modification.""")
box = sizer.GetStaticBox()
boxs = box.GetBestSize()
sizs = sizer.GetMinSize()
- thesize = (max(boxs[0], sizs[0]+20), sizs[1])
+ thesize = (max(boxs[0], sizs[0]), sizs[1])
sizer.SetMinSize(thesize)
- box.SetMinSize(thesize)
box.SetSize(thesize)
try:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/pycorrfit.git
More information about the debian-med-commit
mailing list