• This repository has been archived on 05/Aug/2021
  • Stars
    star
    187
  • Rank 206,464 (Top 5 %)
  • Language
    C
  • License
    Apache License 2.0
  • Created almost 11 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A bi-directional Python-Java bridge used to embed Java in CPython or the other way round.

Build Status Documentation Status


‼️ We moved to jpy-consortium/jpy

jpy is now being further developed in a dedicated GitHub organision maintained by members of the companies DeepHaven and Brockmann Consult. This repo will soon be archived. Please use the new jpy-consortium/jpy for any issues or PRs, thanks!


jpy - a Python-Java Bridge

jpy is a bi-directional Python-Java bridge which you can use to embed Java code in Python programs or the other way round. It has been designed particularly with regard to maximum data transfer speed between the two languages. It comes with a number of outstanding features:

  • Fully translates Java class hierarchies to Python
  • Transparently handles Java method overloading
  • Support of Java multi-threading
  • Fast and memory-efficient support of primitive Java array parameters via Python buffers (e.g. Numpy arrays)
  • Support of Java methods that modify primitive Java array parameters (mutable parameters)
  • Java arrays translate into Python sequence objects
  • Java API for accessing Python objects (jpy.jar)

jpy has been tested with Python 3.4–3.8 and OpenJDK 8 on 64-bit Ubuntu Linux, Windows 10, and macOS.

The initial development of jpy was driven by the need to write Python extensions to an established scientific imaging application programmed in Java, namely the SNAP toolbox, the SeNtinel Application Platform project, funded by the European Space Agency (ESA). (jpy is bundled with the SNAP distribution.)

Writing such Python plug-ins for a Java application usually requires a bi-directional communication between Python and Java since the Python extension code must be able to call back into the Java APIs.

For more information please have a look into jpy's

How to build wheels for Linux and Mac

Install a JDK 8, preferably the Oracle distribution. Set JDK_HOME or JPY_JDK_HOME to point to your JDK installation and run the build script:

$ export JDK_HOME=<your-jdk-dir>
$ export JAVA_HOME=$JDK_HOME
$ python setup.py build maven bdist_wheel

On success, the wheel is found in the dist directory.

To deploy the jpy.jar (if you don't know why you need this step, this is not for you)::

$ mvn clean deploy -DskipTests=true

How to build a wheel for Windows

Set JDK_HOME or JPY_JDK_HOME to point to your JDK installation. You'll need Windows SDK 7.1 or Visual Studio C++ to build the sources. With Windows SDK 7.1::

> SET VS90COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
> SET DISTUTILS_USE_SDK=1
> C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\setenv /x64 /release
> SET JDK_HOME=<your-jdk-dir>
> python setup.py build maven bdist_wheel

With Visual Studio 14 and higher it is much easier::

> SET VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
> SET JDK_HOME=<your-jdk-dir>
> python setup.py build maven bdist_wheel

On success, the wheel can be found in the dist directory.

How to install from sources

TBD

Releasing jpy

The target reader of this section is a jpy developer wishing to release a new jpy version. Note: You need to have Sphinx installed to update the documentation.

  1. Make sure all Java and Python units tests run green
  2. Remove the -SNAPSHOT qualifier from versions names in both the Maven pom.xml and setup.py files, and update the version numbers and copyright years in jpyutil.py and doc/conf.py.
  3. Generate Java API doc by running mvn javadoc:javadoc which will update directory doc/_static
  4. Update documentation, cd doc and run make html
  5. http://peterdowns.com/posts/first-time-with-pypi.html

Automated builds

As of 2020-08-27, Python wheel packages for jpy are automatically built on AppVeyor, but at present they are uploaded only to a private FTP server and not publicly released. Wheels are built for Python versions 3.4, 3.5, 3.6, 3.7, and 3.8 on Linux, Windows, and macOS (β‰₯10.9). Only 64-bit wheels are built.

The repository also contains an outdated configuration for automated Travis builds, but this configuration is currently unmaintained and broken.

More Repositories

1

beam

ESA Earth Observation Toolbox and Java Development Platform
Java
64
star
2

zappend

Robustly creating and updating Zarr data cubes from smaller subsets
Python
40
star
3

jzarr

A Java implementation of the API offered by the Python zarr package
Java
29
star
4

epr-api

Envisat Reader API for C
C
15
star
5

calvalus2

Cal/Val and User Services: Utilising Apache Hadoop and SNAP for Earth Observation Data
Java
15
star
6

sst-cci-toolbox

A toolbox for the processing, analysis and validation of the Sea-Surface Temperature (SST) data products related to the ESA Climate Change Initiative (CCI).
Java
12
star
7

jnn

Backpropagation neural-network API for Java
Java
11
star
8

nc2zarr

A Python tool that converts NetCDF files to Zarr format
Python
9
star
9

beam-idepix

Generic classification of pixels (cloud, snow, ice, land, water) originating from optical sensors
Makefile
9
star
10

ceres

A Java API supporting module-based software architecture
Java
9
star
11

eo-child-gen

Modules for EO data subset product generation
Java
7
star
12

beam-meris-icol

ICOL Processor (Improve Contrast over Ocean and Land)
Java
7
star
13

beam-meris-core

Core modules related to Envisat/MERIS
Java
7
star
14

beam-globalbedo

The ESA GlobAlbedo project will develop a broadband albedo map of the entire Earth’s land surface (snow and snow-free), which is required for use in climate modelling and research. An initial group of six users are working with the GlobAlbedo project team to define requirements and drive the project towards practical applications of the products.
Java
7
star
15

smos-box

A BEAM-toolbox dedicated to the SMOS sensor
Java
6
star
16

beam-meris-case2

Project of MERIS Case-2-Regional, Eutrophic Lakes and Boreal Lakes Processors
Java
6
star
17

beam-gpf-devtools

Developer Tools for the BEAM Graph Processing Framework (GPF)
Java
6
star
18

beam-meris-qaa

Quasi-Analytical IOP Processor (QAA) for MERIS L1b
Java
6
star
19

beam-contrib

Contribution modules to the BEAM project
Java
6
star
20

bc-commons

Common code for closed source projects
Java
6
star
21

s3tbx-c2rcc

Case-2 Regional / Coast Colour AC+IOP Processor
Java
5
star
22

beam-plugin-aggregator

Aggregate multiple BEAM related projects for the build server
5
star
23

beam-metop-avhrr-reader

BEAM reader for Metop-AVHRR products
Java
5
star
24

nujan

Pure Java NetCDF4 and HDF5 writer
Java
5
star
25

beam-meris-aatsr-flint

Java
5
star
26

glob-box

A BEAM-toolbox dedicated to EO data product with global coverage
Java
5
star
27

coastcolour

data processors used in the CoastColour project of the European Space Agency
Java
5
star
28

beam-meris-glint

ChucK
5
star
29

beam-third-party

Maintenance repository of third party modules
Java
4
star
30

beam-aatsr-recalibration

Java
4
star
31

beam-meris-aatsr-synergy

MERIS/AATSR Synergy Toolbox
Java
4
star
32

chris-box

A BEAM-toolbox dedicated to the CHRIS/Proba sensor
Java
4
star
33

snap-idepix

Collection of IdePix pixel classification modules for various sensors
Java
4
star
34

maven

Various Maven plug-ins used in diverse projects at Brockmann Consult
Java
4
star
35

beam-meris-aatsr-snowradiance

Java
3
star
36

globcolour

Project for the GlobColour-MatchUp-Tool.
Java
3
star
37

nnif

Neural Network Interface
C
3
star
38

beam-watermask

An operator for computing an accurate land/water mask using SRTM-shapefiles
Java
3
star
39

snap-novasar-reader

Reader of NovaSAR data products for SNAP
Java
2
star
40

sen4lst

Sentinel for Land Surface Temperature
Java
2
star
41

s3-synergy

Sentinel-3 O-L2PP Synergy
C++
2
star
42

beam-download-servlet

Java
2
star
43

xcube-hub

Python
2
star
44

cdo-cli

CDO Command Line Interface
Java
2
star
45

l1c-syn-tool

Sentinel-3 OLCI/SLSTR L1C Synergy Tool for SNAP
Java
2
star
46

opec-tools

This repository hosts supportive tools for the EU project OpEc.
nesC
1
star
47

iavisa-ct

IAVISA Cloud Test Library
C
1
star
48

beam-opendap

Java
1
star
49

esa-pfa

EO Product Feature Extraction and Analysis
Java
1
star
50

suhet

ESA Sentinel Expoitation Tools for BEAM
Java
1
star
51

beam-globveg

Operator for the GlobVegetation project
Java
1
star
52

fiduceo

source base for Horizon-2020 project "Fiduceo"
Java
1
star
53

s3tbx-snow

Processors and tools for the retrieval of snow properties within the SEOM S3-SNOW project
Java
1
star
54

bc-wps

Java
1
star
55

thredds-iosp

An IOSP that enables thredds OPeNDAP server to handle all files accepted by BEAM
Java
1
star
56

fuzzy-decision-tree

A Java decision tree implementation which uses fuzzy membership functions
Java
1
star
57

beam-waterradiance

A BEAM module aiming at improving EO radiance measurements above water surfaces
Java
1
star
58

s2tbx-aerosol-retrieval

Aerosol retrieval from S2-MSI following USwansea algorithm as used in GlobAlbedo project for MERIS/VGT.
Java
1
star
59

lc-cci-toolbox

Tools that support the LC_cci processing chains
Java
1
star
60

snap-fuzzy-decision-tree-classifier

Performs classifications based on fuzzy decision trees.
Java
1
star
61

urban-tep

A repository for the Urban TEP project
Python
1
star
62

merisva-reader

Java
1
star
63

beam-extapi

A BEAM API for C/C++ and Python programmers
C
1
star
64

EO4SD

CSS
1
star
65

snap-slope

Performs computation of slope, aspect, orientation from altitude (i.e. DEM) product.
Java
1
star
66

s3tbx-aerosol-retrieval

Aerosol retrieval from Sentinel3-OLCI following USwansea algorithm as used in GlobAlbedo project for MERIS/VGT.
Java
1
star
67

doors-dashboards

Repository for development of dashboards in context of the DOORS project.
Python
1
star