Index: src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py
===================================================================
--- src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py	(revision ff8cb7352da80f83dec1b14d41e8a0d7f7e36afa)
+++ src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py	(revision 7be71367c7f3b6dfca08d4e1c6ee7feb159748b9)
@@ -1,13 +1,7 @@
 # global
-import sys
 from PyQt4 import QtCore
 from PyQt4 import QtGui
-from PyQt4 import QtWebKit
-
-from twisted.internet import threads
-from twisted.internet import reactor
 
 # sas-global
-from sas.qtgui.Plotting.PlotterData import Data1D
 import sas.qtgui.Utilities.GuiUtils as GuiUtils
 from sas.sascalc.corfunc.corfunc_calculator import CorfuncCalculator
@@ -18,6 +12,6 @@
 from CorfuncUtils import WIDGETS as W
 
-from matplotlib.backends import qt_compat
-from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
+from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg \
+    as FigureCanvas
 from matplotlib.figure import Figure
 
@@ -25,5 +19,5 @@
 class MyMplCanvas(FigureCanvas):
     """Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.)."""
-    def __init__(self, model, parent=None, width=5, height=4, dpi=100):
+    def __init__(self, model, width=5, height=4, dpi=100):
         self.model = model
         self.fig = Figure(figsize=(width, height), dpi=dpi)
@@ -31,20 +25,10 @@
 
         FigureCanvas.__init__(self, self.fig)
-        # self.reparent(parent, QPoint(0, 0))
-
-        # FigureCanvas.setSizePolicy(self,
-        #                            QSizePolicy.Expanding,
-        #                            QSizePolicy.Expanding)
-        # FigureCanvas.updateGeometry(self)
 
         self.data = None
         self.extrap = None
 
-    def drawQSpace(self):
+    def draw_q_space(self):
         self.fig.clf()
-
-        self.qmin = None
-        self.qmax1 = None
-        self.qmax2 = None
 
         self.axes = self.fig.add_subplot(111)
@@ -61,5 +45,6 @@
             self.axes.axvline(qmax1)
             self.axes.axvline(qmax2)
-            self.axes.set_xlim(min(self.data.x), max(self.data.x)*1.5-0.5*min(self.data.x))
+            self.axes.set_xlim(min(self.data.x), max(self.data.x) * 1.5 -
+                               0.5 * min(self.data.x))
         if self.extrap:
             self.axes.plot(self.extrap.x, self.extrap.y)
@@ -77,17 +62,10 @@
             self.axes.plot(self.data.x, self.data.y, label="1D Correlation")
             self.axes.plot(self.data3.x, self.data3.y, label="3D Correlation")
-            self.axes.plot(self.data_idf.x, self.data_idf.y, label="Interface Distribution Function")
+            self.axes.plot(self.data_idf.x, self.data_idf.y,
+                           label="Interface Distribution Function")
             self.axes.set_xlim(min(self.data.x), max(self.data.x) / 4)
             self.axes.legend()
 
         self.draw()
-
-
-    # def sizeHint(self):
-    #     w, h = self.get_width_height()
-    #     return QSize(w, h)
-
-    # def minimumSizeHint(self):
-    #     return QSize(10, 10)
 
 
@@ -95,6 +73,6 @@
     # The controller which is responsible for managing signal slots connections
     # for the gui and providing an interface to the data model.
-    name = "Corfunc" # For displaying in the combo box
-    #def __init__(self, manager=None, parent=None):
+    name = "Corfunc"  # For displaying in the combo box
+
     def __init__(self, parent=None):
         super(CorfuncWindow, self).__init__()
@@ -107,6 +85,6 @@
         self._calculator = CorfuncCalculator()
 
-        self._canvas = MyMplCanvas(self.model, self)
-        self._realplot = MyMplCanvas(self.model, self)
+        self._canvas = MyMplCanvas(self.model)
+        self._realplot = MyMplCanvas(self.model)
         self.verticalLayout_7.insertWidget(0, self._canvas)
         self.verticalLayout_7.insertWidget(1, self._realplot)
@@ -114,13 +92,13 @@
         # Connect buttons to slots.
         # Needs to be done early so default values propagate properly.
-        self.setupSlots()
+        self.setup_slots()
 
         # Set up the model.
-        self.setupModel()
+        self.setup_model()
 
         # Set up the mapper
-        self.setupMapper()
-
-    def setupSlots(self):
+        self.setup_mapper()
+
+    def setup_slots(self):
         self.extrapolateBtn.clicked.connect(self.extrapolate)
         self.transformBtn.clicked.connect(self.transform)
@@ -130,5 +108,5 @@
         self.model.itemChanged.connect(self.modelChanged)
 
-    def setupModel(self):
+    def setup_model(self):
         self.model.setItem(W.W_QMIN,
                            QtGui.QStandardItem("0.01"))
@@ -158,5 +136,5 @@
     def modelChanged(self, item):
         self.mapper.toFirst()
-        self._canvas.drawQSpace()
+        self._canvas.draw_q_space()
 
     def _update_calculator(self):
@@ -165,18 +143,19 @@
         qmax2 = float(self.model.item(W.W_QCUTOFF).text())
         self._calculator.upperq = (qmax1, qmax2)
-        self._calculator.background = float(self.model.item(W.W_BACKGROUND).text())
+        self._calculator.background = \
+            float(self.model.item(W.W_BACKGROUND).text())
 
     def extrapolate(self):
         self._update_calculator()
-        params, extrapolation = self._calculator.compute_extrapolation()
+        params, extrapolation, _ = self._calculator.compute_extrapolation()
 
         self.model.setItem(W.W_GUINIERA, QtGui.QStandardItem(str(params['A'])))
         self.model.setItem(W.W_GUINIERB, QtGui.QStandardItem(str(params['B'])))
         self.model.setItem(W.W_PORODK, QtGui.QStandardItem(str(params['K'])))
-        self.model.setItem(W.W_PORODSIGMA, QtGui.QStandardItem(str(params['sigma'])))
+        self.model.setItem(W.W_PORODSIGMA,
+                           QtGui.QStandardItem(str(params['sigma'])))
 
         self._canvas.extrap = extrapolation
-        self._canvas.drawQSpace()
-
+        self._canvas.draw_q_space()
 
     def transform(self):
@@ -188,4 +167,5 @@
         extrap = self._canvas.extrap
         bg = float(self.model.item(W.W_BACKGROUND).text())
+
         def updatefn(*args, **kwargs):
             pass
@@ -212,8 +192,8 @@
 
         self._update_calculator()
-        self._calculator.compute_transform(extrap, method, bg, completefn, updatefn)
-
-
-    def setupMapper(self):
+        self._calculator.compute_transform(extrap, method, bg,
+                                           completefn, updatefn)
+
+    def setup_mapper(self):
         self.mapper = QtGui.QDataWidgetMapper(self)
         self.mapper.setOrientation(QtCore.Qt.Vertical)
@@ -269,5 +249,5 @@
 
         self._canvas.data = data
-        self._canvas.drawQSpace()
+        self._canvas.draw_q_space()
 
         # self.model.item(WIDGETS.W_FILENAME).setData(QtCoreQVariant(self._model_item.text()))
@@ -280,17 +260,2 @@
 
         self._allow_close = value
-
-
-if __name__ == "__main__":
-    app = QtGui.QApplication([])
-    import qt4reactor
-    # qt4reactor.install()
-    # DO NOT move the following import to the top!
-    # (unless you know what you're doing)
-    from twisted.internet import reactor
-    dlg = CorfuncWindow(reactor)
-    print(dlg)
-    dlg.show()
-    # print(reactor)
-    # reactor.run()
-    sys.exit(app.exec_())
