[SAGA-RG] SAGA Python language binding naming.

PFA van Zoolingen pzn400 at few.vu.nl
Thu Aug 14 14:29:52 CDT 2008


Hi,

>>
>> I would also suggest that enum like variables be entirely in capitals

By coincidence I was just discussing with Andre that in Permission None is 
a python keyword, but so is exec. So you have a point.


>> Is this a complete Python implementation or is it a wrapper around C++?
>
> Our implementation wraps around C++.  If I am not mistaken,
> Pauls implementation will wrap around Java (using Jython)?

Well, I am making a specification (which we all can use) and lateron 
adding the jython code to make it interact with the java reference 
implementation.

<from my readme>
....concerning the specification of the Python-SAGA
language binding. The result will be a Python specification which is
independent of the SAGA reference implementation (Cpp or Java). Later on
a java specific backend will be added with the help of Jython.. 
</end>

A user program imports saga.py. In saga.py an environment variable is 
extracted (SAGA_IMPLEMENTATION_NAME, not decided on final name), and 
saga.py uses this name to import the various implementation specific 
python modules. In my case the SAGA_IMPLEMENTATION_NAME is defined as 
sagajavaLB (still no final name) and in module sagajavaLB, the python 
files with the java specific code are imported.

By each time using 'from <name> import <class>' the user can use the 
classes like saga.file.File() instead of saga.sagajavaLB.sagaFile.File() 
Using this, the user could switch language binding implementation 
(python-to-java of python-to-cpp) by changing the environment variable.

In the cpp case, a sagacppLB.py could be added, which imports, (maybe even 
maps functions to existing functions), and calls the already defined 
python wrapper.


Paul


More information about the saga-rg mailing list