Changeset 11287:92efd54a02fd in orange


Ignore:
Timestamp:
01/29/13 11:42:50 (15 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

New style meta descriptions for some widgets.

Needed for intersphinx documentation discovery.

Location:
Orange/OrangeWidgets
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Classify/OWCN2.py

    r11096 r11287  
    1010 
    1111from orngWrap import PreprocessedLearner 
     12 
     13NAME = "CN2" 
     14 
     15DESCRIPTION = "Rule-based (CN2) learner/classifier" 
     16 
     17AUTHOR = "Ales Erjavec" 
     18 
     19PRIORITY = 300 
     20 
     21ICON = "icons/CN2.svg" 
     22 
     23# Sphinx documentation label reference 
     24HELP_REF = "CN2 Rules" 
     25 
     26INPUTS = ( 
     27    dict(name="Data", type=ExampleTable, handler="dataset", 
     28         doc="Training data set", 
     29         id="train-data"), 
     30 
     31    dict(name="Preprocess", type=PreprocessedLearner, 
     32         handler="setPreprocessor", 
     33         doc="Data preprocessor", 
     34         id="preprocessor") 
     35) 
     36 
     37OUTPUTS = ( 
     38    dict(name="Learner", type=orange.Learner, 
     39         doc="A CN2 Rules learner instance", 
     40         id="learner"), 
     41 
     42    dict(name="Classifier", type=orange.Classifier, 
     43         doc="A rule classifier induced from given training data.", 
     44         id="classifier"), 
     45 
     46    dict(name="Unordered CN2 Classifier", type=orngCN2.CN2UnorderedClassifier, 
     47         doc="Same as 'Classifier'", 
     48         id="unordered-cn2-classifier") 
     49) 
     50 
    1251 
    1352class CN2ProgressBar(orange.ProgressCallback): 
  • Orange/OrangeWidgets/Classify/OWKNN.py

    r11096 r11287  
    1010from exceptions import Exception 
    1111from orngWrap import PreprocessedLearner 
     12 
     13NAME = "k Nearest Neighbours" 
     14 
     15ID = "orange.widgets.classify.knn" 
     16 
     17DESCRIPTION = "K-nearest neighbours learner/classifier." 
     18 
     19ICON = "icons/kNearestNeighbours.svg" 
     20 
     21AUTHOR = "Janez Demsar" 
     22 
     23PRIORITY = 25 
     24 
     25HELP_REF = "k-Nearest Neighbours" 
     26 
     27KEYWORDS = ["knn"] 
     28 
     29INPUTS = ( 
     30    InputSignal(name="Data", 
     31                type=ExampleTable, 
     32                handler="setData", 
     33                doc="Training data set", 
     34                id="train-data"), 
     35 
     36    InputSignal(name="Preprocess", 
     37                type=PreprocessedLearner, 
     38                handler="setPreprocessor", 
     39                id="preprocessor") 
     40) 
     41 
     42OUTPUTS = ( 
     43    OutputSignal(name="Learner", 
     44                 type=orange.Learner, 
     45                 doc="The kNN learner with settings as specified in " 
     46                     "the dialog", 
     47                 id="learner"), 
     48 
     49    OutputSignal(name="kNN Classifier", 
     50                 type=orange.kNNClassifier, 
     51                 doc="A kNN classifier trained on 'Data'.", 
     52                 id="knn-classifier") 
     53) 
     54 
     55WIDGET_CLASS = "OWKNN" 
     56 
    1257 
    1358class OWKNN(OWWidget): 
     
    117162        self.send("kNN Classifier", self.classifier) 
    118163 
    119 ############################################################################## 
    120 # Test the widget, run from DOS prompt 
    121 # > python OWDataTable.py) 
    122 # Make sure that a sample data set (adult_sample.tab) is in the directory 
    123164 
    124 if __name__=="__main__": 
    125     a=QApplication(sys.argv) 
    126     ow=OWKNN() 
     165if __name__ == "__main__": 
     166    a = QApplication(sys.argv) 
     167    ow = OWKNN() 
    127168 
    128 ##    dataset = orange.ExampleTable('adult_sample') 
    129 ##    ow.setData(dataset) 
     169    dataset = orange.ExampleTable('adult_sample') 
     170    ow.setData(dataset) 
    130171 
    131172    ow.show() 
  • Orange/OrangeWidgets/Data/OWDiscretize.py

    r11096 r11287  
    2222PRIORITY = 2100 
    2323ICON = "icons/Discretize.svg" 
    24  
    25 HELP = "docs/html/data/discretize.html" 
    2624 
    2725INPUTS = [("Data", orange.ExampleTable, "setData")] 
  • Orange/OrangeWidgets/Data/OWFile.py

    r11252 r11287  
    1515import orngIO 
    1616 
    17 warnings.filterwarnings("error", ".*" , orange.KernelWarning, "OWFile", 11) 
     17NAME = "File" 
     18ID = "orange.widgets.data.file" 
     19 
     20DESCRIPTION = """ 
     21Read a data table from a supported file format on the the file system and 
     22send it to the the output. 
     23""" 
     24 
     25LONG_DESCRIPTION = """ 
     26This is the widget you will probably use at the start of every schema to read 
     27the input data file (data table with examples). The widget maintains a 
     28history of most recently used data files. For convenience, the history 
     29also includes a directory with the sample data sets that come with Orange. 
     30""" 
     31 
     32ICON = "icons/File.svg" 
     33AUTHOR = "Janez Demsar" 
     34MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si" 
     35PRIORITY = 10 
     36CATEGORY = "Data" 
     37 
     38KEYWORDS = ["data", "file", "load", "read"] 
     39 
     40OUTPUTS = ( 
     41    {"name": "Data", 
     42     "type": orange.ExampleTable, 
     43     "doc": "Attribute-valued data set read from the input file.", 
     44    }, 
     45) 
     46 
     47WIDGET_CLASS = "OWFile" 
     48 
     49# This is why the 'call''s line number is important. Actually you can 
     50# move it but you need to make sure the following filter's lineno is updated 
     51warnings.filterwarnings("error", ".*", orange.KernelWarning, "OWFile", 11) 
     52 
    1853 
    1954class FileNameContextHandler(ContextHandler): 
     
    2964        if "type" in var.attributes and "origin" not in var.attributes: 
    3065            var.attributes["origin"] = dirname 
    31  
    32  
    33 NAME = "File" 
    34 ID = "orange.widgets.data.file" 
    35  
    36 DESCRIPTION = """ 
    37 Read a data table from a supported file format on the the file system and 
    38 send it to the the output. 
    39 """ 
    40  
    41 LONG_DESCRIPTION = """ 
    42 This is the widget you will probably use at the start of every schema to read 
    43 the input data file (data table with examples). The widget maintains a 
    44 history of most recently used data files. For convenience, the history 
    45 also includes a directory with the sample data sets that come with Orange. 
    46 """ 
    47  
    48 ICON = "icons/File.svg" 
    49 AUTHOR = "Janez Demsar" 
    50 MAINTAINER_EMAIL = "janez.demsar(@at@)fri.uni-lj.si" 
    51 PRIORITY = 10 
    52 CATEGORY = "Data" 
    53  
    54 KEYWORDS = ["data", "file", "load", "read"] 
    55  
    56 OUTPUTS = [{"name": "Data", 
    57             "type": orange.ExampleTable, 
    58             "doc": "Attribute-valued data set read from the input file."}] 
    59  
    60 WIDGET_CLASS = "OWFile" 
    6166 
    6267 
     
    7580    formats.update(dict((ft[1][2:], ft[0]) for ft in registeredFileTypes)) 
    7681      
    77                   
    7882    def __init__(self, parent=None, signalManager = None): 
    7983        OWWidget.__init__(self, parent, signalManager, "File", wantMainArea = 0, resizingEnabled = 1) 
  • Orange/OrangeWidgets/Visualize/OWScatterPlot.py

    r11096 r11287  
    66<priority>1000</priority> 
    77""" 
    8 # ScatterPlot.py 
    9 # 
    10 # Show data using scatterplot 
    11 # 
    128from OWWidget import * 
    139from OWScatterPlotGraph import * 
     
    1915 
    2016 
    21 ########################################################################################### 
     17NAME = "Scatter Plot" 
     18 
     19DESCRIPTION = "Scatter plot graph visualization" 
     20 
     21LONG_DESCRIPTION = """ 
     22This widget provides a standard 2-dimensional scatter plot 
     23visualization for both continuous and discrete-valued attributes. 
     24""" 
     25 
     26ID = "orange.widgets.visualization.scatterplot" 
     27 
     28ICON = "icons/ScatterPlot.svg" 
     29 
     30AUTHOR = "Gregor Leban" 
     31 
     32PRIORITY = 1000 
     33 
     34INPUTS = ( 
     35    dict(name="Data", type=ExampleTable, handler="setData", flags=Default, 
     36         doc="Primary input data set.", 
     37         id="primary-data"), 
     38 
     39    dict(name="Data Subset", type=ExampleTable, handler="setSubsetData", 
     40         doc="Additional data set with a subset of instances in 'Data'", 
     41         id="subset-data"), 
     42 
     43    dict(name="Features", type=AttributeList, handler="setShownAttributes", 
     44         doc="A subset of features in 'Data' to display", 
     45         id="feature-subset"), 
     46 
     47    dict(name="Evaluation Results", type=orngTest.ExperimentResults, 
     48         handler="setTestResults", 
     49         id="evaluation-results"), 
     50 
     51    dict(name="VizRank Learner", type=orange.Learner, 
     52         handler="setVizRankLearner", 
     53         id="vizrank-learner"), 
     54) 
     55 
     56OUTPUTS = ( 
     57    dict(name="Selected Data", type=ExampleTable, 
     58         doc="Selected data subset", 
     59         id="selected-data"), 
     60 
     61    dict(name="Other Data", type=ExampleTable, 
     62         doc="Data subset not included in 'Selected Data'", 
     63         id="unselected-data") 
     64) 
     65 
     66 
     67############################################################################### 
    2268##### WIDGET : Scatterplot visualization 
    23 ########################################################################################### 
     69############################################################################### 
    2470class OWScatterPlot(OWWidget): 
    25     settingsList = ["graph.pointWidth", "graph.showXaxisTitle", "graph.showYLaxisTitle", "showGridlines", "graph.showAxisScale", "graph.useAntialiasing", 
    26                     "graph.showLegend", "graph.jitterSize", "graph.jitterContinuous", "graph.showFilledSymbols", "graph.showProbabilities", 
    27                     "graph.alphaValue", "graph.showDistributions", "autoSendSelection", "toolbarSelection", "graph.sendSelectionOnUpdate", 
    28                     "colorSettings", "selectedSchemaIndex", "VizRankLearnerName"] 
    29     jitterSizeNums = [0.0, 0.1,   0.5,  1,  2 , 3,  4 , 5 , 7 ,  10,   15,   20 ,  30 ,  40 ,  50 ] 
     71    settingsList = ["graph.pointWidth", "graph.showXaxisTitle", 
     72                    "graph.showYLaxisTitle", "showGridlines", 
     73                    "graph.showAxisScale", "graph.useAntialiasing", 
     74                    "graph.showLegend", "graph.jitterSize", 
     75                    "graph.jitterContinuous", "graph.showFilledSymbols", 
     76                    "graph.showProbabilities", "graph.alphaValue", 
     77                    "graph.showDistributions", "autoSendSelection", 
     78                    "toolbarSelection", "graph.sendSelectionOnUpdate", 
     79                    "colorSettings", "selectedSchemaIndex", 
     80                    "VizRankLearnerName"] 
     81 
     82    jitterSizeNums = [0.0, 0.1, 0.5, 1, 2, 3, 4, 5, 7, 10, 15, 20, 30, 40, 50] 
    3083 
    3184    contextHandlers = {"": DomainContextHandler("", ["attrX", "attrY", 
     
    3386                                                     ("attrLabel", DomainContextHandler.Optional + DomainContextHandler.IncludeMetaAttributes)])} 
    3487 
    35     def __init__(self, parent=None, signalManager = None): 
     88    def __init__(self, parent=None, signalManager=None): 
    3689        OWWidget.__init__(self, parent, signalManager, "Scatter Plot", TRUE) 
    3790 
Note: See TracChangeset for help on using the changeset viewer.