Re: [thredds] Java to Python tools

Hi Sean:

It is still unclear what you folks are trying to do. If you want to just have 
the present (or modified version) of the netcdf-java called from Python, then 
something like jpype  might be the answer, though i can't say I have any 
experience with how well it works. Alternately, just start with existing python 
libraries, like Pydap and the netcdf4 library for python and add capabilities 
to that.  Pydap has a lot of features built in besides just the DAP protocol. 

-Roy



On Apr 4, 2012, at 7:13 AM, Sean Arms wrote:

> Hi Stephen,
> 
> One of the goals is to expose the CDM to cPython (so Jython is out). We see 
> many of our users (myself included) are/have moved to a 
> cPython/Numpy/Scipy/Matplotlib environment for scientific analysis of their 
> data, and it would be great to give them access to the CDM without rewriting 
> everything in cPython.
> 
> Thanks everyone for the feedback thus far!
> 
> Cheers!
> 
> Sean
> 
> On 04/04/12 07: 38, stephen.pascoe@xxxxxxxxxx wrote:
>> The important question is why you need Python.  If it's to access some C 
>> library with python bindings (e.g. numpy or netCDF4-python) then Jython 
>> isn't appropriate and you'll need one of those Python<->bridges JPype or 
>> Jepp.
>> 
>> If you need the very latest Python features (particularly Python 3) you'll 
>> also find Jython is a bit behind CPython.  Many standard Python frameworks 
>> now work with Jython (e.g. Django, SQLAlchemy) but you'd have to check the 
>> compatibility of each dependency.
>> 
>> Otherwise Jython is the most popular and well maintained choice.
>> 
>> Depending on your application you could also wire Java and Python together 
>> using inter-process communication.  There is a plethora of RPC libraries out 
>> there with good Python and Java support.  E.g. protocol buffers.
>> 
>> Stephen.
>> 
>> ---
>> Stephen Pascoe  +44 (0)1235 445980
>> Centre of Environmental Data Archival
>> STFC Rutherford Appleton Laboratory, Harwell Oxford, Didcot OX11 0QX, UK
>> 
>> 
>> -----Original Message-----
>> From: Robert Casey [mailto:rob@xxxxxxxxxxxxxxxxxxx]
>> Sent: 04 April 2012 14:31
>> To: Pascoe, Stephen (STFC,RAL,RALSP); John Caron
>> Cc: netcdf-java@xxxxxxxxxxxxxxxx; thredds@xxxxxxxxxxxxxxxx
>> Subject: Re: [thredds] Java to Python tools
>> 
>> 
>>      Hi John-
>> 
>>      If you use Jython, it looks to be pretty seamless.  I am just
>> starting to develop in Jython, so I can't claim experience in this
>> department yet.  The first section of this page details Java within
>> Jython.
>> 
>>      http://www.jython.org/jythonbook/en/1.0/JythonAndJavaIntegration.html
>> 
>>      -Rob
>> 
>> 
>> On Apr 4, 2012, at 1:02 AM,<stephen.pascoe@xxxxxxxxxx>  wrote:
>> 
>>> Hi John,
>>> 
>>> Direct experience beyond playing, no; but I've come across several
>>> options:
>>> 
>>> * Jpype  : http://sourceforge.net/project/jpype -- embeds a JVM in
>>> Python
>>> * Jepp   : http://jepp.soureforge.net -- embeds Python interpreter
>>> in Java
>>> * Jython : http://www.jython.org -- A Python implementation in the
>>> JVM.
>>> 
>>> I expect you want Jpype as in your case Python is doing the
>>> wrapping.  I tested it out once and it worked for me.  The project
>>> seems isn't exactly active but it still appears to be in use.
>>> 
>>> Cheers,
>>> Stephen.
>>> 
>>> ---
>>> Stephen Pascoe  +44 (0)1235 445980
>>> Centre of Environmental Data Archival
>>> STFC Rutherford Appleton Laboratory, Harwell Oxford, Didcot OX11
>>> 0QX, UK
>>> 
>>> 
>>> -----Original Message-----
>>> From: thredds-bounces@xxxxxxxxxxxxxxxx 
>>> [mailto:thredds-bounces@xxxxxxxxxxxxxxxx
>>> ] On Behalf Of John Caron
>>> Sent: 04 April 2012 00:20
>>> To: Java NetCDF; THREDDS community
>>> Subject: [thredds] Java to Python tools
>>> 
>>> Hi all:
>>> 
>>> Anyone have experience with ways to wrap java in Python? We are
>>> thinking
>>> about how to solve this issue again.
>>> 
>>> John
>>> 
>>> _______________________________________________
>>> thredds mailing list
>>> thredds@xxxxxxxxxxxxxxxx
>>> For list information or to unsubscribe,  visit: 
>>> http://www.unidata.ucar.edu/mailing_lists/
>>> -- 
>>> Scanned by iCritical.
>>> 
>>> _______________________________________________
>>> thredds mailing list
>>> thredds@xxxxxxxxxxxxxxxx
>>> For list information or to unsubscribe,  visit: 
>>> http://www.unidata.ucar.edu/mailing_lists/
> 
> _______________________________________________
> thredds mailing list
> thredds@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe,  visit: 
> http://www.unidata.ucar.edu/mailing_lists/ 

**********************
"The contents of this message do not reflect any position of the U.S. 
Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097

e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
voice: (831)-648-9029
fax: (831)-648-8440
www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.