[kepler-users] Python execution within the Kepler Python actor...

J. Marc Edwards jmarcedwards at gmail.com
Sat Nov 5 08:17:50 PDT 2011


Christopher:

Ok... Thanks for clarifying the status of Jython in Kepler. Having said this, I would like to advance the objective of upgrading Kepler to use the latest version of Jython, namely version 2.5.2. Can you work with me on this task?

The task is primarily focused upon upgrading Ptolemy. Perhaps we can also gain some assistance from someone on that team as well.

What do you think of this idea?

Regards, Marc

J. Marc Edwards
Nimbis Services, Inc.

Christopher Brooks <cxh at eecs.berkeley.edu> wrote:

>Hi Marc,
>
>On 11/4/11 2:09 PM, J. Marc Edwards wrote:
>> I need a little help in integrating my Jython/Python code into the 
>> Python actor.
>>
>> 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.
>I don't know that much about Python, but I believe that you could use 
>the Python import facility to find imports.
>I just added text to the Kepler Jython page about this, see:
>https://kepler-project.org/developers/reference/python-and-kepler#how-jython-finds-imports
>
>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.
>> 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?).
>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.
>> After this all of the Java code for the actor follows with the 
>> standard initialize(), stop(), stopFire(), preinitialize(), 
>> terminate(), etc, methods.
>>
>> 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.
>>
>> 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.
>>
>> Can someone tell me how to go about achieving this objective?
>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
>
>http://jythonpodcast.hostjava.net/jythonbook/en/1.0/ModulesPackages.html
>
>_Christopher
>>
>> Thanks, Marc
>> -- 
>>
>> J. Marc Edwards
>> Lead Architect - Semiconductor Design Portals
>> Nimbis Services, Inc.
>> Skype: (919) 747-3775
>> Cell:  (919) 345-1021
>> Fax:   (919) 882-8602
>> marc.edwards at nimbisservices.com
>> www.nimbisservices.com
>>
>>
>>
>> _______________________________________________
>> Kepler-users mailing list
>> Kepler-users at kepler-project.org
>> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>
>-- 
>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
>


More information about the Kepler-users mailing list