Changeset 7457:1487adaf12d6 in orange


Ignore:
Timestamp:
02/04/11 15:53:59 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
c2c8178703994cadf8922379c9f1d40f6bb8117a
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/network/__init__.py

    r7451 r7457  
    395395    size of the graph and the operations you perform on it. 
    396396 
    397     **Graph Analyses** 
     397    **Graph analysis** 
    398398     
    399399    .. method:: getSubGraph(vertices) 
     
    496496    (None, None, None) 
    497497 
    498 An example of network analyses, part of `network-graph-analyses.py`_ (uses: 
     498An example of network analysis, part of `network-graph-analysis.py`_ (uses: 
    499499`combination.net`_): 
    500500 
    501 .. literalinclude:: code/network-graph-analyses.py 
     501.. literalinclude:: code/network-graph-analysis.py 
    502502    :lines: 12-49 
    503503     
     
    550550.. _combination.net: code/combination.net 
    551551.. _network-widget.py: code/network-widget.py 
    552 .. _network-graph-analyses.py: code/network-graph-analyses.py 
     552.. _network-graph-analysis.py: code/network-graph-analysis.py 
    553553.. _network-graph.py: code/network-graph.py 
    554554.. _network-graph-obj.py: code/network-graph-obj.py 
     
    558558import os 
    559559 
    560 import orange 
    561560import orangeom 
    562  
    563 from orange import Graph, GraphAsList, GraphAsMatrix, GraphAsTree 
     561import Orange.core 
     562import Orange.data 
     563 
     564from Orange.core import Graph, GraphAsList, GraphAsMatrix, GraphAsTree 
    564565 
    565566class MdsTypeClass(): 
     
    577578    Data structure for representing directed and undirected networks. 
    578579     
    579     Network class holds network structure information and supports basic  
    580     network analysis. Network class is inherited from orange.GraphAsList.  
    581     Refer to orange.GraphAsList for more graph analysis tools. See the  
     580    Network class holds network structure information and supports basic 
     581    network analysis. Network class is inherited from 
     582    :obj:`Orange.network.GraphAsList`. Refer to 
     583    :obj:`Orange.network.GraphAsList` for more graph analysis tools. See the 
    582584    orangeom.Pathfinder class for a way to simplify your network. 
    583585     
     
    838840     
    839841    """Perform network layout optimization. Network structure is defined in  
    840     :obj:Orange.network.Network class. 
     842    :obj:`Orange.network.Network` class. 
    841843     
    842844    :param network: Network to optimize 
     
    10211023        if (self.graph != None): 
    10221024            if hasattr(self.graph, "items"): 
    1023                 if isinstance(self.graph.items, orange.ExampleTable): 
     1025                if isinstance(self.graph.items, Orange.data.Table): 
    10241026                    vars[:0] = self.graph.items.domain.variables 
    10251027                 
     
    10341036        if (self.graph != None): 
    10351037            if hasattr(self.graph, "links"): 
    1036                 if isinstance(self.graph.links, orange.ExampleTable): 
     1038                if isinstance(self.graph.links, Orange.data.Table): 
    10371039                    vars[:0] = self.graph.links.domain.variables 
    10381040                 
     
    10461048        import warnings 
    10471049        warnings.warn("Deprecated.", DeprecationWarning) 
    1048         if self.graph.items is orange.ExampleTable: 
     1050        if self.graph.items is Orange.data.Table: 
    10491051            return self.data[i][j] 
    10501052        elif self.graph.data is type([]): 
     
    14381440        self.mdsStep = 0 
    14391441        self.stopMDS = 0 
    1440         self.vertexDistance.matrixType = orange.SymMatrix.Symmetric 
     1442        self.vertexDistance.matrixType = Orange.core.SymMatrix.Symmetric 
    14411443        self.diag_coors = math.sqrt((min(self.graph.coors[0]) -  \ 
    14421444                                     max(self.graph.coors[0]))**2 + \ 
     
    15191521    def saveNetwork(self, fn): 
    15201522        import warnings 
    1521         warnings.warn("Deprecated. Use Orange.network.Network.saveNetwork",  
     1523        warnings.warn("Deprecated. Use Orange.network.Network.save",  
    15221524                      DeprecationWarning) 
    15231525        name = '' 
     
    15951597    def readNetwork(self, fn, directed=0): 
    15961598        import warnings 
    1597         warnings.warn("Deprecated. Use Orange.network.Network.readNetwork",  
     1599        warnings.warn("Deprecated. Use Orange.network.Network.read",  
    15981600                      DeprecationWarning) 
    15991601        network = Network(1,directed) 
     
    16661668                     
    16671669        if results2items and not resultHistory2items: 
    1668             attrs = [orange.EnumVariable('clustering label propagation', \ 
    1669                                          values=list(set([l for l \ 
     1670            attrs = [Orange.data.feature.Discrete( 
     1671                                        'clustering label propagation', 
     1672                                        values=list(set([l for l \ 
    16701673                                                        in lblhistory[-1]])))] 
    1671             dom = orange.Domain(attrs, 0) 
    1672             data = orange.ExampleTable(dom, [[l] for l in lblhistory[-1]]) 
     1674            dom = Orange.data.Domain(attrs, 0) 
     1675            data = Orange.data.Table(dom, [[l] for l in lblhistory[-1]]) 
    16731676            if self.net.items is None: 
    16741677                self.net.items = data   
    16751678            else:  
    1676                 self.net.items = orange.ExampleTable([self.net.items, data]) 
     1679                self.net.items = Orange.data.Table([self.net.items, data]) 
    16771680        if resultHistory2items: 
    1678             attrs = [orange.EnumVariable('c'+ str(i), \ 
     1681            attrs = [Orange.data.feature.Discrete('c'+ str(i), 
    16791682                values=list(set([l for l in lblhistory[0]]))) for i,labels \ 
    16801683                in enumerate(lblhistory)] 
    1681             dom = orange.Domain(attrs, 0) 
     1684            dom = Orange.data.Domain(attrs, 0) 
    16821685            # transpose history 
    16831686            data = map(list, zip(*lblhistory)) 
    1684             data = orange.ExampleTable(dom, data) 
     1687            data = Orange.data.Table(dom, data) 
    16851688            if self.net.items is None: 
    16861689                self.net.items = data   
    16871690            else:  
    1688                 self.net.items = orange.ExampleTable([self.net.items, data]) 
     1691                self.net.items = Orange.data.Table([self.net.items, data]) 
    16891692 
    16901693        return labels 
Note: See TracChangeset for help on using the changeset viewer.