[kepler-dev] [Bug 3150] - Need to add PTII Python actors back into Kepler

Dan Higgins higgins at nceas.ucsb.edu
Mon Feb 25 13:07:07 PST 2008

Hi Tristan (and others)

    I am becoming a great fan of Python/Jython as I learn more about it!

    I did discover a web page that explains just how jython picks what 
jars to cache (see http://wiki.python.org/jython/PackageScanning) 
Basically, jython apparently uses the java property 'java.class.path' 
which is set by defining the 'classpath' as an environment variable or 
on the command line launching java. Kepler uses the classpath, but now 
most of the jars are dynamically loaded rather than being defined on the 
classpath at launch. This explains why I was not seeing the python 
actors trying to cache all of the large number of Kepler jar files (and 
that is good!)

    So I have modified the ant file build-ptolemy.xml (in the head of 
CVS) used by Kepler to not exclude the PTII python actor code and have 
added jython.jar to Kepler's jars. So one can now use the 'Instantiale 
Component' menu item to put a Python actor onto a Kepler workflow. (The 
actors do not yet appear in the actor tree on the left.)

Dan Higgins

Tristan King wrote:
> I've done a lot of work with jython (my web portal to kepler runs ontop
> of jython), and played around with the PythonScript actor yesterday.
> When jython caches jar files, it simply writes it's caches to a
> directory cachedir, which is stored in the directory referred to by
> python.home jvm arg. if python.home isn't set, then it get's written to
> the same directory as jython.jar.
> This cache is only created once and updated whenever it detects changes
> to the jars it has caches, which may explain why it doesn't seem to
> cache everything. I wouldn't think it's a big problem, but it may be
> worth looking into the possibility of a "loading please wait..." dialog.
> Also, I don't think simply including the jython jar is enough to enable
> this actor, since it only includes the core set of python functionality.
> there are a lot of libraries that are commonly used that need to be
> included as well. I wrote a simple actor the other day that required the
> use of the xml libraries.
> If the user has an existing jython installation (like i do), simply
> setting python.home to their jython directory will enable these
> libraries. I've tested this and it works fine.
> I'm not sure how you would wedge this into kepler now tho, the easiest
> thing you could do is include the entire of jython in the kepler
> distribution, and set python.home in the startup script. (i just added a
> <jvmarg> to the build.xml, since i use ant run-dev to start kepler).
> Being an avid python fan, I really like this actor.
> On Mon, 2008-02-18 at 20:42 -0800, bugzilla-daemon at ecoinformatics.org
> wrote:
>> http://bugzilla.ecoinformatics.org/show_bug.cgi?id=3150
>> ------- Comment #2 from higgins at nceas.ucsb.edu  2008-02-18 20:42 -------
>> I have added the python/jython actors back into my own copy of kepler for
>> experimental testing. From the console output, the jython code is NOT caching
>> ALL jar files on the class path when the actor is instantiated.(and the startup
>> time is noticable but not severely long. It is going through some jars, but not
>> all of them. I think we need to understand just what determines jython caching.
>> Dan Higgins- Feb 18, 2008
>> _______________________________________________
>> Kepler-dev mailing list
>> Kepler-dev at ecoinformatics.org
>> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at ecoinformatics.org
> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev

More information about the Kepler-dev mailing list