Skip to main content

Java interface for GEMSEO.

Project description

Contains two Java-GEMSEO interfaces:

Installation

Set JAVA_HOME: path to the root installation directory of the Java JDK.

Install with:

pip install .

At runtime, you shall configure:

  • On linux, LD_LIBRARY_PATH: add the path to the JEP python package,

  • On MacOS, DYLD_LIBRARY_PATH: add the path to the JEP python package,

  • On Windows, PATH: add the path to the JEP python package,

  • CLASSPATH: add the jep package provided when installing jep in the Python distribution to the java classpassth,

See the JEP (https://github.com/ninia/jep/wiki/Getting-Started) documentations for further information.

Java MDODiscipline

The Java abstract MDODiscipline is defined in the package com.irt.saintexupery.discipline.

Examples for the Sellar problem: com.irt.saintexupery.problems.sellar

The analytical derivatives (gemseo.discipline.MDODiscipline._compute_jacobian) are not supported yet.

JEP specific issues

For the JEP interface, you shall wrap the MDODiscipline wrapper using the JepMDODisciplineAdapter:

import com.irt.saintexupery.discipline.JepMDODisciplineAdapter;
import com.irt.saintexupery.problems.sellar.Sellar1;
MDODiscipline sellar1 = new JepMDODisciplineAdapter(new Sellar1());

Examples

Please look at examples/java_examples and examples/python_examples.

Frequent issues

“Exception in thread “main” java.lang.UnsatisfiedLinkError: no jep in java.library.path:” Add Jep to the classpath.

If Jep is still undetected, please check that the compiled “jep.dll” is well included as a native library.

Some ideas on Java-Python bridge technologies

Many libraries provide Java-Python interprocess communications and serialization. However many of them have limitations such as Jython that does not support all the compiled extensions of Python because it is a re-implementation of the Python interpreter in Java. Others use sockets such as py4j and this can deal with performance and security issues.

Both JNIUS and JEP are based on the C APIs of CPython and Java JNI (Java Native Interface). This avoids memory copies, so precision and performance losses, which is key for numerical computing.

JNIUS allows to call Java code from python, JEP allows to call Python from Java, and re-enter in the Java code. However both technologies cannot be mixed, JEP cannot call JNIUS code.

This is why the two solutions are proposed here.

Authors

  • François Gallard

  • Pascal Le Métayer

  • Antoine Dechaume

License

LGPL v3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gemseo-java-1.0.0.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

gemseo_java-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file gemseo-java-1.0.0.tar.gz.

File metadata

  • Download URL: gemseo-java-1.0.0.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for gemseo-java-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e1e6b4e877fbf5dd7ab889a008b624ceaf564bf75ba53727566e41ba6f878f31
MD5 d8eecb4329eed832f01a69d98aefeb26
BLAKE2b-256 6afacd502f1d9ac0e2f5caa879da3c06bc134fb6b3b5d0917052a3c72ff1b209

See more details on using hashes here.

File details

Details for the file gemseo_java-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gemseo_java-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for gemseo_java-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 295b02a59c3eed84e4e39cb611fa58aa4465797d10d8be386786963aec7d94fd
MD5 3168127dcc6d7f8cd8bd4c90f61acc3b
BLAKE2b-256 623b0d3c57547a891b40468d840032b56216249636454d536dc926a1bf2eb06b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page