<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Tommy and Christopher, thanks for the ideas,<br>
<br>
I think I'll give ObjectToken a whirl first.<br>
<br>
Rick<br>
<br>
Tommy Stropp wrote:
<blockquote cite="mid:SNT117-W53F78753EBF31F9590E8D8B7260@phx.gbl"
type="cite">
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>Hi Rick<br>
<br>
If you're just passing from one python actor to another, you should be
able to just pass it as an object. Just import ObjectToken:<br>
from ptolemy.data import ObjectToken<br>
then send your tuple through the port as an ObjectToken and make sure
you set the port type to object.<br>
In the receiving python actor, using the getValue() method will get you
your tuple back.<br>
<br>
- Tommy<br>
<br>
<br>
<br>
<br>
> Date: Thu, 9 Jul 2009 09:55:57 -0700<br>
> From: <a class="moz-txt-link-abbreviated" href="mailto:cxh@eecs.berkeley.edu">cxh@eecs.berkeley.edu</a><br>
> To: <a class="moz-txt-link-abbreviated" href="mailto:rem63@cornell.edu">rem63@cornell.edu</a><br>
> CC: <a class="moz-txt-link-abbreviated" href="mailto:kepler-users@kepler-project.org">kepler-users@kepler-project.org</a><br>
> Subject: Re: [kepler-users] help with Python Actors<br>
> <br>
> Hi Rick,<br>
> I'm not familiar with Python or Python tuples.<br>
> <a class="moz-txt-link-freetext" href="http://diveintopython.org/getting_to_know_python/tuples.html">http://diveintopython.org/getting_to_know_python/tuples.html</a><br>
> says "A tuple is an immutable list. A tuple can not be changed<br>
> in any way once it is created."<br>
> <br>
> You could try setting the type of the port to object, but<br>
> this might require hacking around with the Python actor code.<br>
> <br>
> It could be that there is a need for a PythonTuple type, which is<br>
> not that difficult to add if there is no need to convert from<br>
> other types to PythonTuple.<br>
> <br>
> --start--<br>
> 5.3 How do I add a type?<br>
> The Ptolemy Type system is covered in a chapter in "Volume 2:<br>
> Ptolemy II Software Architecture," which can be found via<br>
> <a class="moz-txt-link-freetext" href="http://ptolemy.eecs.berkeley.edu/ptolemyII/designdoc.htm">http://ptolemy.eecs.berkeley.edu/ptolemyII/designdoc.htm</a><br>
> <br>
> The Ptolemy Type system has a type lattice that is implemented<br>
> in classes in ptolemy.data.type. A common misconception is<br>
> that to add a type, one needs to add the new type to the type<br>
> lattice by editing ptolemy.data.type.BaseType.<br>
> However, you need only add a type to the type lattice if you want<br>
> to automatically convert your type to preexisting types (other<br>
> than UNKNOWN and GENERAL). If you have a type class, then the type<br>
> system will check types for you. For examples, see<br>
> $PTII/ptolemy/data/type/test/TestToken.java and<br>
> $PTII/ptolemy/actor/lib/Security/KeyToken.java.<br>
> --end--<br>
> <br>
> The advantage of adding a PythonTupleToken over using an
ObjectToken is<br>
> that with a PythonTupleToken, you can be sure that two actors are
sharing<br>
> the right data type instead of just a random Object.<br>
> <br>
> _Christopher<br>
> <br>
> Rick Moore wrote:<br>
> > I'm trying to use multiple Python Actors in a data validation
workflow. <br>
> > What I need to do is pass a Python tuple from one Python
Actor to the <br>
> > next, but I can't figure out how to configure the ports to
allow it. So <br>
> > far have tried setting the type to General and Unknown and
also leaving <br>
> > the type blank.<br>
> > <br>
> > I'm new at this, so any help would be greatly appreciated.<br>
> > <br>
> > Rick Moore<br>
> > Information Science<br>
> > Cornell University<br>
> > _______________________________________________<br>
> > Kepler-users mailing list<br>
> > <a class="moz-txt-link-abbreviated" href="mailto:Kepler-users@kepler-project.org">Kepler-users@kepler-project.org</a><br>
> >
<a class="moz-txt-link-freetext" href="http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users">http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users</a><br>
> <br>
> -- <br>
> Christopher Brooks (cxh at eecs berkeley edu) University of
California<br>
> CHESS Executive Director US Mail: 337 Cory Hall<br>
> Programmer/Analyst CHESS/Ptolemy/Trust Berkeley, CA 94720-1774<br>
> ph: 510.643.9841 fax:510.642.2718 (Office: 545Q Cory)<br>
> home: (F-Tu) 707.665.0131 (W-F) 510.655.5480<br>
> _______________________________________________<br>
> Kepler-users mailing list<br>
> <a class="moz-txt-link-abbreviated" href="mailto:Kepler-users@kepler-project.org">Kepler-users@kepler-project.org</a><br>
> <a class="moz-txt-link-freetext" href="http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users">http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users</a><br>
<br>
<hr>Windows Live helps you keep up with all your friends, <a
moz-do-not-send="true" href="http://go.microsoft.com/?linkid=9660824"
target="_new">in one place.</a></blockquote>
</body>
</html>