Changeset 11748:467f952c108d in orange


Ignore:
Timestamp:
11/01/13 02:09:11 (6 months ago)
Author:
blaz <blaz.zupan@…>
Branch:
default
Message:

Changes in headers, widget descriptions text.

Location:
Orange/OrangeWidgets/Data
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Data/OWConcatenate.py

    r11096 r11748  
    1 """ 
    2 <name>Concatenate</name> 
    3 <description>Concatenates Example Tables.</description> 
    4 <icon>icons/Concatenate.svg</icon> 
    5 <priority>1111</priority> 
    6 <contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact> 
    7 """ 
    8  
     1import Orange 
    92from OWWidget import * 
    103import OWGUI 
    114from itertools import izip 
     5 
     6NAME = "Concatenate" 
     7DESCRIPTION = "Concatenates data tables." 
     8ICON = "icons/Concatenate.svg" 
     9PRIORITY = 1111 
     10MAINTAINER = "Janez Demsar" 
     11MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si" 
     12INPUTS = [("Primary Data", Orange.data.Table, "setData"), 
     13          ("Additional Data", Orange.data.Table, "setMoreData", Multiple)] 
     14OUTPUTS = [("Data", Orange.data.Table, )] 
     15 
    1216 
    1317class OWConcatenate(OWWidget): 
     
    1620    def __init__(self,parent=None, signalManager = None): 
    1721        OWWidget.__init__(self, parent, signalManager, "Concatenate", wantMainArea=0) 
    18         self.inputs = [("Primary Data", orange.ExampleTable, self.setData), ("Additional Data", orange.ExampleTable, self.setMoreData, Multiple)] 
     22        self.inputs = [("Primary Data", orange.ExampleTable, self.setData), 
     23                       ("Additional Data", orange.ExampleTable, self.setMoreData, Multiple)] 
    1924        self.outputs = [("Data", ExampleTable)] 
    2025 
     
    190195    app = QApplication(sys.argv) 
    191196    w = OWConcatenate() 
    192     data = orange.ExampleTable("../../doc/datasets/iris.tab") 
     197    data = Orange.data.Table("iris.tab") 
    193198    w.setData(data) 
    194199    w.setMoreData(data, 0) 
  • Orange/OrangeWidgets/Data/OWContinuize.py

    r11668 r11748  
    1 """ 
    2 <name>Continuize</name> 
    3 <description>Transform discrete attributes into continuous. Optionally, normalize the continuous values.</description> 
    4 <icon>icons/Continuize.svg</icon> 
    5 <contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact> 
    6 <priority>2110</priority> 
    7 """ 
    8 # 
    9 # OWContinuize.py 
    10 # Continuize Widget 
    11 # Turns discrete attributes into continuous 
    12 # 
     1import Orange 
    132from OWWidget import * 
    143from orngWrap import PreprocessedLearner 
    154import OWGUI 
     5 
     6NAME = "Continuize" 
     7DESCRIPTION = """Turns discrete features into continuous. 
     8Can also normalize existing continuous features.""" 
     9ICON = "icons/Continuize.svg" 
     10PRIORITY = 2110 
     11CATEGORY = "Data" 
     12MAINTAINER = "Janez Demsar" 
     13MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si" 
     14INPUTS = [("Data", Orange.data.Table, "setData")] 
     15OUTPUTS = [("Data", Orange.data.Table, ), 
     16           ("Preprocessor", PreprocessedLearner, )] 
    1617 
    1718class OWContinuize(OWWidget): 
     
    171172    a = QApplication(sys.argv) 
    172173    ow = OWContinuize() 
    173     #data = orange.ExampleTable("d:\\ai\\orange\\test\\iris") 
    174 #    data = orange.ExampleTable(r"E:\Development\Orange Datasets\UCI\iris.tab") 
    175     data = orange.ExampleTable("../../doc/datasets/iris.tab") 
     174    data = Orange.data.Table("iris.tab") 
    176175    ow.setData(data) 
    177176    ow.show() 
  • Orange/OrangeWidgets/Data/OWDataDomain.py

    r11747 r11748  
    1 """ 
    2 <name>Select Attributes</name> 
    3 <description>Manual selection of attributes.</description> 
    4 <icon>icons/SelectAttributes.svg</icon> 
    5 <priority>1100</priority> 
    6 <contact>Ales Erjavec (ales.erjavec@fri.uni-lj.si)</contact> 
    7 """ 
    8  
    91import sys 
    10  
     2import Orange 
    113from OWWidget import * 
    124from OWItemModels import PyListModel, VariableListModel 
    135 
    14 import Orange 
     6NAME = "Select Attributes" 
     7DESCRIPTION = "Supports manual selection of data features." 
     8ICON = "icons/SelectAttributes.svg" 
     9PRIORITY = 1100 
     10CATEGORY = "Data" 
     11MAINTAINER = "Ales Erjavec" 
     12MAINTAINER_EMAIL = "ales.erjavec < at > fri.uni-lj.si" 
     13INPUTS = [("Data", Orange.data.Table, "set_data", Default)] 
     14OUTPUTS = [("Data", Orange.data.Table, ), 
     15           ("Features", AttributeList, )] 
     16 
    1517 
    1618def slices(indices): 
     
    2729                first = last = i 
    2830        yield first, last + 1 
    29          
     31 
     32 
    3033def source_model(view): 
    3134    """ Return the source model for the Qt Item View if it uses 
     
    3740    else: 
    3841        return view.model() 
     42 
    3943 
    4044def source_indexes(indexes, view): 
     
    4751        return indexes  
    4852             
     53 
    4954def delslice(model, start, end): 
    5055    """ Delete the start, end slice (rows) from the model.  
     
    5762        raise TypeError(type(model)) 
    5863         
     64 
    5965class VariablesListItemModel(VariableListModel): 
    6066    """ An Qt item model for for list of orange.Variable objects. 
  • Orange/OrangeWidgets/Data/OWDataInfo.py

    r11720 r11748  
    1 """<name>Info</name> 
    2 <description>Displays basic information about data set on the input. Shows 
    3 sample size, and number and type of features.</description> 
    4 <icon>icons/DataInfo.svg</icon> 
    5 <priority>80</priority> 
    6 <contact>Ales Erjavec (ales.erjavec@fri.uni-lj.si)</contact>""" 
     1import Orange 
     2import OWGUI 
     3from OWWidget import * 
     4import sys 
    75 
    8 from OWWidget import * 
    9 import OWGUI 
     6NAME = "Info" 
     7DESCRIPTION = """Displays basic information about data set on the input. Shows 
     8sample size, and number and type of features.""" 
     9ICON = "icons/DataInfo.svg" 
     10PRIORITY = 80 
     11CATEGORY = "Data" 
     12MAINTAINER = "Ales Erjavec" 
     13MAINTAINER_EMAIL = "ales.erjavec < at > fri.uni-lj.si" 
     14INPUTS = [("Data", Orange.data.Table, "data")] 
     15OUTPUTS = [] 
    1016 
    11 import orange 
    12 import sys, os 
    1317 
    1418class OWDataInfo(OWWidget): 
     
    2731        box = OWGUI.widgetBox(self.controlArea, "Data Set Size", addSpace=True) 
    2832        OWGUI.label(box, self, '<table><tr><td width="150">Samples (rows):</td><td align="right" width="60">%(rowcount)7i</td></tr>\ 
    29                                 <tr><td>Attributes (columns):</td><td align="right">%(columncount)7i</td></tr></table>') 
     33                                <tr><td>Features (columns):</td><td align="right">%(columncount)7i</td></tr></table>') 
    3034         
    31         box = OWGUI.widgetBox(self.controlArea, "Attributes") 
    32         OWGUI.label(box, self, '<table><tr><td width="150">Discrete attributes:</td><td align="right" width="60">%(discattrcount)7i</td></tr>\ 
    33                                 <tr><td>Continuous attributes:</td><td align="right">%(contattrcount)7i</td></tr>\ 
    34                                 <tr><td>String attributes:</td><td align="right">%(stringattrcount)7i</td></tr>\ 
     35        box = OWGUI.widgetBox(self.controlArea, "Features") 
     36        OWGUI.label(box, self, '<table><tr><td width="150">Discrete:</td><td align="right" width="60">%(discattrcount)7i</td></tr>\ 
     37                                <tr><td>Continuous:</td><td align="right">%(contattrcount)7i</td></tr>\ 
     38                                <tr><td>String:</td><td align="right">%(stringattrcount)7i</td></tr>\ 
    3539                                <tr><td> </td></tr>\ 
    36                                 <tr><td>Meta attributes:</td><td align="right">%(metaattrcount)7i</td></tr>\ 
    37                                 <tr><td>Class attribute:</td><td align="right">%(classattr)7s</td></tr></table>') 
     40                                <tr><td>Meta features:</td><td align="right">%(metaattrcount)7i</td></tr>\ 
     41                                <tr><td>Class variable present:</td><td align="right">%(classattr)7s</td></tr></table>') 
    3842#        OWGUI.separator(box) 
    3943#        OWGUI.label(box, self, '<table><tr><td width="100">Meta attributes:</td><td align="right" width="50">%(metaattrcount)7i</td></tr>\ 
     
    4448         
    4549        self.loadSettings() 
    46          
    47          
     50 
    4851    def data(self, data): 
    4952        if data: 
     
    6770    app = QApplication(sys.argv) 
    6871    w = OWDataInfo() 
    69     data = orange.ExampleTable("../../doc/datasets/iris.tab") 
     72    data = Orange.data.Table("iris.tab") 
    7073    w.data(data) 
    7174    w.show() 
  • Orange/OrangeWidgets/Data/OWDataSampler.py

    r11096 r11748  
    1 r""" 
    2 <name>Data Sampler</name> 
    3 <description>Selects a subset of instances from the data set.</description> 
    4 <icon>icons/DataSampler.svg</icon> 
    5 <contact>Aleksander Sadikov (aleksander.sadikov(@at@)fri.uni-lj.si)</contact> 
    6 <priority>1125</priority> 
    7 """ 
     1import random 
     2import Orange 
     3import OWGUI 
    84from OWWidget import * 
    9 import OWGUI 
    10 import random 
     5 
     6NAME = "Data Sampler" 
     7DESCRIPTION = "Samples data from a data set." 
     8ICON = "icons/DataSampler.svg" 
     9PRIORITY = 1125 
     10CATEGORY = "Data" 
     11MAINTAINER = "Aleksander Sadikov" 
     12MAINTAINER_EMAIL = "aleksander.sadikov(@at@)fri.uni-lj.si" 
     13INPUTS = [("Data", Orange.data.Table, "setData", Default)] 
     14OUTPUTS = [("Data Sample", Orange.data.Table, ), 
     15           ("Remaining Data", Orange.data.Table, )] 
     16 
    1117 
    1218class OWDataSampler(OWWidget): 
    1319    settingsList=["Stratified", "Repeat", "UseSpecificSeed", "RandomSeed", 
    14     "GroupSeed", "outFold", "Folds", "SelectType", "useCases", "nCases", "selPercentage", "LOO", 
     20    "GroupSeed", "outFold", "Folds", "SelectType", "useCases", "nCases", 
     21    "selPercentage", "LOO", 
    1522    "CVFolds", "CVFoldsInternal", "nGroups", "pGroups", "GroupText"] 
    1623     
     
    337344    appl = QApplication(sys.argv) 
    338345    ow = OWDataSampler() 
    339     data = orange.ExampleTable('../../doc/datasets/iris.tab') 
     346    data = Orange.data.Table('iris.tab') 
    340347    ow.setData(data) 
    341348    ow.show() 
  • Orange/OrangeWidgets/Data/OWDataTable.py

    r11744 r11748  
    1 """ 
    2 <name>Data Table</name> 
    3 <description>Shows data in a spreadsheet.</description> 
    4 <icon>icons/DataTable.svg</icon> 
    5 <priority>100</priority> 
    6 <contact>Peter Juvan (peter.juvan@fri.uni-lj.si)</contact> 
    7 """ 
    8  
    91import sys 
    102import math 
    113import csv 
    124import itertools 
    13  
     5import sip 
     6import Orange 
     7import OWGUI 
    148from StringIO import StringIO 
    159from xml.sax.saxutils import escape 
    1610from functools import wraps 
    17  
    18 import sip 
    19  
    20 import Orange 
    21  
    2211from OWWidget import * 
    23 import OWGUI 
    2412from orngDataCaching import * 
    2513import OWColorPalette 
    2614 
    2715NAME = "Data Table" 
    28  
    2916DESCRIPTION = "Displays data in a spreadsheet." 
    30  
    31 LONG_DESCRIPTION = """Data Table widget takes one or more data sets 
    32 on its input and presents them in a spreadsheet format. 
    33 """ 
    34  
     17LONG_DESCRIPTION = "" 
    3518ICON = "icons/DataTable.svg" 
    36  
    3719PRIORITY = 100 
    38  
    39 AUTHOR = "Peter Juvan" 
    40  
    41 AUTHOR_EMAIL = "peter.juvan(@at@)fri.uni-lj.si" 
    42  
    43 INPUTS = [("Data", ExampleTable, "dataset", Multiple + Default)] 
    44  
    45 OUTPUTS = [("Selected Data", ExampleTable, Default), 
    46            ("Other Data", ExampleTable)] 
     20AUTHOR = "Ales Erjavec" 
     21AUTHOR_EMAIL = "ales.erjavec(@at@)fri.uni-lj.si" 
     22INPUTS = [("Data", Orange.data.Table, "dataset", Multiple + Default)] 
     23OUTPUTS = [("Selected Data", Orange.data.Table, Default), 
     24           ("Other Data", Orange.data.Table, )] 
    4725 
    4826 
     
    950928        yield start, end + 1 
    951929 
    952  
    953 def test(): 
     930if __name__ == "__main__": 
    954931    a = QApplication(sys.argv) 
    955932    ow = OWDataTable() 
     
    969946    a.exec_() 
    970947    ow.saveSettings() 
    971  
    972  
    973 if __name__ == "__main__": 
    974     test() 
  • Orange/OrangeWidgets/Data/OWDiscretize.py

    r11287 r11748  
    1 """ 
    2 <name>Discretize</name> 
    3 <description>Discretization of continuous attributes.</description> 
    4 <icon>icons/Discretize.svg</icon> 
    5 <contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact> 
    6 <priority>2100</priority> 
    7 """ 
    8  
    91import orange 
    102from OWWidget import * 
     
    124import OWGUI 
    135 
    14  
    156NAME = "Discretize" 
    167DESCRIPTION = "Discretization of continuous attributes." 
    17  
    188MAINTAINER = "Ales Erjavec" 
    199MAINTAINER_EMAIL = "ales.erjavec < at > fri.uni-lj.si" 
    20  
    2110CATEGORY = "Data" 
    2211PRIORITY = 2100 
    2312ICON = "icons/Discretize.svg" 
    24  
    2513INPUTS = [("Data", orange.ExampleTable, "setData")] 
    26 OUTPUTS = [("Data", orange.ExampleTable,)] 
    27  
     14OUTPUTS = [("Data", orange.ExampleTable, )] 
    2815WIDGET_CLASS = "OWDiscretize" 
    2916 
  • Orange/OrangeWidgets/Data/OWEditDomain.py

    r11432 r11748  
    1 """ 
    2 <name>Edit Domain</name> 
    3 <description>Edit domain variables</description> 
    4 <icon>icons/EditDomain.svg</icon> 
    5 <contact>Ales Erjavec (ales.erjavec(@ at @)fri.uni-lj.si)</contact> 
    6 <priority>3125</priority> 
    7 <keywords>change,name,variable,domain</keywords> 
    8 """ 
    9  
    101from OWWidget import * 
    112from OWItemModels import VariableListModel, PyListModel 
     
    145 
    156import Orange 
     7 
     8NAME = "Edit Domain" 
     9DESCRIPTION = """Supports renaming of features and their values.""" 
     10ICON = "icons/EditDomain.svg" 
     11PRIORITY = 3125 
     12AUTHOR = "Ales Erjavec" 
     13AUTHOR_EMAIL = "ales.erjavec(@at@)fri.uni-lj.si" 
     14INPUTS = [("Data", Orange.data.Table, "set_data")] 
     15OUTPUTS = [("Data", Orange.data.Table, )] 
    1616 
    1717 
  • Orange/OrangeWidgets/Data/OWFeatureConstructor.py

    r11713 r11748  
    1 """ 
    2 <name>Feature Constructor</name> 
    3 <description>Construct a new continuous attribute computed from existing attributes.</description> 
    4 <icon>icons/FeatureConstructor.svg</icon> 
    5 <priority>3100</priority> 
    6 <contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact> 
    7 """ 
    8  
    91from OWWidget import * 
    102import OWGUI, math, re 
     
    124import inspect 
    135 
     6NAME = "Feature Constructor" 
     7DESCRIPTION = "Constructs new features computed from existing ones." 
     8ICON = "icons/FeatureConstructor.svg" 
     9MAINTAINER = "Janez Demsar" 
     10MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si" 
     11PRIORITY = 3100 
     12CATEGORY = "Data" 
     13INPUTS = [("Data", Orange.data.Table, "setData")] 
     14OUTPUTS = [("Data", Orange.data.Table, )] 
     15 
    1416re_identifier = re.compile(r'([a-zA-Z_]\w*)|("[^"]+")') 
     17 
    1518 
    1619class IdentifierReplacer: 
     
    2831            return "_ex['%s']" % id 
    2932        return id 
     33 
    3034 
    3135class AttrComputer: 
     
    4246                       "triangular": random.triangular, 
    4347                       "uniform": random.uniform}.items()) 
     48 
    4449    def __init__(self, expression): 
    4550        self.expression = expression 
     
    5156            return "?" 
    5257 
     58 
    5359class OWFeatureConstructor(OWWidget): 
    5460    contextHandlers = {"": PerfectDomainContextHandler()} 
     
    6167 
    6268        self.expression = self.attrname = "" 
    63         self.selectedDef = [] 
    64         self.defLabels = [] 
     69        self.selected_def = [] 
     70        self.def_labels = [] 
    6571        self.data = None 
    6672        self.definitions = [] 
    6773 
    68         self.selectedAttr = 0 
     74        self.selected_features = 0 
    6975        self.selectedFunc = 0 
    7076        self.autosend = True 
     
    8086        self.leExpression = OWGUI.lineEdit(vb, self, "expression", "Expression") 
    8187        hhb = OWGUI.widgetBox(vb, None, "horizontal") 
    82         self.cbAttrs = OWGUI.comboBox(hhb, self, "selectedAttr", items = ["(all attributes)"], callback = self.attrListSelected) 
     88        self.cbAttrs = OWGUI.comboBox(hhb, self, "selected_features", items = ["(all attributes)"], callback = self.feature_list_selected) 
    8389        sortedFuncs = sorted(m for m in AttrComputer.FUNCTIONS.keys()) 
    8490        self.cbFuncs = OWGUI.comboBox(hhb, self, "selectedFunc", items = ["(all functions)"] + sortedFuncs, callback = self.funcListSelected) 
     
    9298        OWGUI.button(hb, self, "Add", callback = self.addAttr, autoDefault=True) 
    9399        OWGUI.button(hb, self, "Update", callback = self.updateAttr) 
    94         OWGUI.button(hb, self, "Remove", callback = self.removeAttr) 
    95         OWGUI.button(hb, self, "Remove All", callback = self.removeAllAttr) 
    96  
    97         self.lbDefinitions = OWGUI.listBox(db, self, "selectedDef", "defLabels", callback=self.selectAttr) 
     100        OWGUI.button(hb, self, "Remove", callback = self.remove_feature) 
     101        OWGUI.button(hb, self, "Remove All", callback = self.remove_all_features) 
     102 
     103        self.lbDefinitions = OWGUI.listBox(db, self, "selected_def", 
     104                                           "def_labels", 
     105                                           callback=self.select_feature) 
    98106        self.lbDefinitions.setFixedHeight(160) 
    99107 
     
    110118    def settingsToWidgetCallback(self, handler, context): 
    111119        self.definitions = getattr(context, "definitions", []) 
    112         self.defLabels = ["%s := %s" % t for t in self.definitions] 
    113         self.selectedDef = [] 
     120        self.def_labels = ["%s := %s" % t for t in self.definitions] 
     121        self.selected_def = [] 
    114122 
    115123    def setData(self, data): 
     
    120128        if self.data: 
    121129            self.cbAttrs.addItems([attr.name for attr in self.data.domain]) 
    122         self.removeAllAttr() 
     130        self.remove_all_features() 
    123131        self.openContext("", data) 
    124132        self.apply() 
     
    144152        if not attrexpr: 
    145153            return 
    146         self.defLabels = self.defLabels + ["%s := %s" % attrexpr] # should be like this to update the listbox 
     154        self.def_labels = self.def_labels + ["%s := %s" % attrexpr] # should be like this to update the listbox 
    147155        self.definitions.append(attrexpr) 
    148156        self.expression = self.attrname = "" 
    149         self.applyIf() 
     157        self.apply_if() 
    150158 
    151159    def updateAttr(self): 
    152         if self.selectedDef: 
    153             selected = self.selectedDef[0] 
     160        if self.selected_def: 
     161            selected = self.selected_def[0] 
    154162            attrexpr = self.getAttrExpression(selected) 
    155163            if not attrexpr: 
    156164                return 
    157165             # should be like this to reset the listbox 
    158             self.defLabels = self.defLabels[:selected] + ["%s := %s" % attrexpr] + self.defLabels[selected+1:] 
     166            self.def_labels = self.def_labels[:selected] + ["%s := %s" % attrexpr] + self.def_labels[selected+1:] 
    159167            self.definitions[selected] = attrexpr 
    160             self.applyIf() 
    161  
    162     def removeAttr(self): 
    163         if self.selectedDef: 
    164             selected = self.selectedDef[0] 
     168            self.apply_if() 
     169 
     170    def remove_feature(self): 
     171        if self.selected_def: 
     172            selected = self.selected_def[0] 
    165173            if 0 <= selected < self.lbDefinitions.count(): 
    166                 self.defLabels = self.defLabels[:selected] + self.defLabels[selected+1:] 
     174                self.def_labels = self.def_labels[:selected] + self.def_labels[selected+1:] 
    167175                del self.definitions[selected] 
    168                 self.applyIf() 
    169  
    170     def removeAllAttr(self): 
    171         self.defLabels = [] 
     176                self.apply_if() 
     177 
     178    def remove_all_features(self): 
     179        self.def_labels = [] 
    172180        self.definitions = [] 
    173         self.selectedDef = [] 
     181        self.selected_def = [] 
    174182        self.expression = "" 
    175         self.applyIf() 
    176  
    177     def selectAttr(self): 
    178         if self.selectedDef: 
    179             self.attrname, self.expression = self.definitions[self.selectedDef[0]] 
     183        self.apply_if() 
     184 
     185    def select_feature(self): 
     186        if self.selected_def: 
     187            self.attrname, self.expression = self.definitions[self.selected_def[0]] 
    180188        else: 
    181189            self.attrname = self.expression = "" 
    182190 
    183     def insertIntoExpression(self, what): 
     191    def insert_into_expression(self, what): 
    184192        # Doesn't work: clicking the listbox removes the selection 
    185193        if self.leExpression.hasSelectedText(): 
     
    189197        self.leExpression.setFocus() 
    190198 
    191     def attrListSelected(self): 
    192         if self.selectedAttr: 
    193             attr = str(self.cbAttrs.itemText(self.selectedAttr)) 
     199    def feature_list_selected(self): 
     200        if self.selected_features: 
     201            attr = str(self.cbAttrs.itemText(self.selected_features)) 
    194202            mo = re_identifier.match(attr) 
    195203            if not mo or mo.span()[1] != len(attr): 
    196204                attr = '"%s"' % attr 
    197             self.insertIntoExpression(attr) 
    198             self.selectedAttr = 0 
     205            self.insert_into_expression(attr) 
     206            self.selected_features = 0 
    199207 
    200208    def funcListSelected(self): 
     
    205213                        "gauss", "lognormvariate", "betavariate", "gammavariate", 
    206214                        "triangular", "uniform", "vonmisesvariate", "weibullvariate"]: 
    207                 self.insertIntoExpression(func + "(,)") 
     215                self.insert_into_expression(func + "(,)") 
    208216                self.leExpression.cursorBackward(False, 2) 
    209217            elif func in ["e", "pi"]: 
    210                 self.insertIntoExpression(func) 
     218                self.insert_into_expression(func) 
    211219            else: 
    212                 self.insertIntoExpression(func + "()") 
     220                self.insert_into_expression(func + "()") 
    213221                self.leExpression.cursorBackward(False) 
    214222            self.selectedFunc = 0 
    215223 
    216     def applyIf(self): 
     224    def apply_if(self): 
    217225        self.dataChanged = True 
    218226        if self.autosend: 
  • Orange/OrangeWidgets/Data/OWFile.py

    r11745 r11748  
    1 """ 
    2 <name>File</name> 
    3 <description>Reads data from a file.</description> 
    4 <icon>icons/File.svg</icon> 
    5 <contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact> 
    6 <priority>10</priority> 
    7 """ 
    8  
    91import os 
    102import sys 
    113import warnings 
    12  
    134import Orange 
    14  
    155from OWWidget import * 
    166import OWGUI 
    177 
    188NAME = "File" 
    19  
    20 DESCRIPTION = """ 
    21 Reads data from an input file. 
    22 """ 
    23  
    24 LONG_DESCRIPTION = "" 
    25 """ 
    26 This is the widget you will probably use at the start of every schema to read 
    27 the input data file (data table with examples). The widget maintains a 
    28 history of most recently used data files. For convenience, the history 
    29 also includes a directory with the sample data sets that come with Orange. 
    30 """ 
    31  
     9DESCRIPTION = "Reads data from an input file." 
    3210ICON = "icons/File.svg" 
    33 AUTHOR = "Janez Demsar" 
     11MAINTAINER = "Janez Demsar" 
    3412MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si" 
    3513PRIORITY = 10 
    3614CATEGORY = "Data" 
    37  
    3815KEYWORDS = ["data", "file", "load", "read"] 
    3916 
  • Orange/OrangeWidgets/Data/OWImageViewer.py

    r11096 r11748  
    1 """<name>Image Viewer</name> 
    2 <description>View images embeded in example table</description> 
    3 <contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact> 
    4 <priority>4050</priority> 
    5 <icon>icons/ImageViewer.svg</icon> 
    6 """ 
    7  
    81from OWWidget import * 
    92 
    103import OWGUI 
     4 
     5NAME = "Image Viewer" 
     6DESCRIPTION = "Views images embedded in the data." 
     7LONG_DESCRIPTION = "" 
     8ICON = "icons/ImageViewer.svg" 
     9PRIORITY = 4050 
     10AUTHOR = "Ales Erjavec" 
     11AUTHOR_EMAIL = "ales.erjavec(@at@)fri.uni-lj.si" 
     12INPUTS = [("Data", Orange.data.Table, "setData")] 
     13OUTPUTS = [("Data", Orange.data.Table, )] 
    1114 
    1215 
  • Orange/OrangeWidgets/Data/OWImpute.py

    r11096 r11748  
    1 """ 
    2 <name>Impute</name> 
    3 <description>Imputes unknown values.</description> 
    4 <icon>icons/Impute.svg</icon> 
    5 <priority>2130</priority> 
    6 <contact>Janez Demsar</contact> 
    7 """ 
    81import OWGUI 
    92from OWWidget import * 
     3 
     4NAME = "Impute" 
     5DESCRIPTION = "Imputes missing values in the data table." 
     6LONG_DESCRIPTION = "" 
     7ICON = "icons/Impute.svg" 
     8PRIORITY = 2130 
     9AUTHOR = "Janez Demsar" 
     10AUTHOR_EMAIL = "janez.demsar(@at@)fri.uni-lj.si" 
     11INPUTS = [("Data", Orange.data.Table, "setData"), 
     12          ("Learner for Imputation", orange.Learner, "setModel")] 
     13OUTPUTS = [("Data", Orange.data.Table, ), 
     14           ("Imputer", orange.ImputerConstructor, )] 
    1015 
    1116 
     
    4954        OWWidget.__init__(self, parent, signalManager, name, wantMainArea = 0) 
    5055 
    51         self.inputs = [("Data", ExampleTable, self.setData, Default), ("Learner for Imputation", orange.Learner, self.setModel)] 
    52         self.outputs = [("Data", ExampleTable), ("Imputer", orange.ImputerConstructor)] 
     56        self.inputs = [("Data", ExampleTable, self.setData, Default), 
     57                       ("Learner for Imputation", orange.Learner, self.setModel)] 
     58        self.outputs = [("Data", ExampleTable), 
     59                        ("Imputer", orange.ImputerConstructor)] 
    5360 
    5461        self.attrIcons = self.createAttributeIconDict() 
  • Orange/OrangeWidgets/Data/OWMergeData.py

    r11096 r11748  
    1 """ 
    2 <name>Merge Data</name> 
    3 <description>Merge datasets based on values of selected attributes.</description> 
    4 <icon>icons/MergeData.svg</icon> 
    5 <priority>1110</priority> 
    6 <contact>Peter Juvan (peter.juvan@fri.uni-lj.si)</contact> 
    7 """ 
    81import orange 
    92from OWWidget import * 
    103import OWGUI 
     4 
     5NAME = "Merge Data" 
     6DESCRIPTION = """Merges data sets based on values of selected attributes.""" 
     7LONG_DESCRIPTION = "" 
     8ICON = "icons/MergeData.svg" 
     9PRIORITY = 1110 
     10AUTHOR = "Peter Juvan" 
     11AUTHOR_EMAIL = "peter.juvan(@at@)fri.uni-lj.si" 
     12INPUTS = [("Data A", Orange.data.Table, "onDataAInput"), 
     13          ("Data B", Orange.data.Table, "onDataBInput")] 
     14OUTPUTS = [("Merged Data A+B", Orange.data.Table, ), 
     15           ("Merged Data B+A", Orange.data.Table, )] 
     16 
    1117 
    1218class OWMergeData(OWWidget): 
  • Orange/OrangeWidgets/Data/OWMultiMergeData.py

    r11747 r11748  
    1 """ 
    2 <name>Multi-key Merge Data</name> 
    3 <description>Merge datasets based on values of selected tuples of attributes.</description> 
    4 <icon>icons/MergeData.svg</icon> 
    5 <priority>100</priority> 
    6 <contact>Peter Husen (phusen@bmb.sdu.dk)</contact> 
    7 """ 
    8  
     1import Orange 
    92from OWWidget import * 
    103from OWItemModels import PyListModel, VariableListModel 
    114 
    12 #import OWGUI 
    13 import Orange 
     5NAME = "Multi-Key Merge Data" 
     6DESCRIPTION = "Merges data sets based on values of selected groups of features." 
     7LONG_DESCRIPTION = "" 
     8ICON = "icons/MergeData.svg" 
     9PRIORITY = 100 
     10MAINTAINER = "Peter Husen" 
     11MAINTAINER_EMAIL = "phusen(@at@)bmb.sdu.dk" 
     12INPUTS = [("Data A", Orange.data.Table, "set_dataA", Default), 
     13          ("Data B", Orange.data.Table, "set_dataB")] 
     14OUTPUTS = [("Merged Data A+B", Orange.data.Table, Default), 
     15           ("Merged Data B+A", Orange.data.Table, )] 
    1416 
    1517 
     
    201203 
    202204        # Available A attributes 
    203         box = OWGUI.widgetBox(self.controlArea, "Available A attributes", addToLayout=False) 
     205        box = OWGUI.widgetBox(self.controlArea, "Features in data set A", addToLayout=False) 
    204206        self.available_attrsA = VariablesListItemModel() 
    205207        self.available_attrsA_view = VariablesListItemView() 
     
    216218 
    217219        # Used A Attributes 
    218         box = OWGUI.widgetBox(self.controlArea, "Used A attributes", addToLayout=False) 
     220        box = OWGUI.widgetBox(self.controlArea, "Used features from A", addToLayout=False) 
    219221        self.used_attrsA = VariablesListItemModel() 
    220222        self.used_attrsA_view = VariablesListItemView() 
     
    231233        # Data A info 
    232234        box = OWGUI.widgetBox(self, 'Data A', orientation = "vertical", addToLayout=0) 
    233         self.lblDataAExamples = OWGUI.widgetLabel(box, "num examples") 
    234         self.lblDataAAttributes = OWGUI.widgetLabel(box, "num attributes") 
     235        self.lblDataAExamples = OWGUI.widgetLabel(box, "#data instances") 
     236        self.lblDataAAttributes = OWGUI.widgetLabel(box, "#features") 
    235237        layout.addWidget(box, 1, 1, 1, 2) 
    236238 
    237239 
    238240        # Available B attributes 
    239         box = OWGUI.widgetBox(self.controlArea, "Available B attributes", addToLayout=False) 
     241        box = OWGUI.widgetBox(self.controlArea, "Features in data set B", addToLayout=False) 
    240242        self.available_attrsB = VariablesListItemModel() 
    241243        self.available_attrsB_view = VariablesListItemView() 
     
    252254 
    253255        # Used B Attributes 
    254         box = OWGUI.widgetBox(self.controlArea, "Used B attributes", addToLayout=False) 
     256        box = OWGUI.widgetBox(self.controlArea, "Used features from A", addToLayout=False) 
    255257        self.used_attrsB = VariablesListItemModel() 
    256258        self.used_attrsB_view = VariablesListItemView() 
     
    267269 
    268270        box = OWGUI.widgetBox(self, 'Data B', orientation = "vertical", addToLayout=0) 
    269         self.lblDataBExamples = OWGUI.widgetLabel(box, "num examples") 
    270         self.lblDataBAttributes = OWGUI.widgetLabel(box, "num attributes") 
     271        self.lblDataBExamples = OWGUI.widgetLabel(box, "#data instances") 
     272        self.lblDataBAttributes = OWGUI.widgetLabel(box, "#features") 
    271273        layout.addWidget(box, 3, 1, 1, 2) 
    272274 
  • Orange/OrangeWidgets/Data/OWOutliers.py

    r11096 r11748  
    1 """ 
    2 <name>Outliers</name> 
    3 <description>Indentification of outliers</description> 
    4 <icon>icons/Outliers.svg</icon> 
    5 <contact>Marko Toplak (marko.toplak(@at@)gmail.com)</contact>  
    6 <priority>2150</priority> 
    7 """ 
    8  
    91from OWWidget import * 
    102import OWGUI, orange 
    113import orngOutlier 
    124from exceptions import Exception 
     5 
     6NAME = "Outliers" 
     7DESCRIPTION = """Identifies data instances distant from other observations.""" 
     8LONG_DESCRIPTION = "" 
     9ICON = "icons/Outliers.svg" 
     10PRIORITY = 2150 
     11AUTHOR = "Marko Toplak" 
     12AUTHOR_EMAIL = "marko.toplak(@at@)gmail.com" 
     13INPUTS = [("Data", Orange.data.Table, "cdata", Default), 
     14          ("Distances", orange.SymMatrix, "cdistance", Default)] 
     15OUTPUTS = [("Outliers", Orange.data.Table, Default), 
     16           ("Inliers", Orange.data.Table), 
     17           ("Data with z-score", Orange.data.Table)] 
     18 
    1319 
    1420############################################################################## 
     
    1824     
    1925    def __init__(self, parent=None, signalManager = None, name='Outlier'): 
    20         OWWidget.__init__(self, parent, signalManager, name, wantMainArea = 0) 
     26        OWWidget.__init__(self, parent, signalManager, name, wantMainArea=0) 
    2127 
    22         self.inputs = [("Data", ExampleTable, self.cdata),("Distances", orange.SymMatrix, self.cdistance)] 
    23         self.outputs = [("Outliers", ExampleTable), ("Inliers", ExampleTable), ("Data with z-score", ExampleTable)] 
     28        self.inputs = [("Data", ExampleTable, self.cdata), 
     29                       ("Distances", orange.SymMatrix, self.cdistance)] 
     30        self.outputs = [("Outliers", ExampleTable), 
     31                        ("Inliers", ExampleTable), 
     32                        ("Data with z-score", ExampleTable)] 
    2433                
    2534        # Settings 
     
    3746 
    3847 
    39         self.metrics = [("Euclidean", orange.ExamplesDistanceConstructor_Euclidean), 
    40                         ("Manhattan", orange.ExamplesDistanceConstructor_Manhattan), 
    41                         ("Hamming", orange.ExamplesDistanceConstructor_Hamming), 
    42                         ("Relief", orange.ExamplesDistanceConstructor_Relief)] 
     48        self.metrics = [("Euclidean", 
     49                         orange.ExamplesDistanceConstructor_Euclidean), 
     50                        ("Manhattan", 
     51                         orange.ExamplesDistanceConstructor_Manhattan), 
     52                        ("Hamming", 
     53                         orange.ExamplesDistanceConstructor_Hamming), 
     54                        ("Relief", 
     55                         orange.ExamplesDistanceConstructor_Relief)] 
    4356 
    4457        self.ks = [("All",0), ("1", 1), ("2",2), ("3",3), ("5",5), ("10",10), ("15",15)] 
     
    4659        itemsk = [x[0] for x in self.ks] 
    4760         
    48         OWGUI.comboBox(self.controlArea, self, "metric", box="Distance Metrics", items=items, 
     61        OWGUI.comboBox(self.controlArea, self, "metric", 
     62                       box="Distance Metrics", items=items, 
    4963                       tooltip="Metrics to measure pairwise distance between data instances.", 
    5064                       callback=self.dataChange) 
    5165 
    5266        OWGUI.separator(self.controlArea) 
    53         OWGUI.comboBox(self.controlArea, self, "k", box="Nearest Neighbours", items=itemsk, 
     67        OWGUI.comboBox(self.controlArea, self, "k", 
     68                       box="Nearest Neighbours", items=itemsk, 
    5469                       tooltip="Neighbours considered when computing the distance.", 
    5570                       callback=self.applySettings) 
     
    126141        elif self.dataInput is not None: 
    127142            self.data = self.dataInput 
    128             outlier.setExamples(self.data, self.metrics[self.metric][1](self.data))         
     143            outlier.setExamples(self.data, 
     144                                self.metrics[self.metric][1](self.data)) 
    129145            self.haveInput = 1 
    130146        else: 
  • Orange/OrangeWidgets/Data/OWPaintData.py

    r11738 r11748  
    1 """ 
    2 <name>Paint Data</name> 
    3 <description>Paints the data on a 2D plane. Place individual data 
    4 points or use brush to paint a larger data sets.</description> 
    5 <contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact> 
    6 <priority>40</priority> 
    7 <icon>icons/PaintData.svg</icon> 
    8 """ 
    91import orange 
    10  
    112import copy 
    12  
     3import OWToolbars 
     4import OWColorPalette 
     5import Orange.data 
    136from PyQt4 import QtCore 
    14  
    157from OWWidget import * 
    168from OWGraph import * 
    17 import OWToolbars 
    18  
    199from OWItemModels import VariableListModel, PyListModel, ModelActionsWidget 
    20 import OWColorPalette 
     10 
     11NAME = "Paint Data" 
     12DESCRIPTION = """Paints the data on a 2D plane. Place individual data 
     13points or use brush to paint a larger data sets.""" 
     14LONG_DESCRIPTION = "" 
     15ICON = "icons/PaintData.svg" 
     16PRIORITY = 40 
     17AUTHOR = "Ales Erjavec" 
     18AUTHOR_EMAIL = "ales.erjavec(@at@)fri.uni-lj.si" 
     19OUTPUTS = [("Data", Orange.data.Table, )] 
    2120 
    2221dir = OWToolbars.dir 
  • Orange/OrangeWidgets/Data/OWPreprocess.py

    r11096 r11748  
    1 """<name>Preprocess</name> 
    2 <description>Construct and apply data preprocessors</description> 
    3 <icon>icons/Preprocess.svg</icon> 
    4 <priority>2105</priority> 
    5 <contact>Ales Erjavec (ales.erjavec(@at@)fri.uni-lj.si)</contact> 
    6 """ 
    7  
    81from OWWidget import * 
    92from OWItemModels import PyListModel, ListSingleSelectionModel, ModelActionsWidget 
     
    147import orngSVM 
    158 
    16 import sys, os 
    17 import math 
     9import sys 
    1810 
    1911from Orange.data import preprocess 
     12 
     13NAME = "Preprocess" 
     14DESCRIPTION = """Supports construction of data preprocessors. 
     15Can apply them on input data sets or offer them to predictors.""" 
     16LONG_DESCRIPTION = "" 
     17ICON = "icons/Preprocess.svg" 
     18PRIORITY = 2105 
     19AUTHOR = "Ales Erjavec" 
     20AUTHOR_EMAIL = "ales.erjavec(@at@)fri.uni-lj.si" 
     21INPUTS = [("Data", Orange.data.Table, "setData")] 
     22OUTPUTS = [("Preprocess", orngWrap.PreprocessedLearner, ), 
     23           ("Preprocessed Data", Orange.data.Table, )] 
     24 
    2025 
    2126def _gettype(obj): 
     
    2631    else: 
    2732        return type(obj) 
    28          
     33 
     34 
    2935def _pyqtProperty(type, **kwargs): 
    3036    # check for Qt version, 4.4 supports only C++ classes  
     
    3541            del kwargs["user"] 
    3642        return property(**kwargs) 
     43 
    3744 
    3845## Preprocessor item editor widgets 
     
    470477        OWWidget.__init__(self, parent, signalManager, name) 
    471478         
    472         self.inputs = [("Data", ExampleTable, self.setData)] #, ("Learner", orange.Learner, self.setLearner)] 
    473         self.outputs = [("Preprocess", orngWrap.PreprocessedLearner), ("Preprocessed Data", ExampleTable)] #, ("Preprocessor", orange.Preprocessor)] 
     479        self.inputs = [("Data", Orange.data.Table, self.setData)] 
     480        self.outputs = [("Preprocess", orngWrap.PreprocessedLearner), 
     481                        ("Preprocessed Data", Orange.data.Table)] 
    474482         
    475483        self.autoCommit = False 
  • Orange/OrangeWidgets/Data/OWPurgeDomain.py

    r11380 r11748  
    1 """ 
    2 <name>Purge Domain</name> 
    3 <description>Removes redundant values and attributes, sorts values.</description> 
    4 <icon>icons/PurgeDomain.svg</icon> 
    5 <contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact> 
    6 <priority>1105</priority> 
    7 """ 
    81from OWWidget import * 
    92import OWGUI 
    103 
    114import orange 
     5 
     6NAME = "Purge Domain" 
     7DESCRIPTION = "Removes redundant values and features, sorts domain values." 
     8LONG_DESCRIPTION = "" 
     9ICON = "icons/PurgeDomain.svg" 
     10PRIORITY = 1150 
     11AUTHOR = "Janez Demsar" 
     12AUTHOR_EMAIL = "janez.demsar(@at@)fri.uni-lj.si" 
     13INPUTS = [("Data", Orange.data.Table, "setData")] 
     14OUTPUTS = [("Data", Orange.data.Table)] 
     15 
    1216 
    1317class OWPurgeDomain(OWWidget): 
  • Orange/OrangeWidgets/Data/OWPythonScript.py

    r11434 r11748  
    1 """ 
    2 <name>Python Script</name> 
    3 <description>Executes python script.</description> 
    4 <icon>icons/PythonScript.svg</icon> 
    5 <contact>Miha Stajdohar (miha.stajdohar(@at@)gmail.com)</contact> 
    6 <priority>3150</priority> 
    7 """ 
    81import sys 
    92import os 
     
    2922import OWGUI 
    3023import Orange 
     24 
     25NAME = "Python Script" 
     26DESCRIPTION = "Executes a Python script." 
     27LONG_DESCRIPTION = "" 
     28ICON = "icons/PythonScript.svg" 
     29PRIORITY = 3150 
     30AUTHOR = "Miha Stajdohar" 
     31AUTHOR_EMAIL = "miha.stajdohar(@at@)gmail.com" 
     32 
     33INPUTS = [("in_data", Orange.data.Table, "setExampleTable", Default), 
     34          ("in_distance", Orange.misc.SymMatrix, "setDistanceMatrix", Default), 
     35          ("in_learner", Orange.core.Learner, "setLearner", Default), 
     36          ("in_classifier", Orange.core.Classifier, "setClassifier", Default), 
     37          ("in_object", object, "setObject")] 
     38 
     39OUTPUTS = [("out_data", Orange.data.Table, ), 
     40           ("out_distance", Orange.misc.SymMatrix, ), 
     41           ("out_learner", Orange.core.Learner, ), 
     42           ("out_classifier", Orange.core.Classifier, Dynamic), 
     43           ("out_object", object, Dynamic)] 
    3144 
    3245 
  • Orange/OrangeWidgets/Data/OWRank.py

    r11729 r11748  
    1 """ 
    2 <name>Rank</name> 
    3 <description>Ranks and filters attributes by their relevance.</description> 
    4 <icon>icons/Rank.svg</icon> 
    5 <contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact> 
    6 <priority>1102</priority> 
    7 """ 
    8  
     1import OWGUI 
     2import Orange 
     3import pkg_resources 
    94from collections import namedtuple 
    105from functools import partial 
    11  
    12 import pkg_resources 
    13  
    146from OWWidget import * 
    15  
    16 import OWGUI 
    17  
    18 import Orange 
    197from Orange.feature import scoring 
    208from Orange.classification import svm 
    219from Orange.ensemble import forest 
     10 
     11NAME = "Rank" 
     12DESCRIPTION = "Ranks and filters data features by their relevance." 
     13LONG_DESCRIPTION = "" 
     14ICON = "icons/Rank.svg" 
     15PRIORITY = 1102 
     16AUTHOR = "Janez Demsar" 
     17AUTHOR_EMAIL = "janez.demsar(@at@)fri.uni-lj.si" 
     18INPUTS = [("Data", Orange.data.Table, "setData")] 
     19OUTPUTS = [("Reduced Data", Orange.data.Table, Default + Single)] 
    2220 
    2321 
  • Orange/OrangeWidgets/Data/OWSave.py

    r11719 r11748  
    1 """ 
    2 <name>Save</name> 
    3 <description>Saves data to file.</description> 
    4 <icon>icons/Save.svg</icon> 
    5 <contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact> 
    6 <priority>90</priority> 
    7 """ 
    8  
    91from OWWidget import * 
    102import OWGUI 
     
    124from exceptions import Exception 
    135 
     6NAME = "Save" 
     7DESCRIPTION = "Saves data to file." 
     8LONG_DESCRIPTION = "" 
     9ICON = "icons/Save.svg" 
     10PRIORITY = 90 
     11AUTHOR = "Janez Demsar" 
     12AUTHOR_EMAIL = "janez.demsar(@at@)fri.uni-lj.si" 
     13INPUTS = [("Data", Orange.data.Table, "dataset", Default)] 
     14 
     15 
    1416class OWSave(OWWidget): 
    15     settingsList=["recentFiles","selectedFileName"] 
     17    settingsList = ["recentFiles", "selectedFileName"] 
    1618 
    17     savers = {".txt": orange.saveTxt, ".tab": orange.saveTabDelimited, 
    18               ".names": orange.saveC45, ".test": orange.saveC45, ".data": orange.saveC45, 
     19    savers = {".txt": orange.saveTxt, 
     20              ".tab": orange.saveTabDelimited, 
     21              ".names": orange.saveC45, 
     22              ".test": orange.saveC45, 
     23              ".data": orange.saveC45, 
    1924              ".csv": orange.saveCsv 
    2025              } 
     
    6065        #self.adjustSize() 
    6166        self.setFilelist() 
    62         self.resize(260,100) 
     67        self.resize(260, 100) 
    6368        self.filecombo.setCurrentIndex(0) 
    6469 
     
    121126            self.error() 
    122127 
    123     def addFileToList(self,fn): 
     128    def addFileToList(self, fn): 
    124129        if fn in self.recentFiles: 
    125130            self.recentFiles.remove(fn) 
     
    128133 
    129134    def setFilelist(self): 
    130         "Set the GUI filelist" 
     135        """Set the GUI filelist""" 
    131136        self.filecombo.clear() 
    132137 
  • Orange/OrangeWidgets/Data/OWSelectData.py

    r11096 r11748  
    1 """ 
    2 <name>Select Data</name> 
    3 <description>Selects instances from the data set based on conditions over attributes.</description> 
    4 <icon>icons/SelectData.svg</icon> 
    5 <priority>1150</priority> 
    6 <contact>Peter Juvan (peter.juvan@fri.uni-lj.si)</contact> 
    7 """ 
    81import orange 
    92from OWWidget import * 
     
    114from orngDataCaching import * 
    125 
     6NAME = "Select Data" 
     7DESCRIPTION = "Selects data instances based on conditions over data features." 
     8LONG_DESCRIPTION = "" 
     9ICON = "icons/SelectData.svg" 
     10PRIORITY = 1150 
     11AUTHOR = "Peter Juvan" 
     12AUTHOR_EMAIL = "peter.juvan(@at@)fri.uni-lj.si" 
     13INPUTS = [("Data", Orange.data.Table, "setData")] 
     14OUTPUTS = [("Matching Data", Orange.data.Table, Default), 
     15           ("Unmatched Data", Orange.data.Table, )] 
     16 
     17 
    1318class OWSelectData(OWWidget): 
    1419    settingsList = ["updateOnChange", "purgeAttributes", "purgeClasses"] 
    15     contextHandlers = {"": PerfectDomainContextHandler(fields = ["Conditions"], matchValues=2)} 
    16  
    17     def __init__(self, parent = None, signalManager = None, name = "Select data"): 
    18         OWWidget.__init__(self, parent, signalManager, name, wantMainArea = 0)  #initialize base class 
     20    contextHandlers = {"": PerfectDomainContextHandler(fields=["Conditions"], 
     21                                                       matchValues=2)} 
     22 
     23    def __init__(self, parent=None, signalManager=None, name="Select data"): 
     24        OWWidget.__init__(self, parent, signalManager, name, wantMainArea=0) 
    1925 
    2026        self.inputs = [("Data", ExampleTable, self.setData)] 
    21         self.outputs = [("Matching Data", ExampleTable, Default), ("Unmatched Data", ExampleTable)] 
     27        self.outputs = [("Matching Data", ExampleTable, Default), 
     28                        ("Unmatched Data", ExampleTable)] 
    2229 
    2330        self.name2var = {}   # key: variable name, item: orange.Variable 
Note: See TracChangeset for help on using the changeset viewer.