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

« back to all changes in this revision

Viewing changes to Vision/doc/Examples/matplotlib/ScatterClassic_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
#    Monday 16 April 2007 14:08:32 
 
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/ScatterClassic_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
 
17
#
 
18
# $Id: ScatterClassic_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_12 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
 
33
    masterNet.addNode(ReadTable_12,108,57)
 
34
    ReadTable_12.inputPortByName['filename'].widget.set("Data/scatter_data.dat", run=False)
 
35
    ReadTable_12.inputPortByName['sep'].widget.set(",", run=False)
 
36
    ReadTable_12.inputPortByName['datatype'].widget.set("float", run=False)
 
37
    apply(ReadTable_12.configure, (), {'expanded': True})
 
38
except:
 
39
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
 
40
    print_exc()
 
41
    ReadTable_12=None
 
42
 
 
43
try:
 
44
    ## saving node ScatterClassic ##
 
45
    from Vision.matplotlibNodes import ScatterClassicNE
 
46
    ScatterClassic_13 = ScatterClassicNE(constrkw = {}, name='ScatterClassic', library=matplotliblib)
 
47
    masterNet.addNode(ScatterClassic_13,118,363)
 
48
    ScatterClassic_13.inputPortByName['s'].widget.set(0.0377777777778, run=False)
 
49
    ScatterClassic_13.inputPortByName['c'].widget.set("g", run=False)
 
50
    apply(ScatterClassic_13.configure, (), {'expanded': True})
 
51
except:
 
52
    print "WARNING: failed to restore ScatterClassicNE named ScatterClassic in network masterNet"
 
53
    print_exc()
 
54
    ScatterClassic_13=None
 
55
 
 
56
try:
 
57
    ## saving node Index ##
 
58
    from Vision.StandardNodes import Index
 
59
    Index_14 = Index(constrkw = {}, name='Index', library=stdlib)
 
60
    masterNet.addNode(Index_14,28,221)
 
61
    apply(Index_14.configure, (), {'expanded': True})
 
62
except:
 
63
    print "WARNING: failed to restore Index named Index in network masterNet"
 
64
    print_exc()
 
65
    Index_14=None
 
66
 
 
67
try:
 
68
    ## saving node Index ##
 
69
    from Vision.StandardNodes import Index
 
70
    Index_15 = Index(constrkw = {}, name='Index', library=stdlib)
 
71
    masterNet.addNode(Index_15,257,217)
 
72
    apply(Index_15.inputPortByName['index'].widget.configure, (), {'max': 1})
 
73
    Index_15.inputPortByName['index'].widget.set(1, run=False)
 
74
    apply(Index_15.configure, (), {'expanded': True})
 
75
except:
 
76
    print "WARNING: failed to restore Index named Index in network masterNet"
 
77
    print_exc()
 
78
    Index_15=None
 
79
 
 
80
masterNet.freeze()
 
81
 
 
82
## saving connections for network ScatterClassic ##
 
83
if ReadTable_12 is not None and Index_14 is not None:
 
84
    try:
 
85
        masterNet.connectNodes(
 
86
            ReadTable_12, Index_14, "data", "data", blocking=True)
 
87
    except:
 
88
        print "WARNING: failed to restore connection between ReadTable_12 and Index_14 in network masterNet"
 
89
if ReadTable_12 is not None and Index_15 is not None:
 
90
    try:
 
91
        masterNet.connectNodes(
 
92
            ReadTable_12, Index_15, "data", "data", blocking=True)
 
93
    except:
 
94
        print "WARNING: failed to restore connection between ReadTable_12 and Index_15 in network masterNet"
 
95
if Index_14 is not None and ScatterClassic_13 is not None:
 
96
    try:
 
97
        masterNet.connectNodes(
 
98
            Index_14, ScatterClassic_13, "data", "x", blocking=True)
 
99
    except:
 
100
        print "WARNING: failed to restore connection between Index_14 and ScatterClassic_13 in network masterNet"
 
101
if Index_15 is not None and ScatterClassic_13 is not None:
 
102
    try:
 
103
        masterNet.connectNodes(
 
104
            Index_15, ScatterClassic_13, "data", "y", blocking=True)
 
105
    except:
 
106
        print "WARNING: failed to restore connection between Index_15 and ScatterClassic_13 in network masterNet"
 
107
masterNet.unfreeze()
 
108
#masterNet.run()
 
109