What's new in h5py 3.16
=======================

New features
------------

* Pre-built packages on PyPI are now built with HDF5 2.0 (:pr:`2750`)
* h5py now marks itself compatible with free-threading Python (:pr:`2702`,
  :pr:`2745`). There are tests for this (:pr:`2761`), but there may still be
  bugs. Be cautious about relying on this in critical code.
* Support for storing NumPy complex numbers in HDF5 files using C99 complex
  number datatypes (:pr:`2694`). This feature is available with HDF5 library 2.0
  or above, so long as the compiler and the build platform implement the relevant
  C99 features.

  h5py will still convert NumPy complex numbers into an HDF5 compound datatype
  by default, preserving the behaviour from earlier versions. See
  :ref:`complex_dtypes` for how to use the new datatypes.
* New attributes :attr:`~.Dataset.filter_ids` and :attr:`~.Dataset.filter_names`
  to provide more precise information on the filters set up for a dataset
  (:pr:`2792`). See :ref:`dataset_compression`.
* New :meth:`h5py.Group.get` arguments to configure external links access
  properties: ``elink_mode``, ``elink_swmr`` and ``elink_locking`` (:pr:`2751`).
* Pre-built Mac & Windows packages on PyPI now bundle zlib 1.3.2 (:pr:`2808`).

Breaking Changes and Deprecations
---------------------------------

* Creating a dataset with neither ``data`` nor ``dtype`` specified is deprecated.
  We plan to make this an error in h5py 4.0. Use ``dtype='f4'`` to keep the
  current default (which is different from NumPy's default).
* ``h5py.config().read_byte_strings`` is deprecated. This has no effect since
  h5py 3.0, and we plan to get rid of it in 4.0.


Bug fixes
---------

* Indexing datasets with an array or list of indices is now much faster when
  selecting many indices (:pr:`2603`).
* Fixed a memory leak involving the object registry (:pr:`2783`).
* Fix selecting parts of a multi-dimensional dataset with a boolean array
  corresponding to the first dimension (:pr:`2769`).
* Correctly raise errors when trying to write data to a zero-sized dataset or
  a zero-sized slice (:pr:`2729`).
* When creating a dataset, the ``dtype=`` parameter can now be a
  :class:`TypeID <low:h5py.h5t.TypeID>` object from the low-level API.
* Various fixes for safe usage from multiple threads (:pr:`2795`, :pr:`2794`,
  :pr:`2764`).
* Trying to store region references in a dataset for object references now
  raises ``TypeError`` instead of discarding information (:pr:`2790`). See
  :doc:`/refs` for more about references.
* A list of reference objects can be used to create a dataset (:pr:`2790`).
* Fix getting filter details for the :ref:`scaleoffset filter
  <dataset_scaleoffset>` (:pr:`2781`).
* Better error message when attempting to slice a dataset with None or
  ``np.newaxis`` (:pr:`2731`).
* Pre-built Windows packages on PyPI now bundle a recent version of zlib
  (:pr:`2730`).
* Avoid replacing ``arr.shape``, which will break in some future version of
  NumPy (:pr:`2728`).
* Closing files should be slightly faster after a redundant call was removed
  (:pr:`2801`)


Exposing HDF5 functions
-----------------------

* H5Scombine_select, H5Smodify_select, and H5Sselect_copy (:pr:`2603`).

Building h5py
-------------

* Fix building against pre-release versions of NumPy (:pr:`2758`).
* Fix some compiler warnings (:pr:`2784`, :pr:`2791`).
* The package metadata now requires mpi4py 4.0.0 for MPI builds on Python <= 3.12
  (:pr:`2799`). This works around an issue building older mpi4py with recent
  versions of setuptools. If you are building from source yourself, it may still
  work with mpi4py 3.x.
