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

Tomasz Żok tzok at man.poznan.pl
Mon Mar 5 12:37:32 PST 2012


Hi Christopher and Derik,

thank you for your messages. I am using the same build-area for some  
time already. It dates Kepler 2.2, or maybe even earlier... I recall  
now, that there was a request to use build-area-2.3 some time ago -  
maybe this is the problem? I will redo my tests with it later this  
week and report here if it helped.

Thanks, regards,
Tomek


Cytowanie Derik Barseghian <barseghian at nceas.ucsb.edu>:

> Just another datapoint: I was also able to 'Instantiate Component'   
> ptolemy.actor.lib.python.PythonScript in kepler-2.3 and kepler trunk.
> Derik
>
> On Mar 5, 2012, at 10:19 AM, Christopher Brooks wrote:
>
>> Hi Tomek,
>>
>> I just checked Kepler-2.3 and the Kepler devel trunk and I was able  
>>  to instantiate
>> the Python actor.
>>
>> PyJavaInstance should not be present in the Kepler devel trunk.  I   
>> did the update
>> to Jython-2.5.2 on November 5, 2011, which is when I edited
>> ptolemy/actor/lib/python/PythonScript.java and removed the use of   
>> PyJavaInstance,
>>
>> Can you check your copy of PythonScript.java and make sure that it   
>> does not use
>> PyJavaInstance?
>>
>> Also, when I looked at your log, I see that the path to the Ptolemy  
>>  II tree was:
>>
>> /home/tzok/code/kepler-codebase/ptolemy/actor/lib/python/PythonScript.xml
>>
>> In my devel tree, this would be something like:
>> ~/src/kepler/ptolemy/src/ptolemy/actor/lib/python/PythonScript.java
>>
>> Note that my Ptolemy II tree is in "ptolemy/src", whereas yours is   
>> in "ptolemy".
>> The error message says "PythonScript.xml" because MoMLParser was looking
>> for a MoML class, which would be defined in a .xml file.  This is   
>> not a problem.
>>
>> Perhaps you have an old development tree?
>>
>> Here are the tests I ran.
>>
>> Note that PyJavaInstance is *not* present in the PythonScript uses   
>> in my Kepler devel tree, but
>> it is present in the PythonScript in Ptolemy II 8.0.1.
>>
>> bash-3.2$ grep PyJavaInstance   
>> ~/src/kepler/ptolemy/src/ptolemy/actor/lib/python/PythonScript.java
>> bash-3.2$ grep PyJavaInstance   
>> /Applications/Ptolemy/ptII8.0.1/ptolemy/actor/lib/python/*
>> Binary file   
>> /Applications/Ptolemy/ptII8.0.1/ptolemy/actor/lib/python/PythonScript.class  
>>  matches
>> /Applications/Ptolemy/ptII8.0.1/ptolemy/actor/lib/python/PythonScript.java:import   
>> org.python.core.PyJavaInstance;
>> /Applications/Ptolemy/ptII8.0.1/ptolemy/actor/lib/python/PythonScript.java:  
>>         object.__setattr__("actor", new PyJav\
>> aInstance(this));
>> /Applications/Ptolemy/ptII8.0.1/ptolemy/actor/lib/python/PythonScript.java:  
>>             object.__setattr__(new PyString(m\
>> angledName), new PyJavaInstance(
>> /Applications/Ptolemy/ptII8.0.1/ptolemy/actor/lib/python/PythonScript.java:  
>>             object.__setattr__(new PyString(m\
>> angledName), new PyJavaInstance(
>> /Applications/Ptolemy/ptII8.0.1/ptolemy/actor/lib/python/PythonScript.java:  
>>      *  an instance of PyJavaInstance. The re\
>> sult of invoking the method
>> /Applications/Ptolemy/ptII8.0.1/ptolemy/actor/lib/python/PythonScript.java:  
>>                             convertedArgs[i] \
>> = new PyJavaInstance(args[i]);
>> bash-3.2$
>>
>>
>> BTW - my notes about Python and Kepler are at
>> https://kepler-project.org/developers/reference/python-and-kepler
>>
>> _Christopher
>>
>>
>> On 3/5/12 12:22 AM, Tomasz Żok wrote:
>>> I forgot to attach the log from Kepler in the first message, here   
>>> it is now,
>>> sorry for double post.
>>>
>>> Best regards,
>>> Tomek
>>>
>>>
>>> On 03/05/12 at 09:14am, Tomasz Żok wrote:
>>>
>>>> Hi,
>>>>
>>>> I am aware that this topic is few months old, but I would like to  
>>>>  reopen the
>>>> discussion. It seems that the current version of Kepler is still   
>>>> not working
>>>> with Jython 2.5.2
>>>>
>>>> First of all, I have my Kepler from trunk (with Ptolemy set to   
>>>> HEAD revision)
>>>> and it is up-to-date. Here is my Jython version:
>>>>
>>>> $ java -jar ptolemy/src/lib/jython.jar
>>>> Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
>>>> [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_03-icedtea
>>>>
>>>> However the actor ptolemy.actor.lib.python.PythonScript does not   
>>>> work. When I
>>>> try to instantiate it, I get the following error: (a more detailed log is
>>>> attached)
>>>>
>>>> java.lang.NoClassDefFoundError: org/python/core/PyJavaInstance
>>>>
>>>>
>>>> >From the discussion I assumed there is a workaround implemented   
>>>> in Kepler to
>>>> use PyJavaType.wrapJavaObject instead of PyJavaInstance, but the   
>>>> error I get
>>>> indicates the opposite. So what is the status of PythonScript   
>>>> actor? Is this
>>>> update to Jython 2.5.2 supported?
>>>>
>>>> Best regards,
>>>> Tomek
>>>>
>>>> --
>>>> Tomasz Zok
>>>> Poznan Supercomputing and Networking Center
>>>> ul. Noskowskiego 10, 61-704 Poznan, POLAND
>>>>
>>>> http://www.man.poznan.pl
>>>>
>>>> _______________________________________________
>>>> Kepler-users mailing list
>>>>
>>>> Kepler-users at kepler-project.org
>>>> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>> _______________________________________________
>> Kepler-users mailing list
>> Kepler-users at kepler-project.org
>> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>
>



-- 
Tomasz Zok
Poznan Supercomputing and Networking Center
ul. Noskowskiego 10, 61-704 Poznan, POLAND
http://www.man.poznan.pl

----------------------------------------------------------------
This message was sent using PSNC Webmail system.



More information about the Kepler-users mailing list