Commits

Miha Stajdohar committed dffc1b4

Fix run input signal funcs in this module.

  • Participants
  • Parent commits 35116e8

Comments (0)

Files changed (1)

File orangecontrib/modelmaps/widgets/OWModelMap.py

 <contact>Miha Stajdohar (miha.stajdohar(@at@)gmail.com)</contact> 
 <priority>6520</priority>
 """
-
 import os.path
 
-from Orange import classification, misc, modelmaps, network, utils
-from Orange.network.community import CommunityDetection
-from Orange.network.widgets.OWNxCanvasQt import OWNxCanvas
+from Orange import classification, data, misc, utils
+from Orange.orng.orngScaleLinProjData import *
+from Orange.OrangeWidgets.OWkNNOptimization import OWVizRank
+from Orange.OrangeWidgets.Visualize.OWDistributions import OWDistributionGraph
 
-from orngScaleLinProjData import *
-from OWkNNOptimization import OWVizRank
-from OWDistributions import OWDistributionGraph
-
-from Orange.network.widgets.OWNxExplorer import *
-from Orange.network.widgets.OWNxHist import *
-
+from orangecontrib import modelmaps, network
+from orangecontrib.network.community import CommunityDetection
+from orangecontrib.network.widgets.OWNxCanvasQt import OWNxCanvas
+from orangecontrib.network.widgets.OWNxExplorer import *
+from orangecontrib.network.widgets.OWNxHist import *
 
 from PyQt4 import QtCore
 
+
 NAME = "Model Map"
 DESCRIPTIPN = "Visualization and analysis of prediction models"
 ICON = "icons/Network.png"
 PRIORITY = 6520
 
 INPUTS = [("Community Detection", CommunityDetection, "set_community"),
-          ("Distances", misc.SymMatrix, "set_matrix", Default),
+          ("Model Distances", misc.SymMatrix, "set_matrix", Default),
           ("Model Subset", data.Table, "set_models_subset")]
 
 OUTPUTS = [("Model", modelmaps.Model),
            ("Classifier", classification.Classifier),
            ("Selected Models", data.Table)]
 
-REPLACES = ["_modelmaps.widgets.OWModelMap.OWModelMap"]
-
-
 dir = utils.environ.widget_install_dir
 
 ICON_PATHS = [("TREE", "Classify/icons/ClassificationTree"),
 
 PIXMAP_CACHE = {}
 
+WIDGET_CLASS = 'OWModelMap'
+
 for size in ICON_SIZES:
     for model, path in ICON_PATHS:
         MODEL_IMAGES[model + size] = os.path.join(dir, "%s_%s.png" % (path, size))
 
+
 class ModelItem(orangeqt.ModelItem):
     def __init__(self, index, x=None, y=None, parent=None):
         orangeqt.ModelItem.__init__(self, index, OWPoint.Ellipse, Qt.blue, 5, parent)
 #            r = QtCore.QRectF(-tw / 2., self.size() / 2. + 5 + i * th, tw, th);
 #            painter.drawText(r, QtCore.Qt.AlignCenter, l);
 
+
 class ModelCurve(NetworkCurve):
     def __init__(self, parent=None, pen=QPen(Qt.black), xData=None, yData=None):
         NetworkCurve.__init__(self, parent, pen=QPen(Qt.black), xData=None, yData=None)
 
+
 class OWModelMapCanvas(OWNxCanvas):
 
     def __init__(self, master, parent=None, name="None"):
         self._nx_explorer.networkCanvas.unmark_all_points()
         map(lambda n: ModelItem.set_marked(n, True), self._expanded_nodes)
 
+
 class OWModelMap(OWNxExplorer, OWNxHist):
 
     settingsList = ["autoSendSelection", "spinExplicit", "spinPercentage",
         "spinUpperThreshold"]
 
     def __init__(self, parent=None, signalManager=None, name="Model Map"):
-        OWNxExplorer.__init__(self, parent, signalManager, name,
-                               NetworkCanvas=OWModelMapCanvas)
-
+        OWNxExplorer.__init__(self, parent, signalManager, name, NetworkCanvas=OWModelMapCanvas)
         OWNxHist.__init__(self, parent)
 
         self.inputs = [("Community Detection", CommunityDetection, self.set_community),
-                       ("Distances", misc.SymMatrix, self.set_matrix, Default),
+                       ("Model Distances", misc.SymMatrix, self.set_matrix),
                        ("Model Subset", data.Table, self.set_models_subset)]
 
         self.outputs = [("Model", modelmaps.Model),
 
         self.visualize_info()
 
+
 if __name__ == "__main__":
     import OWModelFile
     import pickle
     matrix.originalData = data.Table('%stab\\zoo.tab' % root)
     ow.set_matrix(matrix)
     appl.exec_()
-