~ubuntu-branches/ubuntu/natty/mgltools-vision/natty

« back to all changes in this revision

Viewing changes to Vision/doc/Examples/matplotlib/BarH_net.py

  • Committer: Bazaar Package Importer
  • Author(s): Steffen Moeller
  • Date: 2008-07-31 22:00:08 UTC
  • Revision ID: james.westby@ubuntu.com-20080731220008-broax3qn6pq9ygnb
Tags: upstream-1.5.2.cvs.20080731
ImportĀ upstreamĀ versionĀ 1.5.2.cvs.20080731

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
########################################################################
 
2
#
 
3
#    Vision Network - Python source code - file generated by vision
 
4
#    Friday 13 April 2007 12:34:25 
 
5
#    
 
6
#       The Scripps Research Institute (TSRI)
 
7
#       Molecular Graphics Lab
 
8
#       La Jolla, CA 92037, USA
 
9
#
 
10
# Copyright: Daniel Stoffler, Michel Sanner and TSRI
 
11
#   
 
12
# revision: Guillaume Vareille
 
13
#  
 
14
#########################################################################
 
15
#
 
16
# $Header: /opt/cvs/python/packages/share1.5/Vision/doc/Examples/matplotlib/BarH_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
 
17
#
 
18
# $Id: BarH_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
 
19
#
 
20
 
 
21
from traceback import print_exc
 
22
## loading libraries ##
 
23
from Vision.matplotlibNodes import matplotliblib
 
24
masterNet.getEditor().addLibraryInstance(matplotliblib,"Vision.matplotlibNodes", "matplotliblib")
 
25
 
 
26
from Vision.StandardNodes import stdlib
 
27
masterNet.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")
 
28
 
 
29
try:
 
30
    ## saving node ReadTable ##
 
31
    from Vision.StandardNodes import ReadTable
 
32
    ReadTable_0 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
 
33
    masterNet.addNode(ReadTable_0,138,9)
 
34
    ReadTable_0.inputPortByName['filename'].widget.set("Data/barh_plot_data.dat", run=False)
 
35
    ReadTable_0.inputPortByName['sep'].widget.set(",", run=False)
 
36
    ReadTable_0.inputPortByName['datatype'].widget.set("float", run=False)
 
37
    apply(ReadTable_0.configure, (), {'expanded': True})
 
38
except:
 
39
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
 
40
    print_exc()
 
41
    ReadTable_0=None
 
42
 
 
43
try:
 
44
    ## saving node BarH ##
 
45
    from Vision.matplotlibNodes import BarHNE
 
46
    BarH_1 = BarHNE(constrkw = {}, name='BarH', library=matplotliblib)
 
47
    masterNet.addNode(BarH_1,133,326)
 
48
except:
 
49
    print "WARNING: failed to restore BarHNE named BarH in network masterNet"
 
50
    print_exc()
 
51
    BarH_1=None
 
52
 
 
53
try:
 
54
    ## saving node Index ##
 
55
    from Vision.StandardNodes import Index
 
56
    Index_2 = Index(constrkw = {}, name='Index', library=stdlib)
 
57
    masterNet.addNode(Index_2,14,178)
 
58
    apply(Index_2.configure, (), {'expanded': True})
 
59
except:
 
60
    print "WARNING: failed to restore Index named Index in network masterNet"
 
61
    print_exc()
 
62
    Index_2=None
 
63
 
 
64
try:
 
65
    ## saving node Index ##
 
66
    from Vision.StandardNodes import Index
 
67
    Index_3 = Index(constrkw = {}, name='Index', library=stdlib)
 
68
    masterNet.addNode(Index_3,156,177)
 
69
    apply(Index_3.inputPortByName['index'].widget.configure, (), {'max': 2})
 
70
    Index_3.inputPortByName['index'].widget.set(1, run=False)
 
71
    apply(Index_3.configure, (), {'expanded': True})
 
72
except:
 
73
    print "WARNING: failed to restore Index named Index in network masterNet"
 
74
    print_exc()
 
75
    Index_3=None
 
76
 
 
77
try:
 
78
    ## saving node Index ##
 
79
    from Vision.StandardNodes import Index
 
80
    Index_4 = Index(constrkw = {}, name='Index', library=stdlib)
 
81
    masterNet.addNode(Index_4,300,178)
 
82
    apply(Index_4.inputPortByName['index'].widget.configure, (), {'max': 2})
 
83
    Index_4.inputPortByName['index'].widget.set(2, run=False)
 
84
    apply(Index_4.configure, (), {'expanded': True})
 
85
except:
 
86
    print "WARNING: failed to restore Index named Index in network masterNet"
 
87
    print_exc()
 
88
    Index_4=None
 
89
 
 
90
masterNet.freeze()
 
91
 
 
92
## saving connections for network BarH ##
 
93
if ReadTable_0 is not None and Index_2 is not None:
 
94
    try:
 
95
        masterNet.connectNodes(
 
96
            ReadTable_0, Index_2, "data", "data", blocking=True)
 
97
    except:
 
98
        print "WARNING: failed to restore connection between ReadTable_0 and Index_2 in network masterNet"
 
99
if ReadTable_0 is not None and Index_3 is not None:
 
100
    try:
 
101
        masterNet.connectNodes(
 
102
            ReadTable_0, Index_3, "data", "data", blocking=True)
 
103
    except:
 
104
        print "WARNING: failed to restore connection between ReadTable_0 and Index_3 in network masterNet"
 
105
if ReadTable_0 is not None and Index_4 is not None:
 
106
    try:
 
107
        masterNet.connectNodes(
 
108
            ReadTable_0, Index_4, "data", "data", blocking=True)
 
109
    except:
 
110
        print "WARNING: failed to restore connection between ReadTable_0 and Index_4 in network masterNet"
 
111
if Index_2 is not None and BarH_1 is not None:
 
112
    try:
 
113
        masterNet.connectNodes(
 
114
            Index_2, BarH_1, "data", "bottom", blocking=True)
 
115
    except:
 
116
        print "WARNING: failed to restore connection between Index_2 and BarH_1 in network masterNet"
 
117
if Index_3 is not None and BarH_1 is not None:
 
118
    try:
 
119
        masterNet.connectNodes(
 
120
            Index_3, BarH_1, "data", "width", blocking=True)
 
121
    except:
 
122
        print "WARNING: failed to restore connection between Index_3 and BarH_1 in network masterNet"
 
123
if Index_4 is not None and BarH_1 is not None:
 
124
    try:
 
125
        masterNet.connectNodes(
 
126
            Index_4, BarH_1, "data", "xerr", blocking=True)
 
127
    except:
 
128
        print "WARNING: failed to restore connection between Index_4 and BarH_1 in network masterNet"
 
129
masterNet.unfreeze()
 
130
#masterNet.run()
 
131