<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Marc,<br>
I updated Jython to 2.5.2, it was not that hard, updating the
license files took the most time.<br>
<br>
I have a few of misgivings about Jython that might be good lessons
for Ptolemy and Kepler:<br>
<br>
* Sadly, ptII/lib/jython.jar went from about 1Mb to 10Mb. Does this
mean that Jython-2.5.2 is 10 times better than Jython-2.2.1?<br>
If jython is supposed to be a scripting language, then why is it so
large?<br>
This seems to be a common trend where nice small languages get more
and more features.<br>
As an aside about Perl, see <br>
Is Perl Better Than a Randomly Generated Programming Language? at<br>
<a class="moz-txt-link-freetext" href="http://developers.slashdot.org/story/11/10/27/213231/is-perl-better-than-a-randomly-generated-programming-language">http://developers.slashdot.org/story/11/10/27/213231/is-perl-better-than-a-randomly-generated-programming-language</a><br>
<br>
For comparison purposes, Ptolemy's ptsupport.jar is 3.5Mb and a
standalone Ptolemy demo including the GUI is 6.5Mb in jars.<br>
<br>
Lesson: we need to keep an eye on code bloat and be able to deploy
small run times.<br>
<br>
* Another issue with Jython-2.5.2 is that because they removed
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
org.python.core.PyJavaInstance some time after Jython-2.2.1, they
should have released Jython-2.5.2 as Jython-3.x. Most projects bump
up the major version number when there are incompatibilities.<br>
<br>
Lesson: Ptolemy bumps up the major version number with each ~yearly
release. Ptolemy has backward compatibility filters. We do
sometimes remove old code, but only with major versions.<br>
<br>
* The Jython license situation is a mess.<br>
<a class="moz-txt-link-freetext" href="http://www.jython.org/license.html">http://www.jython.org/license.html</a> lists these licenses<br>
- The Python Software Foundation License Version 2, which according
to Wikipedia is a BSD-style license<br>
- The Jython-2.0 and 2.1 license, which is similar to a BSD-style
license<br>
- The JPython 1.1.x license, which is similar to BSD-style license<br>
<br>
The software ships with these licenses in the LICENSE.txt file.<br>
<br>
However, LICENSE_CPython.txt and LICENSE_Apache.txt are included.
There is no mention as to what code actually uses those licenses.<br>
LICENSE_CPython.txt includes four copyrights: <br>
- Python Software Foundation License Version 2<br>
- BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0<br>
- CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1<br>
- CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2<br>
The last three look similar to BSD, but have various requirements.<br>
<br>
I'll submit a bug report to Jython to get them to update their site.<br>
<br>
Lesson: I'm not sure how Ptolemy and Kepler can avoid a similar
complexity issue. I've been working on updating our license file
and<br>
we have a way to determine what licenses are used by a particular
configuration.<br>
<a class="moz-txt-link-freetext" href="http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII8.0/copyright.htm">http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII8.0/copyright.htm</a> <br>
lists 7 licenses used by Ptiny, a small configuration of Ptolemy
II. One of those 7 is the Jython-2.2.1 license, which is similar to
the Jython-2.5.2 license.<br>
The Kepler configuration of Ptolemy II uses 15 licenses in the
Ptolemy II code.<br>
<br>
_Christopher<br>
<br>
On 11/5/11 9:15 AM, J. Marc Edwards wrote:
<blockquote
cite="mid:019901cc9bd6$18f667d0$4ae33770$@nimbisservices.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"Comic Sans MS";
panose-1:3 15 7 2 3 3 2 2 2 4;}
@font-face
{font-family:Ubuntu;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D">Christopher:<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D">I
suspect that I can simply code an entire actor extending the
respective classes directly in Jython.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D">That
is what I am thinking. Please let me know what you think of
this strategy.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D">Of
course, while I do this, I want to migrate a Kepler
development tree to use Jython 2.5.2, which I will need your
assistance in completing.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D">Let’s
talk on the phone on Monday.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D">Regards,
Marc<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><u><span
style="font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D">J.
Marc Edwards, Lead Architect</span></u><span
style="font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><i><span
style="font-family:"Calibri","sans-serif";color:#002060">Semiconductor
Design Portals<o:p></o:p></span></i></p>
<p class="MsoNormal"><b><span
style="font-size:14.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Nimbis
Services, Inc.<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family:"Courier
New";color:#1F497D">Cell - (919) 345-1021<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New";color:#1F497D">Fax - (919) 882-8602<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New";color:#1F497D">Skype - (919) 747-3775<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#C00000"><a class="moz-txt-link-abbreviated" href="mailto:jmarcedwards@gmail.com">jmarcedwards@gmail.com</a><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#C00000"><a class="moz-txt-link-abbreviated" href="mailto:marc.edwards@nimbisservices.com">marc.edwards@nimbisservices.com</a><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span
style="font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
Christopher Brooks [<a class="moz-txt-link-freetext" href="mailto:cxh@eecs.berkeley.edu">mailto:cxh@eecs.berkeley.edu</a>] <br>
<b>Sent:</b> Friday, November 04, 2011 9:00 PM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:marc.edwards@nimbisservices.com">marc.edwards@nimbisservices.com</a><br>
<b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:kepler-users@kepler-project.org">kepler-users@kepler-project.org</a><br>
<b>Subject:</b> Re: [kepler-users] Python execution
within the Kepler Python actor...<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Marc,<br>
<br>
On 11/4/11 2:09 PM, J. Marc Edwards wrote: <o:p></o:p></p>
<p class="MsoNormal">I need a little help in integrating my
Jython/Python code into the Python actor.<br>
<br>
When I double-click on the Python actor in the
PythonDialogExample, a window with the Python code appears. I
can of course edit the code from within this window. However,
I want to perform my code development and editing from within
my Eclipse environment from my Kepler development build.<o:p></o:p></p>
<p class="MsoNormal">I don't know that much about Python, but I
believe that you could use the Python import facility to find
imports.<br>
I just added text to the Kepler Jython page about this, see:<br>
<a moz-do-not-send="true"
href="https://kepler-project.org/developers/reference/python-and-kepler#how-jython-finds-imports">https://kepler-project.org/developers/reference/python-and-kepler#how-jython-finds-imports</a><br>
<br>
Note that I found a few other references on the web, included
what appears to be people who are using the full version of
Python (not Jython) with Kepler.<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">When I "open the actor", the beginning of
the file has some Javadoc as well as what appear to be some
unmatched XML elements (<p>), along with some matching
XML element tags (</pre>) (does this correspond to some
pre-fire method?).<o:p></o:p></p>
<p class="MsoNormal">When you open the actor, you are seeing the
Java code that implements the PythonActor. The <p> tags
are html tags used in the javadoc comments of the Java file.
All of the instances of the PythonActor share the same Java
code, but may have different Python code.<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">After this all of the Java code for the
actor follows with the standard initialize(), stop(),
stopFire(), preinitialize(), terminate(), etc, methods.<br>
<br>
I do see in the Java code where there is a PythonScript method
that accepts a CompositeEntity where a script template is
provided where I am supposing a long Python string in the
script.setExpression is defined.<br>
<br>
However, what I would like to do is simply include my Jython
module within my Kepler build and debug my Jython code in
connection with my overall workflow.<br>
<br>
Can someone tell me how to go about achieving this objective?<o:p></o:p></p>
<p class="MsoNormal">It looks like Jython uses sys.path to find
imports. I included a Ptolemy II model that opens in the
devel version of Kepler that lists the contents of sys.path.
For further information about sys.path, see<br>
<br>
<a moz-do-not-send="true"
href="http://jythonpodcast.hostjava.net/jythonbook/en/1.0/ModulesPackages.html">http://jythonpodcast.hostjava.net/jythonbook/en/1.0/ModulesPackages.html</a><br>
<br>
_Christopher<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><br>
Thanks, Marc<o:p></o:p></p>
<div>
<p class="MsoNormal">-- <br>
<br>
<o:p></o:p></p>
<p><span style="font-size:13.0pt;font-family:"Comic Sans
MS";color:purple">J. Marc Edwards</span><span
style="font-family:"Comic Sans MS""><br>
Lead Architect - Semiconductor Design Portals</span><br>
<span
style="font-size:13.5pt;font-family:"Arial","sans-serif";color:#3333FF">Nimbis
Services, Inc.</span><br>
<span style="font-family:"Courier New"">Skype:
(919) 747-3775<br>
Cell: (919) 345-1021<br>
Fax: (919) 882-8602</span><br>
<span
style="font-family:"Ubuntu","serif""><a
moz-do-not-send="true"
href="mailto:marc.edwards@nimbisservices.com">marc.edwards@nimbisservices.com</a><br>
<a moz-do-not-send="true"
href="http://www.nimbisservices.com">www.nimbisservices.com</a></span><o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Kepler-users mailing list<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="mailto:Kepler-users@kepler-project.org">Kepler-users@kepler-project.org</a><o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users">http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users</a><o:p></o:p></pre>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Christopher Brooks, PMP University of California<o:p></o:p></pre>
<pre>CHESS Executive Director US Mail: 337 Cory Hall<o:p></o:p></pre>
<pre>Programmer/Analyst CHESS/Ptolemy/Trust Berkeley, CA 94720-1774<o:p></o:p></pre>
<pre>ph: 510.643.9841 (Office: 545Q Cory)<o:p></o:p></pre>
<pre>home: (F-Tu) 707.665.0131 cell: 707.332.0670 <o:p></o:p></pre>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Christopher Brooks, PMP University of California
CHESS Executive Director US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust Berkeley, CA 94720-1774
ph: 510.643.9841 (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 cell: 707.332.0670 </pre>
</body>
</html>