Hello Bruno

Le 08/05/2018 à 11:08, Bruno P. Kinoshita a écrit :

> Without looking at the Python module with more calm, isn't it common
> to use Jython for creating a bridge from Python to access Java
> objects? Any reason for using JPY instead? (hadn't heard about it).
>
In my understanding, JPython is not really a Java-Python bridge but
rather a Python implementation running on the JVM. Executing Python
scripts in JPython make easy to interact with Java since they are
running on the same JVM. However (if I understood correctly), invoking
native C/C++ code from JPython is complicated.

The Python developers I spoke to told me that they like Python because
it is easy to invoke C/C++ code form Python. They use Python with GDAL
and other C/C++ libraries, together with Python modules (NumPy, SciPy)
which use C/C++ code for fast calculations on arrays. For example the
Open Data Cube project (https://www.opendatacube.org/) relies on Python
with those C/C++ libraries. Interoperability between Open Data Cube and
Apache SIS is actually the requirement that trigged this Java-Python
bridge work in GeoAPI.

So if I understood correctly, it would not be possible to execute Open
Data Cube on JPython (but I did not tried). The JPY project allow us to
have Open Data Cube executed on the native Python interpreter, and still
communicate with the JVM.


> At work (research company) most scientists are using R and Python. So
> perhaps if it's simple enough, there could be something similar with
> rJava?
>
I was not familiar with R-Java, thanks for the tip. However my goal here
is not to create a generic Python-Java or R-Java bridge, but only
bridges for the specific case of GeoAPI interfaces in those two
languages. Since we have no GeoAPI interfaces in R, the question of
R-Java bridge does not yet apply in this context (unless someone
volunteer, of course).


> (… snip …) And most sections contain a short example, similar to what
> you would see in a Jupyter notebook. When I click on "Spatial
> representation", I see the description of the types, but not how to
> use it.
>
Yes, documentation needs to be improved. GeoAPI interfaces should be
about the same (for most parts) in Java and Python, so a documentation
would be common to both of them. I do not know yet what would be the
best way to share examples in a cross-languages fashion.


> If there are some issues for this API, I'd be happy to spend some
> spare time reading the docs, and trying to suggest a few paragraphs
> for installation, requirements, and some examples. That way I will
> learn about it as well.
>
Thanks!

    Martin


Reply via email to