Skip to content

Commit

Permalink
Merge pull request #693 from jpype-project/release
Browse files Browse the repository at this point in the history
Release 0.7.3
  • Loading branch information
Thrameos authored Apr 21, 2020
2 parents 616ed89 + 5ac9f8f commit ad098a2
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 171 deletions.
127 changes: 82 additions & 45 deletions doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,67 +3,113 @@ Changelog

This changelog *only* contains changes from the *first* pypi release (0.5.4.3) onwards.

- **Next version - unreleased**
- **0.7.3 - 4-17-2020**

- java.util.Map conforms to Python abc.Mapping API.
- **Replaced type management system**, memory management for internal
classes is now completely in Java to allow enhancements for
buffer support and revised type conversion system.

- JFloat properly follows Java rules for conversion from JDouble.
JFloats outside of range map to inf and -inf.
- Python module ``jpype.reflect`` will be removed in the next release.

- ``jpype.startJVM`` option ``convertStrings`` default will become False
in the next release.

- Add support for direct conversion of multi-dimensional primitive arrays
with ``JArray.of(array, [dtype=type])``

- Fix bug that was causing java.lang.Comparable, byte[], and char[] to be unhashable.

- Corrected an issue with creation of Exceptions which lack a
default constructor.
- Undocumented feature of using a Python type in ``JObject(obj, type=tp)``
is deprecated to support casting to Python wrapper types in Java in a
future release.

- Fixed segfault when methods called by proxy have incorrect number of
arguments.
- Dropped support for Cygwin platform.

- Proxies pass Python exceptions properly rather converting to
java.lang.RuntimeException
- ``JFloat`` properly follows Java rules for conversion from ``JDouble``.
Floats outside of range map to inf and -inf.

- java.lang.Number converts automatically from Python and Java numbers.
- ``java.lang.Number`` converts automatically from Python and Java numbers.
Java primitive types will cast to their proper box type when passed
to methods and fields taking Number.

- java.lang.Object and java.lang.Number box signed, sized numpy types
- ``java.lang.Object`` and ``java.lang.Number`` box signed, sized numpy types
(int8, int16, int32, int64, float32, float64) to the Java boxed type
with the same size automatically. Architecture dependent numpy
types map to Long or Double like other Python types.

- Explicit casting using primitives such as JInt will not produce an
OverflowError. Implicit casting from Python types such as int or float
``OverflowError``. Implicit casting from Python types such as int or float
will.

- Returns for number type primitives will retain their return type
information. These are derived from Python int and float types
information. These are derived from Python ``int`` and ``float`` types
thus no change in behavior unless chaining from a Java methods
which is not allowed in Java without a cast.
JBoolean and JChar still produce Python types only.
``JBoolean`` and ``JChar`` still produce Python types only.

- Proxies created with JImplements properly implement toString, hashCode,
and equals.
- Add support for direct conversion of multi-dimensional primitive arrays
with ``JArray.of(array, [dtype=type])``

- JProxy.unwrap() will return the original instance object for proxies
- ``java.nio.Buffer`` derived objects can convert to memoryview if they
are direct. They can be converted to NumPy arrays with
``numpy.asarray(memoryview(obj))``.

- Proxies created with ``@JImplements`` properly implement ``toString``,
``hashCode``, and ``equals``.

- Proxies pass Python exceptions properly rather converting to
``java.lang.RuntimeException``

- ``JProxy.unwrap()`` will return the original instance object for proxies
created with JProxy. Otherwise will return the proxy.

- JProxy instances created with the convert=True argument will automatic
- JProxy instances created with the ``convert=True`` argument will automatic
unwrap when passed from Java to Python.

- java.nio.Buffer derived objects can convert to memoryview if they
are direct. They can be converted to numpy arrays with
``numpy.asarray(memoryview(obj))``.
- JProxy only creates one copy of the invocation handler per
garbage collection rather than once per use. Thus proxy objects
placed in memory containers will have the same object id so long
as Java holds on to it.

- Undocumented feature of using a Python type in ``JObject(obj, type=tp)``
is deprecated to support casting to Python wrapper types in Java in a
future release.
- ``@JImplements`` with keyword argument ``deferred`` can be started
prior to starting the JVM. Methods are checked at first object
creation.

- Fix bug that was causing ``java.lang.Comparable``, ``byte[]``,
and ``char[]`` to be unhashable.

- Fix bug causing segfault when throwing Exceptions which lack a
default constructor.

- Fixed segfault when methods called by proxy have incorrect number of
arguments.

- Fixed stack overflow crash on iterating ImmutableList

- ``java.util.Map`` conforms to Python ``collections.abc.Mapping`` API.

- ``java.lang.ArrayIndexOutOfBoundsException`` can be caught with
``IndexError`` for consistency with Python exception usage.

- ``java.lang.NullPointerException`` can be caught with ``ValueError``
for consistency with Python exception usage.

- jpype.reflect will be removed in the next release. convertStrings
default will become false in the next release.
- **Replaced type conversion system**, type conversions test conversion
once per type improving speed and increasing flexiblity.

- **0.7.2 - 2-28-2019**
- User defined implicit conversions can be created with ``@JConversion``
decorator on Python function taking Java class and Python object.
Converter function must produce a Java class instance.

- ``pathlib.Path`` can be implicitly converted into ``java.lang.File``
and ``java.lang.Path``.

- ``datetime.datatime`` can implicitly convert to ``java.time.Instant``.

- ``dict`` and ``collections.abc.Mapping`` can convert to ``java.util.Map``
if all element are convertable to Java. Otherwise, ``TypeError`` is
raised.

- ``list`` and ``collections.abc.Sequence`` can convert to ``java.util.Collection``
if all elements are convertable to Java. Otherwise, ``TypeError`` is
raised.

- **0.7.2 - 2-28-2020**

- C++ and Java exceptions hold the traceback as a Python exception
cause. It is no longer necessary to call stacktrace() to retrieve
Expand Down Expand Up @@ -104,13 +150,13 @@ This changelog *only* contains changes from the *first* pypi release (0.5.4.3) o
- Java arrays now properly assert range checks when setting elements
from sequences.

- Java arrays support memoryview API and no longer required numpy
- Java arrays support memoryview API and no longer required NumPy
to transfer buffer contents.

- Numpy is no longer an optional extra. Memory transfer to numpy
- Numpy is no longer an optional extra. Memory transfer to NumPy
is available without compiling for numpy support.

- JInterface is now a meta class. Use isinstance(cls, JInterface)
- JInterface is now a meta class. Use ``isinstance(cls, JInterface)``
to test for interfaces.

- Fixed memory leak in Proxy invocation
Expand All @@ -137,15 +183,6 @@ This changelog *only* contains changes from the *first* pypi release (0.5.4.3) o
- java.lang.IndexOutOfBoundsException can be caught with IndexError
for complience when accessing ``java.util.List`` elements.

- java.lang.NullPointerException can be caught with ValueError
for consistency with Python exception usage.

- JProxy only creates one copy of the invocation handler per
garbage collection rather than once per use. Thus proxy objects
placed in memory containers will have the same object id so long
as Java holds on to it.

- Dropped support for Cygwin.

- **0.7.1 - 12-16-2019**

Expand Down
24 changes: 11 additions & 13 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
JPype documentation
===================

JPype is a Python module to provide full access to Java from
within Python. It allows Python to make use of Java only libraries,
exploring and visualization of Java structures, development and testing
of Java libraries, scientific computing, and much more. By gaining
the best of both worlds using Python for rapid prototyping and Java
for strong typed production code, JPype provides a powerful environment
for engineering and code development.

This is achieved not through re-implementing Python, as
Jython/JPython has done, but rather through interfacing at the native
level in both virtual machines. This shared memory based
approach achieves decent computing performance, while providing the
access to the entirety of CPython and Java libraries.
JPype is a Python module to provide full access to Java from within Python. It
allows Python to make use of Java specific libraries, explore and visualize
Java structures, develop and test Java libraries, make use of scientific
computing, and much more. By enabling the use of Python for rapid prototyping
and Java for strong typed production code, JPype provides a powerful
environment for engineering and code development.

Unlike Jython, JPype does not achive this by re-implementing Python, but
instead by interfacing both virtual machines at the native level. This
shared memory based approach achieves good computing performance, while
providing the access to the entirety of CPython and Java libraries.

Parts of the documentation
==========================
Expand Down
Loading

0 comments on commit ad098a2

Please sign in to comment.