Commits

Blaz Zupan committed 467f952

Changes in headers, widget descriptions text.

  • Participants
  • Parent commits 07da3ea

Comments (0)

Files changed (22)

Orange/OrangeWidgets/Data/OWConcatenate.py

-"""
-<name>Concatenate</name>
-<description>Concatenates Example Tables.</description>
-<icon>icons/Concatenate.svg</icon>
-<priority>1111</priority>
-<contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact>
-"""
-
+import Orange
 from OWWidget import *
 import OWGUI
 from itertools import izip
 
+NAME = "Concatenate"
+DESCRIPTION = "Concatenates data tables."
+ICON = "icons/Concatenate.svg"
+PRIORITY = 1111
+MAINTAINER = "Janez Demsar"
+MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si"
+INPUTS = [("Primary Data", Orange.data.Table, "setData"),
+          ("Additional Data", Orange.data.Table, "setMoreData", Multiple)]
+OUTPUTS = [("Data", Orange.data.Table, )]
+
+
 class OWConcatenate(OWWidget):
     settingsList = ["mergeAttributes", "dataSourceSelected", "addIdAs", "dataSourceName"]
     
     def __init__(self,parent=None, signalManager = None):
         OWWidget.__init__(self, parent, signalManager, "Concatenate", wantMainArea=0)
-        self.inputs = [("Primary Data", orange.ExampleTable, self.setData), ("Additional Data", orange.ExampleTable, self.setMoreData, Multiple)]
+        self.inputs = [("Primary Data", orange.ExampleTable, self.setData),
+                       ("Additional Data", orange.ExampleTable, self.setMoreData, Multiple)]
         self.outputs = [("Data", ExampleTable)]
 
         self.mergeAttributes = 0
 if __name__ == "__main__":
     app = QApplication(sys.argv)
     w = OWConcatenate()
-    data = orange.ExampleTable("../../doc/datasets/iris.tab")
+    data = Orange.data.Table("iris.tab")
     w.setData(data)
     w.setMoreData(data, 0)
     w.show()

Orange/OrangeWidgets/Data/OWContinuize.py

-"""
-<name>Continuize</name>
-<description>Transform discrete attributes into continuous. Optionally, normalize the continuous values.</description>
-<icon>icons/Continuize.svg</icon>
-<contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact>
-<priority>2110</priority>
-"""
-#
-# OWContinuize.py
-# Continuize Widget
-# Turns discrete attributes into continuous
-#
+import Orange
 from OWWidget import *
 from orngWrap import PreprocessedLearner
 import OWGUI
 
+NAME = "Continuize"
+DESCRIPTION = """Turns discrete features into continuous.
+Can also normalize existing continuous features."""
+ICON = "icons/Continuize.svg"
+PRIORITY = 2110
+CATEGORY = "Data"
+MAINTAINER = "Janez Demsar"
+MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "setData")]
+OUTPUTS = [("Data", Orange.data.Table, ),
+           ("Preprocessor", PreprocessedLearner, )]
+
 class OWContinuize(OWWidget):
     settingsList = ["multinomialTreatment", "classTreatment", "zeroBased", "continuousTreatment", "autosend"]
     contextHandlers = {"": ClassValuesContextHandler("", ["targetValue"])}
 if __name__ == "__main__":
     a = QApplication(sys.argv)
     ow = OWContinuize()
-    #data = orange.ExampleTable("d:\\ai\\orange\\test\\iris")
-#    data = orange.ExampleTable(r"E:\Development\Orange Datasets\UCI\iris.tab")
-    data = orange.ExampleTable("../../doc/datasets/iris.tab")
+    data = Orange.data.Table("iris.tab")
     ow.setData(data)
     ow.show()
     a.exec_()

Orange/OrangeWidgets/Data/OWDataDomain.py

-"""
-<name>Select Attributes</name>
-<description>Manual selection of attributes.</description>
-<icon>icons/SelectAttributes.svg</icon>
-<priority>1100</priority>
-<contact>Ales Erjavec (ales.erjavec@fri.uni-lj.si)</contact>
-"""
-
 import sys
-
+import Orange
 from OWWidget import *
 from OWItemModels import PyListModel, VariableListModel
 
-import Orange
+NAME = "Select Attributes"
+DESCRIPTION = "Supports manual selection of data features."
+ICON = "icons/SelectAttributes.svg"
+PRIORITY = 1100
+CATEGORY = "Data"
+MAINTAINER = "Ales Erjavec"
+MAINTAINER_EMAIL = "ales.erjavec < at > fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "set_data", Default)]
+OUTPUTS = [("Data", Orange.data.Table, ),
+           ("Features", AttributeList, )]
+
 
 def slices(indices):
     """ Group the given integer indices into slices
                 yield first, last + 1
                 first = last = i
         yield first, last + 1
-        
+
+
 def source_model(view):
     """ Return the source model for the Qt Item View if it uses
     the QSortFilterProxyModel.
     else:
         return view.model()
 
+
 def source_indexes(indexes, view):
     """ Map model indexes through a views QSortFilterProxyModel
     """
     else:
         return indexes 
             
+
 def delslice(model, start, end):
     """ Delete the start, end slice (rows) from the model. 
     """
     else:
         raise TypeError(type(model))
         
+
 class VariablesListItemModel(VariableListModel):
     """ An Qt item model for for list of orange.Variable objects.
     Supports drag operations

Orange/OrangeWidgets/Data/OWDataInfo.py

-"""<name>Info</name>
-<description>Displays basic information about data set on the input. Shows
-sample size, and number and type of features.</description>
-<icon>icons/DataInfo.svg</icon>
-<priority>80</priority>
-<contact>Ales Erjavec (ales.erjavec@fri.uni-lj.si)</contact>"""
+import Orange
+import OWGUI
+from OWWidget import *
+import sys
 
-from OWWidget import *
-import OWGUI
+NAME = "Info"
+DESCRIPTION = """Displays basic information about data set on the input. Shows
+sample size, and number and type of features."""
+ICON = "icons/DataInfo.svg"
+PRIORITY = 80
+CATEGORY = "Data"
+MAINTAINER = "Ales Erjavec"
+MAINTAINER_EMAIL = "ales.erjavec < at > fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "data")]
+OUTPUTS = []
 
-import orange
-import sys, os
 
 class OWDataInfo(OWWidget):
     def __init__(self, parent=None, signalManager=None, name="Info"):
         
         box = OWGUI.widgetBox(self.controlArea, "Data Set Size", addSpace=True)
         OWGUI.label(box, self, '<table><tr><td width="150">Samples (rows):</td><td align="right" width="60">%(rowcount)7i</td></tr>\
-                                <tr><td>Attributes (columns):</td><td align="right">%(columncount)7i</td></tr></table>')
+                                <tr><td>Features (columns):</td><td align="right">%(columncount)7i</td></tr></table>')
         
-        box = OWGUI.widgetBox(self.controlArea, "Attributes")
-        OWGUI.label(box, self, '<table><tr><td width="150">Discrete attributes:</td><td align="right" width="60">%(discattrcount)7i</td></tr>\
-                                <tr><td>Continuous attributes:</td><td align="right">%(contattrcount)7i</td></tr>\
-                                <tr><td>String attributes:</td><td align="right">%(stringattrcount)7i</td></tr>\
+        box = OWGUI.widgetBox(self.controlArea, "Features")
+        OWGUI.label(box, self, '<table><tr><td width="150">Discrete:</td><td align="right" width="60">%(discattrcount)7i</td></tr>\
+                                <tr><td>Continuous:</td><td align="right">%(contattrcount)7i</td></tr>\
+                                <tr><td>String:</td><td align="right">%(stringattrcount)7i</td></tr>\
                                 <tr><td> </td></tr>\
-                                <tr><td>Meta attributes:</td><td align="right">%(metaattrcount)7i</td></tr>\
-                                <tr><td>Class attribute:</td><td align="right">%(classattr)7s</td></tr></table>')
+                                <tr><td>Meta features:</td><td align="right">%(metaattrcount)7i</td></tr>\
+                                <tr><td>Class variable present:</td><td align="right">%(classattr)7s</td></tr></table>')
 #        OWGUI.separator(box)
 #        OWGUI.label(box, self, '<table><tr><td width="100">Meta attributes:</td><td align="right" width="50">%(metaattrcount)7i</td></tr>\
 #                                <tr><td>Class attribute:</td><td align="right">%(classattr)7s</td></tr></table>')
         self.resize(200, 200)
         
         self.loadSettings()
-        
-        
+
     def data(self, data):
         if data:
             self.rowcount = len(data)
 if __name__ == "__main__":
     app = QApplication(sys.argv)
     w = OWDataInfo()
-    data = orange.ExampleTable("../../doc/datasets/iris.tab")
+    data = Orange.data.Table("iris.tab")
     w.data(data)
     w.show()
     app.exec_()

Orange/OrangeWidgets/Data/OWDataSampler.py

-r"""
-<name>Data Sampler</name>
-<description>Selects a subset of instances from the data set.</description>
-<icon>icons/DataSampler.svg</icon>
-<contact>Aleksander Sadikov (aleksander.sadikov(@at@)fri.uni-lj.si)</contact>
-<priority>1125</priority>
-"""
+import random
+import Orange
+import OWGUI
 from OWWidget import *
-import OWGUI
-import random
+
+NAME = "Data Sampler"
+DESCRIPTION = "Samples data from a data set."
+ICON = "icons/DataSampler.svg"
+PRIORITY = 1125
+CATEGORY = "Data"
+MAINTAINER = "Aleksander Sadikov"
+MAINTAINER_EMAIL = "aleksander.sadikov(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "setData", Default)]
+OUTPUTS = [("Data Sample", Orange.data.Table, ),
+           ("Remaining Data", Orange.data.Table, )]
+
 
 class OWDataSampler(OWWidget):
     settingsList=["Stratified", "Repeat", "UseSpecificSeed", "RandomSeed",
-    "GroupSeed", "outFold", "Folds", "SelectType", "useCases", "nCases", "selPercentage", "LOO",
+    "GroupSeed", "outFold", "Folds", "SelectType", "useCases", "nCases",
+    "selPercentage", "LOO",
     "CVFolds", "CVFoldsInternal", "nGroups", "pGroups", "GroupText"]
     
     contextHandlers = {"":DomainContextHandler("", ["nCases","selPercentage"])}
 if __name__=="__main__":
     appl = QApplication(sys.argv)
     ow = OWDataSampler()
-    data = orange.ExampleTable('../../doc/datasets/iris.tab')
+    data = Orange.data.Table('iris.tab')
     ow.setData(data)
     ow.show()
     appl.exec_()

Orange/OrangeWidgets/Data/OWDataTable.py

-"""
-<name>Data Table</name>
-<description>Shows data in a spreadsheet.</description>
-<icon>icons/DataTable.svg</icon>
-<priority>100</priority>
-<contact>Peter Juvan (peter.juvan@fri.uni-lj.si)</contact>
-"""
-
 import sys
 import math
 import csv
 import itertools
-
+import sip
+import Orange
+import OWGUI
 from StringIO import StringIO
 from xml.sax.saxutils import escape
 from functools import wraps
-
-import sip
-
-import Orange
-
 from OWWidget import *
-import OWGUI
 from orngDataCaching import *
 import OWColorPalette
 
 NAME = "Data Table"
-
 DESCRIPTION = "Displays data in a spreadsheet."
-
-LONG_DESCRIPTION = """Data Table widget takes one or more data sets
-on its input and presents them in a spreadsheet format.
-"""
-
+LONG_DESCRIPTION = ""
 ICON = "icons/DataTable.svg"
-
 PRIORITY = 100
-
-AUTHOR = "Peter Juvan"
-
-AUTHOR_EMAIL = "peter.juvan(@at@)fri.uni-lj.si"
-
-INPUTS = [("Data", ExampleTable, "dataset", Multiple + Default)]
-
-OUTPUTS = [("Selected Data", ExampleTable, Default),
-           ("Other Data", ExampleTable)]
+AUTHOR = "Ales Erjavec"
+AUTHOR_EMAIL = "ales.erjavec(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "dataset", Multiple + Default)]
+OUTPUTS = [("Selected Data", Orange.data.Table, Default),
+           ("Other Data", Orange.data.Table, )]
 
 
 def header_text(feature, labels=None):
         _, end = range_ind[-1]
         yield start, end + 1
 
-
-def test():
+if __name__ == "__main__":
     a = QApplication(sys.argv)
     ow = OWDataTable()
 
     ow.dataset(d5, "wine")
     a.exec_()
     ow.saveSettings()
-
-
-if __name__ == "__main__":
-    test()

Orange/OrangeWidgets/Data/OWDiscretize.py

-"""
-<name>Discretize</name>
-<description>Discretization of continuous attributes.</description>
-<icon>icons/Discretize.svg</icon>
-<contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact>
-<priority>2100</priority>
-"""
-
 import orange
 from OWWidget import *
 from OWGraph import *
 import OWGUI
 
-
 NAME = "Discretize"
 DESCRIPTION = "Discretization of continuous attributes."
-
 MAINTAINER = "Ales Erjavec"
 MAINTAINER_EMAIL = "ales.erjavec < at > fri.uni-lj.si"
-
 CATEGORY = "Data"
 PRIORITY = 2100
 ICON = "icons/Discretize.svg"
-
 INPUTS = [("Data", orange.ExampleTable, "setData")]
-OUTPUTS = [("Data", orange.ExampleTable,)]
-
+OUTPUTS = [("Data", orange.ExampleTable, )]
 WIDGET_CLASS = "OWDiscretize"
 
 

Orange/OrangeWidgets/Data/OWEditDomain.py

-"""
-<name>Edit Domain</name>
-<description>Edit domain variables</description>
-<icon>icons/EditDomain.svg</icon>
-<contact>Ales Erjavec (ales.erjavec(@ at @)fri.uni-lj.si)</contact>
-<priority>3125</priority>
-<keywords>change,name,variable,domain</keywords>
-"""
-
 from OWWidget import *
 from OWItemModels import VariableListModel, PyListModel
 
 
 import Orange
 
+NAME = "Edit Domain"
+DESCRIPTION = """Supports renaming of features and their values."""
+ICON = "icons/EditDomain.svg"
+PRIORITY = 3125
+AUTHOR = "Ales Erjavec"
+AUTHOR_EMAIL = "ales.erjavec(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "set_data")]
+OUTPUTS = [("Data", Orange.data.Table, )]
+
 
 def is_discrete(var):
     return isinstance(var, Orange.feature.Discrete)

Orange/OrangeWidgets/Data/OWFeatureConstructor.py

-"""
-<name>Feature Constructor</name>
-<description>Construct a new continuous attribute computed from existing attributes.</description>
-<icon>icons/FeatureConstructor.svg</icon>
-<priority>3100</priority>
-<contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact>
-"""
-
 from OWWidget import *
 import OWGUI, math, re
 import random
 import inspect
 
+NAME = "Feature Constructor"
+DESCRIPTION = "Constructs new features computed from existing ones."
+ICON = "icons/FeatureConstructor.svg"
+MAINTAINER = "Janez Demsar"
+MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si"
+PRIORITY = 3100
+CATEGORY = "Data"
+INPUTS = [("Data", Orange.data.Table, "setData")]
+OUTPUTS = [("Data", Orange.data.Table, )]
+
 re_identifier = re.compile(r'([a-zA-Z_]\w*)|("[^"]+")')
 
+
 class IdentifierReplacer:
     def __init__(self, reinserted, attributes):
         self.reinserted = reinserted
             return "_ex['%s']" % id
         return id
 
+
 class AttrComputer:
     FUNCTIONS = dict([(key, val) for key, val in math.__dict__.items() if not key.startswith("_")] +\
                       {"normalvariate": random.normalvariate,
                        "weibullvariate": random.weibullvariate,
                        "triangular": random.triangular,
                        "uniform": random.uniform}.items())
+
     def __init__(self, expression):
         self.expression = expression
 
         except Exception, ex:
             return "?"
 
+
 class OWFeatureConstructor(OWWidget):
     contextHandlers = {"": PerfectDomainContextHandler()}
 
         self.outputs = [("Data", ExampleTable)]
 
         self.expression = self.attrname = ""
-        self.selectedDef = []
-        self.defLabels = []
+        self.selected_def = []
+        self.def_labels = []
         self.data = None
         self.definitions = []
 
-        self.selectedAttr = 0
+        self.selected_features = 0
         self.selectedFunc = 0
         self.autosend = True
         self.loadSettings()
         vb = OWGUI.widgetBox(hb, None, "vertical", addSpace=True)
         self.leExpression = OWGUI.lineEdit(vb, self, "expression", "Expression")
         hhb = OWGUI.widgetBox(vb, None, "horizontal")
-        self.cbAttrs = OWGUI.comboBox(hhb, self, "selectedAttr", items = ["(all attributes)"], callback = self.attrListSelected)
+        self.cbAttrs = OWGUI.comboBox(hhb, self, "selected_features", items = ["(all attributes)"], callback = self.feature_list_selected)
         sortedFuncs = sorted(m for m in AttrComputer.FUNCTIONS.keys())
         self.cbFuncs = OWGUI.comboBox(hhb, self, "selectedFunc", items = ["(all functions)"] + sortedFuncs, callback = self.funcListSelected)
         model = self.cbFuncs.model()
         hb = OWGUI.widgetBox(db, None, "horizontal", addSpace=True)
         OWGUI.button(hb, self, "Add", callback = self.addAttr, autoDefault=True)
         OWGUI.button(hb, self, "Update", callback = self.updateAttr)
-        OWGUI.button(hb, self, "Remove", callback = self.removeAttr)
-        OWGUI.button(hb, self, "Remove All", callback = self.removeAllAttr)
+        OWGUI.button(hb, self, "Remove", callback = self.remove_feature)
+        OWGUI.button(hb, self, "Remove All", callback = self.remove_all_features)
 
-        self.lbDefinitions = OWGUI.listBox(db, self, "selectedDef", "defLabels", callback=self.selectAttr)
+        self.lbDefinitions = OWGUI.listBox(db, self, "selected_def",
+                                           "def_labels",
+                                           callback=self.select_feature)
         self.lbDefinitions.setFixedHeight(160)
 
         hb = OWGUI.widgetBox(self.controlArea, "Apply", "horizontal")
 
     def settingsToWidgetCallback(self, handler, context):
         self.definitions = getattr(context, "definitions", [])
-        self.defLabels = ["%s := %s" % t for t in self.definitions]
-        self.selectedDef = []
+        self.def_labels = ["%s := %s" % t for t in self.definitions]
+        self.selected_def = []
 
     def setData(self, data):
         self.closeContext()
         self.cbAttrs.addItem("(all attributes)")
         if self.data:
             self.cbAttrs.addItems([attr.name for attr in self.data.domain])
-        self.removeAllAttr()
+        self.remove_all_features()
         self.openContext("", data)
         self.apply()
 
         attrexpr = self.getAttrExpression()
         if not attrexpr:
             return
-        self.defLabels = self.defLabels + ["%s := %s" % attrexpr] # should be like this to update the listbox
+        self.def_labels = self.def_labels + ["%s := %s" % attrexpr] # should be like this to update the listbox
         self.definitions.append(attrexpr)
         self.expression = self.attrname = ""
-        self.applyIf()
+        self.apply_if()
 
     def updateAttr(self):
-        if self.selectedDef:
-            selected = self.selectedDef[0]
+        if self.selected_def:
+            selected = self.selected_def[0]
             attrexpr = self.getAttrExpression(selected)
             if not attrexpr:
                 return
              # should be like this to reset the listbox
-            self.defLabels = self.defLabels[:selected] + ["%s := %s" % attrexpr] + self.defLabels[selected+1:]
+            self.def_labels = self.def_labels[:selected] + ["%s := %s" % attrexpr] + self.def_labels[selected+1:]
             self.definitions[selected] = attrexpr
-            self.applyIf()
+            self.apply_if()
 
-    def removeAttr(self):
-        if self.selectedDef:
-            selected = self.selectedDef[0]
+    def remove_feature(self):
+        if self.selected_def:
+            selected = self.selected_def[0]
             if 0 <= selected < self.lbDefinitions.count():
-                self.defLabels = self.defLabels[:selected] + self.defLabels[selected+1:]
+                self.def_labels = self.def_labels[:selected] + self.def_labels[selected+1:]
                 del self.definitions[selected]
-                self.applyIf()
+                self.apply_if()
 
-    def removeAllAttr(self):
-        self.defLabels = []
+    def remove_all_features(self):
+        self.def_labels = []
         self.definitions = []
-        self.selectedDef = []
+        self.selected_def = []
         self.expression = ""
-        self.applyIf()
+        self.apply_if()
 
-    def selectAttr(self):
-        if self.selectedDef:
-            self.attrname, self.expression = self.definitions[self.selectedDef[0]]
+    def select_feature(self):
+        if self.selected_def:
+            self.attrname, self.expression = self.definitions[self.selected_def[0]]
         else:
             self.attrname = self.expression = ""
 
-    def insertIntoExpression(self, what):
+    def insert_into_expression(self, what):
         # Doesn't work: clicking the listbox removes the selection
         if self.leExpression.hasSelectedText():
             self.leExpression.del_()
         self.expression = self.expression[:cp] + what + self.expression[cp:]
         self.leExpression.setFocus()
 
-    def attrListSelected(self):
-        if self.selectedAttr:
-            attr = str(self.cbAttrs.itemText(self.selectedAttr))
+    def feature_list_selected(self):
+        if self.selected_features:
+            attr = str(self.cbAttrs.itemText(self.selected_features))
             mo = re_identifier.match(attr)
             if not mo or mo.span()[1] != len(attr):
                 attr = '"%s"' % attr
-            self.insertIntoExpression(attr)
-            self.selectedAttr = 0
+            self.insert_into_expression(attr)
+            self.selected_features = 0
 
     def funcListSelected(self):
         if self.selectedFunc:
             if func in ["atan2", "fmod", "ldexp", "log", "pow", "normalvariate",
                         "gauss", "lognormvariate", "betavariate", "gammavariate",
                         "triangular", "uniform", "vonmisesvariate", "weibullvariate"]:
-                self.insertIntoExpression(func + "(,)")
+                self.insert_into_expression(func + "(,)")
                 self.leExpression.cursorBackward(False, 2)
             elif func in ["e", "pi"]:
-                self.insertIntoExpression(func)
+                self.insert_into_expression(func)
             else:
-                self.insertIntoExpression(func + "()")
+                self.insert_into_expression(func + "()")
                 self.leExpression.cursorBackward(False)
             self.selectedFunc = 0
 
-    def applyIf(self):
+    def apply_if(self):
         self.dataChanged = True
         if self.autosend:
             self.apply()

Orange/OrangeWidgets/Data/OWFile.py

-"""
-<name>File</name>
-<description>Reads data from a file.</description>
-<icon>icons/File.svg</icon>
-<contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact>
-<priority>10</priority>
-"""
-
 import os
 import sys
 import warnings
-
 import Orange
-
 from OWWidget import *
 import OWGUI
 
 NAME = "File"
-
-DESCRIPTION = """
-Reads data from an input file.
-"""
-
-LONG_DESCRIPTION = ""
-"""
-This is the widget you will probably use at the start of every schema to read
-the input data file (data table with examples). The widget maintains a
-history of most recently used data files. For convenience, the history
-also includes a directory with the sample data sets that come with Orange.
-"""
-
+DESCRIPTION = "Reads data from an input file."
 ICON = "icons/File.svg"
-AUTHOR = "Janez Demsar"
+MAINTAINER = "Janez Demsar"
 MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si"
 PRIORITY = 10
 CATEGORY = "Data"
-
 KEYWORDS = ["data", "file", "load", "read"]
 
 OUTPUTS = (

Orange/OrangeWidgets/Data/OWImageViewer.py

-"""<name>Image Viewer</name>
-<description>View images embeded in example table</description>
-<contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact>
-<priority>4050</priority>
-<icon>icons/ImageViewer.svg</icon>
-"""
-
 from OWWidget import *
 
 import OWGUI
 
+NAME = "Image Viewer"
+DESCRIPTION = "Views images embedded in the data."
+LONG_DESCRIPTION = ""
+ICON = "icons/ImageViewer.svg"
+PRIORITY = 4050
+AUTHOR = "Ales Erjavec"
+AUTHOR_EMAIL = "ales.erjavec(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "setData")]
+OUTPUTS = [("Data", Orange.data.Table, )]
+
 
 #def setupShadow(widget):
 #    if qVersion() >= "4.6":

Orange/OrangeWidgets/Data/OWImpute.py

-"""
-<name>Impute</name>
-<description>Imputes unknown values.</description>
-<icon>icons/Impute.svg</icon>
-<priority>2130</priority>
-<contact>Janez Demsar</contact>
-"""
 import OWGUI
 from OWWidget import *
 
+NAME = "Impute"
+DESCRIPTION = "Imputes missing values in the data table."
+LONG_DESCRIPTION = ""
+ICON = "icons/Impute.svg"
+PRIORITY = 2130
+AUTHOR = "Janez Demsar"
+AUTHOR_EMAIL = "janez.demsar(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "setData"),
+          ("Learner for Imputation", orange.Learner, "setModel")]
+OUTPUTS = [("Data", Orange.data.Table, ),
+           ("Imputer", orange.ImputerConstructor, )]
+
 
 class ImputeListItemDelegate(QItemDelegate):
     def __init__(self, widget, parent = None):
     def __init__(self,parent=None, signalManager = None, name = "Impute"):
         OWWidget.__init__(self, parent, signalManager, name, wantMainArea = 0)
 
-        self.inputs = [("Data", ExampleTable, self.setData, Default), ("Learner for Imputation", orange.Learner, self.setModel)]
-        self.outputs = [("Data", ExampleTable), ("Imputer", orange.ImputerConstructor)]
+        self.inputs = [("Data", ExampleTable, self.setData, Default),
+                       ("Learner for Imputation", orange.Learner, self.setModel)]
+        self.outputs = [("Data", ExampleTable),
+                        ("Imputer", orange.ImputerConstructor)]
 
         self.attrIcons = self.createAttributeIconDict()
 

Orange/OrangeWidgets/Data/OWMergeData.py

-"""
-<name>Merge Data</name>
-<description>Merge datasets based on values of selected attributes.</description>
-<icon>icons/MergeData.svg</icon>
-<priority>1110</priority>
-<contact>Peter Juvan (peter.juvan@fri.uni-lj.si)</contact>
-"""
 import orange
 from OWWidget import *
 import OWGUI
 
+NAME = "Merge Data"
+DESCRIPTION = """Merges data sets based on values of selected attributes."""
+LONG_DESCRIPTION = ""
+ICON = "icons/MergeData.svg"
+PRIORITY = 1110
+AUTHOR = "Peter Juvan"
+AUTHOR_EMAIL = "peter.juvan(@at@)fri.uni-lj.si"
+INPUTS = [("Data A", Orange.data.Table, "onDataAInput"),
+          ("Data B", Orange.data.Table, "onDataBInput")]
+OUTPUTS = [("Merged Data A+B", Orange.data.Table, ),
+           ("Merged Data B+A", Orange.data.Table, )]
+
+
 class OWMergeData(OWWidget):
 
     contextHandlers = {"A": DomainContextHandler("A",

Orange/OrangeWidgets/Data/OWMultiMergeData.py

-"""
-<name>Multi-key Merge Data</name>
-<description>Merge datasets based on values of selected tuples of attributes.</description>
-<icon>icons/MergeData.svg</icon>
-<priority>100</priority>
-<contact>Peter Husen (phusen@bmb.sdu.dk)</contact>
-"""
-
+import Orange
 from OWWidget import *
 from OWItemModels import PyListModel, VariableListModel
 
-#import OWGUI
-import Orange
+NAME = "Multi-Key Merge Data"
+DESCRIPTION = "Merges data sets based on values of selected groups of features."
+LONG_DESCRIPTION = ""
+ICON = "icons/MergeData.svg"
+PRIORITY = 100
+MAINTAINER = "Peter Husen"
+MAINTAINER_EMAIL = "phusen(@at@)bmb.sdu.dk"
+INPUTS = [("Data A", Orange.data.Table, "set_dataA", Default),
+          ("Data B", Orange.data.Table, "set_dataB")]
+OUTPUTS = [("Merged Data A+B", Orange.data.Table, Default),
+           ("Merged Data B+A", Orange.data.Table, )]
 
 
 def slices(indices):
         layout.setMargin(0)
 
         # Available A attributes
-        box = OWGUI.widgetBox(self.controlArea, "Available A attributes", addToLayout=False)
+        box = OWGUI.widgetBox(self.controlArea, "Features in data set A", addToLayout=False)
         self.available_attrsA = VariablesListItemModel()
         self.available_attrsA_view = VariablesListItemView()
         self.available_attrsA_view.setModel(self.available_attrsA)
 
 
         # Used A Attributes
-        box = OWGUI.widgetBox(self.controlArea, "Used A attributes", addToLayout=False)
+        box = OWGUI.widgetBox(self.controlArea, "Used features from A", addToLayout=False)
         self.used_attrsA = VariablesListItemModel()
         self.used_attrsA_view = VariablesListItemView()
         self.used_attrsA_view.setModel(self.used_attrsA)
 
         # Data A info
         box = OWGUI.widgetBox(self, 'Data A', orientation = "vertical", addToLayout=0)
-        self.lblDataAExamples = OWGUI.widgetLabel(box, "num examples")
-        self.lblDataAAttributes = OWGUI.widgetLabel(box, "num attributes")
+        self.lblDataAExamples = OWGUI.widgetLabel(box, "#data instances")
+        self.lblDataAAttributes = OWGUI.widgetLabel(box, "#features")
         layout.addWidget(box, 1, 1, 1, 2)
 
 
         # Available B attributes
-        box = OWGUI.widgetBox(self.controlArea, "Available B attributes", addToLayout=False)
+        box = OWGUI.widgetBox(self.controlArea, "Features in data set B", addToLayout=False)
         self.available_attrsB = VariablesListItemModel()
         self.available_attrsB_view = VariablesListItemView()
         self.available_attrsB_view.setModel(self.available_attrsB)
 
 
         # Used B Attributes
-        box = OWGUI.widgetBox(self.controlArea, "Used B attributes", addToLayout=False)
+        box = OWGUI.widgetBox(self.controlArea, "Used features from A", addToLayout=False)
         self.used_attrsB = VariablesListItemModel()
         self.used_attrsB_view = VariablesListItemView()
         self.used_attrsB_view.setModel(self.used_attrsB)
         layout.addWidget(box, 2, 2, 1, 1)
 
         box = OWGUI.widgetBox(self, 'Data B', orientation = "vertical", addToLayout=0)
-        self.lblDataBExamples = OWGUI.widgetLabel(box, "num examples")
-        self.lblDataBAttributes = OWGUI.widgetLabel(box, "num attributes")
+        self.lblDataBExamples = OWGUI.widgetLabel(box, "#data instances")
+        self.lblDataBAttributes = OWGUI.widgetLabel(box, "#features")
         layout.addWidget(box, 3, 1, 1, 2)
 
 

Orange/OrangeWidgets/Data/OWOutliers.py

-"""
-<name>Outliers</name>
-<description>Indentification of outliers</description>
-<icon>icons/Outliers.svg</icon>
-<contact>Marko Toplak (marko.toplak(@at@)gmail.com)</contact> 
-<priority>2150</priority>
-"""
-
 from OWWidget import *
 import OWGUI, orange
 import orngOutlier
 from exceptions import Exception
 
+NAME = "Outliers"
+DESCRIPTION = """Identifies data instances distant from other observations."""
+LONG_DESCRIPTION = ""
+ICON = "icons/Outliers.svg"
+PRIORITY = 2150
+AUTHOR = "Marko Toplak"
+AUTHOR_EMAIL = "marko.toplak(@at@)gmail.com"
+INPUTS = [("Data", Orange.data.Table, "cdata", Default),
+          ("Distances", orange.SymMatrix, "cdistance", Default)]
+OUTPUTS = [("Outliers", Orange.data.Table, Default),
+           ("Inliers", Orange.data.Table),
+           ("Data with z-score", Orange.data.Table)]
+
+
 ##############################################################################
 
 class OWOutliers(OWWidget):
     settingsList = ["zscore", "metric", "k"]
     
     def __init__(self, parent=None, signalManager = None, name='Outlier'):
-        OWWidget.__init__(self, parent, signalManager, name, wantMainArea = 0)
+        OWWidget.__init__(self, parent, signalManager, name, wantMainArea=0)
 
-        self.inputs = [("Data", ExampleTable, self.cdata),("Distances", orange.SymMatrix, self.cdistance)]
-        self.outputs = [("Outliers", ExampleTable), ("Inliers", ExampleTable), ("Data with z-score", ExampleTable)]
+        self.inputs = [("Data", ExampleTable, self.cdata),
+                       ("Distances", orange.SymMatrix, self.cdistance)]
+        self.outputs = [("Outliers", ExampleTable),
+                        ("Inliers", ExampleTable),
+                        ("Data with z-score", ExampleTable)]
                
         # Settings
         self.zscore = '4.0'
         kernelSizeValid = QDoubleValidator(self.controlArea)
 
 
-        self.metrics = [("Euclidean", orange.ExamplesDistanceConstructor_Euclidean),
-                        ("Manhattan", orange.ExamplesDistanceConstructor_Manhattan),
-                        ("Hamming", orange.ExamplesDistanceConstructor_Hamming),
-                        ("Relief", orange.ExamplesDistanceConstructor_Relief)]
+        self.metrics = [("Euclidean",
+                         orange.ExamplesDistanceConstructor_Euclidean),
+                        ("Manhattan",
+                         orange.ExamplesDistanceConstructor_Manhattan),
+                        ("Hamming",
+                         orange.ExamplesDistanceConstructor_Hamming),
+                        ("Relief",
+                         orange.ExamplesDistanceConstructor_Relief)]
 
         self.ks = [("All",0), ("1", 1), ("2",2), ("3",3), ("5",5), ("10",10), ("15",15)]
         items = [x[0] for x in self.metrics]
         itemsk = [x[0] for x in self.ks]
         
-        OWGUI.comboBox(self.controlArea, self, "metric", box="Distance Metrics", items=items,
+        OWGUI.comboBox(self.controlArea, self, "metric",
+                       box="Distance Metrics", items=items,
                        tooltip="Metrics to measure pairwise distance between data instances.",
                        callback=self.dataChange)
 
         OWGUI.separator(self.controlArea)
-        OWGUI.comboBox(self.controlArea, self, "k", box="Nearest Neighbours", items=itemsk,
+        OWGUI.comboBox(self.controlArea, self, "k",
+                       box="Nearest Neighbours", items=itemsk,
                        tooltip="Neighbours considered when computing the distance.",
                        callback=self.applySettings)
 
             self.haveInput = 1     
         elif self.dataInput is not None:
             self.data = self.dataInput
-            outlier.setExamples(self.data, self.metrics[self.metric][1](self.data))        
+            outlier.setExamples(self.data,
+                                self.metrics[self.metric][1](self.data))
             self.haveInput = 1
         else:
             self.data = None

Orange/OrangeWidgets/Data/OWPaintData.py

-"""
-<name>Paint Data</name>
-<description>Paints the data on a 2D plane. Place individual data
-points or use brush to paint a larger data sets.</description>
-<contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact>
-<priority>40</priority>
-<icon>icons/PaintData.svg</icon>
-"""
 import orange
-
 import copy
-
+import OWToolbars
+import OWColorPalette
+import Orange.data
 from PyQt4 import QtCore
-
 from OWWidget import *
 from OWGraph import *
-import OWToolbars
+from OWItemModels import VariableListModel, PyListModel, ModelActionsWidget
 
-from OWItemModels import VariableListModel, PyListModel, ModelActionsWidget
-import OWColorPalette
+NAME = "Paint Data"
+DESCRIPTION = """Paints the data on a 2D plane. Place individual data
+points or use brush to paint a larger data sets."""
+LONG_DESCRIPTION = ""
+ICON = "icons/PaintData.svg"
+PRIORITY = 40
+AUTHOR = "Ales Erjavec"
+AUTHOR_EMAIL = "ales.erjavec(@at@)fri.uni-lj.si"
+OUTPUTS = [("Data", Orange.data.Table, )]
 
 dir = OWToolbars.dir
 icon_magnet = os.path.join(dir, "magnet_64px.png")

Orange/OrangeWidgets/Data/OWPreprocess.py

-"""<name>Preprocess</name>
-<description>Construct and apply data preprocessors</description>
-<icon>icons/Preprocess.svg</icon>
-<priority>2105</priority>
-<contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact>
-"""
-
 from OWWidget import *
 from OWItemModels import PyListModel, ListSingleSelectionModel, ModelActionsWidget
 import OWGUI, OWGUIEx
 import orngWrap
 import orngSVM
 
-import sys, os
-import math
+import sys
 
 from Orange.data import preprocess
 
+NAME = "Preprocess"
+DESCRIPTION = """Supports construction of data preprocessors.
+Can apply them on input data sets or offer them to predictors."""
+LONG_DESCRIPTION = ""
+ICON = "icons/Preprocess.svg"
+PRIORITY = 2105
+AUTHOR = "Ales Erjavec"
+AUTHOR_EMAIL = "ales.erjavec(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "setData")]
+OUTPUTS = [("Preprocess", orngWrap.PreprocessedLearner, ),
+           ("Preprocessed Data", Orange.data.Table, )]
+
+
 def _gettype(obj):
     """ Return type of obj. If obj is type return obj.
     """
         return obj
     else:
         return type(obj)
-        
+
+
 def _pyqtProperty(type, **kwargs):
     # check for Qt version, 4.4 supports only C++ classes 
     if qVersion() >= "4.5":
             del kwargs["user"]
         return property(**kwargs)
 
+
 ## Preprocessor item editor widgets
 class BaseEditor(OWBaseWidget):
     def __init__(self, parent=None):
     def __init__(self, parent=None, signalManager=None, name="Preprocess"):
         OWWidget.__init__(self, parent, signalManager, name)
         
-        self.inputs = [("Data", ExampleTable, self.setData)] #, ("Learner", orange.Learner, self.setLearner)]
-        self.outputs = [("Preprocess", orngWrap.PreprocessedLearner), ("Preprocessed Data", ExampleTable)] #, ("Preprocessor", orange.Preprocessor)]
+        self.inputs = [("Data", Orange.data.Table, self.setData)]
+        self.outputs = [("Preprocess", orngWrap.PreprocessedLearner),
+                        ("Preprocessed Data", Orange.data.Table)]
         
         self.autoCommit = False
         self.changedFlag = False

Orange/OrangeWidgets/Data/OWPurgeDomain.py

-"""
-<name>Purge Domain</name>
-<description>Removes redundant values and attributes, sorts values.</description>
-<icon>icons/PurgeDomain.svg</icon>
-<contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact>
-<priority>1105</priority>
-"""
 from OWWidget import *
 import OWGUI
 
 import orange
 
+NAME = "Purge Domain"
+DESCRIPTION = "Removes redundant values and features, sorts domain values."
+LONG_DESCRIPTION = ""
+ICON = "icons/PurgeDomain.svg"
+PRIORITY = 1150
+AUTHOR = "Janez Demsar"
+AUTHOR_EMAIL = "janez.demsar(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "setData")]
+OUTPUTS = [("Data", Orange.data.Table)]
+
+
 class OWPurgeDomain(OWWidget):
 
     def __init__(self, parent=None, signalManager=None):

Orange/OrangeWidgets/Data/OWPythonScript.py

-"""
-<name>Python Script</name>
-<description>Executes python script.</description>
-<icon>icons/PythonScript.svg</icon>
-<contact>Miha Stajdohar (miha.stajdohar(@at@)gmail.com)</contact>
-<priority>3150</priority>
-"""
 import sys
 import os
 import code
 import OWGUI
 import Orange
 
+NAME = "Python Script"
+DESCRIPTION = "Executes a Python script."
+LONG_DESCRIPTION = ""
+ICON = "icons/PythonScript.svg"
+PRIORITY = 3150
+AUTHOR = "Miha Stajdohar"
+AUTHOR_EMAIL = "miha.stajdohar(@at@)gmail.com"
+
+INPUTS = [("in_data", Orange.data.Table, "setExampleTable", Default),
+          ("in_distance", Orange.misc.SymMatrix, "setDistanceMatrix", Default),
+          ("in_learner", Orange.core.Learner, "setLearner", Default),
+          ("in_classifier", Orange.core.Classifier, "setClassifier", Default),
+          ("in_object", object, "setObject")]
+
+OUTPUTS = [("out_data", Orange.data.Table, ),
+           ("out_distance", Orange.misc.SymMatrix, ),
+           ("out_learner", Orange.core.Learner, ),
+           ("out_classifier", Orange.core.Classifier, Dynamic),
+           ("out_object", object, Dynamic)]
+
 
 class PythonSyntaxHighlighter(QSyntaxHighlighter):
     def __init__(self, parent=None):

Orange/OrangeWidgets/Data/OWRank.py

-"""
-<name>Rank</name>
-<description>Ranks and filters attributes by their relevance.</description>
-<icon>icons/Rank.svg</icon>
-<contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact>
-<priority>1102</priority>
-"""
-
+import OWGUI
+import Orange
+import pkg_resources
 from collections import namedtuple
 from functools import partial
-
-import pkg_resources
-
 from OWWidget import *
-
-import OWGUI
-
-import Orange
 from Orange.feature import scoring
 from Orange.classification import svm
 from Orange.ensemble import forest
 
+NAME = "Rank"
+DESCRIPTION = "Ranks and filters data features by their relevance."
+LONG_DESCRIPTION = ""
+ICON = "icons/Rank.svg"
+PRIORITY = 1102
+AUTHOR = "Janez Demsar"
+AUTHOR_EMAIL = "janez.demsar(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "setData")]
+OUTPUTS = [("Reduced Data", Orange.data.Table, Default + Single)]
+
 
 def is_discrete(var):
     return isinstance(var, Orange.feature.Discrete)

Orange/OrangeWidgets/Data/OWSave.py

-"""
-<name>Save</name>
-<description>Saves data to file.</description>
-<icon>icons/Save.svg</icon>
-<contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact>
-<priority>90</priority>
-"""
-
 from OWWidget import *
 import OWGUI
 import re, os.path
 from exceptions import Exception
 
+NAME = "Save"
+DESCRIPTION = "Saves data to file."
+LONG_DESCRIPTION = ""
+ICON = "icons/Save.svg"
+PRIORITY = 90
+AUTHOR = "Janez Demsar"
+AUTHOR_EMAIL = "janez.demsar(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "dataset", Default)]
+
+
 class OWSave(OWWidget):
-    settingsList=["recentFiles","selectedFileName"]
+    settingsList = ["recentFiles", "selectedFileName"]
 
-    savers = {".txt": orange.saveTxt, ".tab": orange.saveTabDelimited,
-              ".names": orange.saveC45, ".test": orange.saveC45, ".data": orange.saveC45,
+    savers = {".txt": orange.saveTxt,
+              ".tab": orange.saveTabDelimited,
+              ".names": orange.saveC45,
+              ".test": orange.saveC45,
+              ".data": orange.saveC45,
               ".csv": orange.saveCsv
               }
 
 
         #self.adjustSize()
         self.setFilelist()
-        self.resize(260,100)
+        self.resize(260, 100)
         self.filecombo.setCurrentIndex(0)
 
         if self.selectedFileName != "":
                 return
             self.error()
 
-    def addFileToList(self,fn):
+    def addFileToList(self, fn):
         if fn in self.recentFiles:
             self.recentFiles.remove(fn)
         self.recentFiles.insert(0,fn)
         self.setFilelist()
 
     def setFilelist(self):
-        "Set the GUI filelist"
+        """Set the GUI filelist"""
         self.filecombo.clear()
 
         if self.recentFiles:

Orange/OrangeWidgets/Data/OWSelectData.py

-"""
-<name>Select Data</name>
-<description>Selects instances from the data set based on conditions over attributes.</description>
-<icon>icons/SelectData.svg</icon>
-<priority>1150</priority>
-<contact>Peter Juvan (peter.juvan@fri.uni-lj.si)</contact>
-"""
 import orange
 from OWWidget import *
 import OWGUI
 from orngDataCaching import *
 
+NAME = "Select Data"
+DESCRIPTION = "Selects data instances based on conditions over data features."
+LONG_DESCRIPTION = ""
+ICON = "icons/SelectData.svg"
+PRIORITY = 1150
+AUTHOR = "Peter Juvan"
+AUTHOR_EMAIL = "peter.juvan(@at@)fri.uni-lj.si"
+INPUTS = [("Data", Orange.data.Table, "setData")]
+OUTPUTS = [("Matching Data", Orange.data.Table, Default),
+           ("Unmatched Data", Orange.data.Table, )]
+
+
 class OWSelectData(OWWidget):
     settingsList = ["updateOnChange", "purgeAttributes", "purgeClasses"]
-    contextHandlers = {"": PerfectDomainContextHandler(fields = ["Conditions"], matchValues=2)}
+    contextHandlers = {"": PerfectDomainContextHandler(fields=["Conditions"],
+                                                       matchValues=2)}
 
-    def __init__(self, parent = None, signalManager = None, name = "Select data"):
-        OWWidget.__init__(self, parent, signalManager, name, wantMainArea = 0)  #initialize base class
+    def __init__(self, parent=None, signalManager=None, name="Select data"):
+        OWWidget.__init__(self, parent, signalManager, name, wantMainArea=0)
 
         self.inputs = [("Data", ExampleTable, self.setData)]
-        self.outputs = [("Matching Data", ExampleTable, Default), ("Unmatched Data", ExampleTable)]
+        self.outputs = [("Matching Data", ExampleTable, Default),
+                        ("Unmatched Data", ExampleTable)]
 
         self.name2var = {}   # key: variable name, item: orange.Variable
         self.Conditions = []