Skip to content

0.8.0

Compare
Choose a tag to compare
@aldanor aldanor released this 23 Oct 18:49
· 201 commits to master since this release
ab10c96

Added

  • Complete rewrite of DatasetBuilder; dataset creation API is now different
    and not backwards-compatible (however, it integrates all the new features
    and is more flexible and powerful). It is now possible to create and write
    datasets in one step. Refer to the API docs for full reference.
  • Added new Extents type matching HDF5 extents types: null (no elements),
    scalar, simple (fixed dimensionality); it is used to query and specify shapes
    of datasets. Extents objects are convertible from numbers and also tuples,
    slices and vectors of indices -- all of which can be used whenever passing
    extents is required (e.g., when creating a new dataset or an attribute).
  • Added new Selection type with the surrounding API closely matching native
    HDF5 selection API. This includes 'all' selection, point-wise selection and
    hyperslab selection (only 'regular' hyperslabs are supported -- that is,
    hyperslabs that can be represented as a single multi-dimensional box some of
    whose dimensions may be infinite). Selection objects are convertible from
    integers, ranges, tuples and arrays of integers and ranges; one can also use
    s! macro from ndarray crate if needed. Selections can be provided when
    reading and writing slices.
  • Support for LZF / Blosc filters has been added. These filters are enabled by
    "lzf" / "blosc" cargo features and depend on lzf-sys / blosc-src crates
    respectively. Blosc filter is a meta-filter providing multi-threaded access
    to the best-in-class compression codecs like Zstd and LZ4 and is recommended
    to use as a default when compression performance is critical.
  • Added new Filter type to unify the filters API; if LZF / Blosc filters are
    enabled, this enum also contains the corresponding variants. It is now also
    possible to provide user-defined filters with custom filter IDs and configs.
  • Added wrappers for dataset creation property list (DCPL) API. This provides
    access to the properties that can be specified at dataset creation time
    (e.g., layout, chunking, fill values, external file linking, virtual maps,
    object time tracking, attribute creation order, and a few other settings).
  • Virtual dataset maps (VDS API in HDF5 1.10+) are now supported.
  • Added wrappers for link creation property list (LCPL) API.
  • File creation property list (FCPL) API has been extended to include a few
    previously missing properties (object time tracking, attribute creation order
    and few other settings).
  • Added "h5-alloc" feature to hdf5-types crate. It enables using the HDF5
    library allocator for varlen types and dynamic values. This may be necessary
    on platforms where different allocators may be used in different libraries
    (e.g. dynamic libraries on Windows) or if libhdf5 is compiled with the
    memchecker option enabled. This option is force-enabled by default if using
    a dll version of the HDF5 library on Windows.
  • Added new DynValue type which represents a dynamic self-describing HDF5
    object that also knows how to deallocate itself. It supports all the HDF5
    types including compound types, strings and arrays.
  • Added support for attributes and a new Attribute object type. The attribute
    API uses the new dataset API with some restrictions imposed by HDF5 library
    (e.g. one can not perform partial IO, attributes must be read all at once).
  • hdf5-sys now exports new functions added in HDF5 1.10.6 and 1.10.7.
  • Added to Dataset:
    • layout: get the dataset layout.
    • dapl, access_plist: get the dataset access plist.
    • dcpl, create_plist: get the dataset create plist.
  • Added to Location:
    • loc_info, loc_info_by_name: retrieve information on a location.
    • loc_type, loc_type_by_name: retrieve location type.
    • open_by_token: open a location by its token (physical address).
  • Added to Group:
    • iter_visit: closure API for iterating over objects in a group.
    • iter_visit_default: like iter_visit but with default iteration order.
    • get_all_of_type: find all objects in a group of a given type.
    • Shortcut methods for finding all objects in a group of a given type:
      datasets, groups, named_datatypes, link_external.
  • Added to Handle:
    • id_type: get native HDF5 object type.
    • try_borrow: instantiate a handle but don't take ownership of the object.
    • Handle now implements Debug.
  • Added to ObjectClass:
    • cast(): safe counterpart to cast_unchecked().
  • Added to Object:
    • Safe downcast methods: as_file, as_group, as_datatype,
      as_dataspace, as_dataset, as_attr, as_location,
      as_container, as_plist.
  • Added to FileAccessBuilder:
    • libver_earliest, libver_v18, libver_v110, libver_latest:
      shortcuts for setting the minimum library version.
  • Added to FileAccess:
    • libver: shortcut for getting the minimum library version.

Changed

  • Required Rust compiler version is now 1.51.
  • Removed num-integer and num-traits dependencies.
  • Dataspace type has been reworked and can be now constructed from an
    Extents object and sliced with a Selection object.
  • Dataset::fill_value now returns an object of the newly added DynValue
    type; this object is self-describing and knows how to free itself.
  • Automatic chunking now uses a fill-from-back approach instead of the
    previously used method which was borrowed from h5py.
  • Removed the old Filters type (replaced by Filter that represents a
    single filter).
  • write_slice, read_slice, read_slice_1d, read_slice_2d in Container
    now take any object convertible to Selection (instead of SliceInfo).
  • Dataset::chunks has been renamed to Dataset::chunk.
  • Const generics support (MSRV 1.51): hdf5-types now uses const generics for
    array types, allowing fixed-size arrays of arbitrary sizes. Array trait has
    been removed. String types are now generic over size: FixedAscii<N> and
    FixedUnicode<N>.
  • ndarray dependency has been updated to 0.15.
  • The version of HDF5 in hdf5-src has been updated from 1.10.6 to 1.10.7.
  • zlib dependency is no longer included with default-features.
  • The crate no longer calls H5close automatically on program exit.
  • Errors are now silenced, and will not be written to stderr by default.
  • silence_errors now works globally instead of using guards.
  • Errors are no longer automatically expanded into error stacks when
    encountered. This can be still done manually (e.g. via printing the error).
  • Handles to HDF5 identifiers are no longer tracked via a global registry;
    identifier safety is now enforced via stricter semantics of ownership.
  • Handles to File objects will no longer close all objects contained in the
    file when dropped -- weak file close degree is now used instead. For the old
    behaviour see FileCloseDegree::Strong.
  • HDF5 global variables no longer create a lazy_static per variable.
  • Unsafe cast() in ObjectClass has been renamed to cast_unchecked().
  • Bump winreg (Windows only) to 0.10, pretty_assertions (dev) to 1.0.
  • Updated the example in the readme to showcase the new features.

Fixed

  • A potential memory leak of identifier handles has been identified and fixed.
  • A potential race condition occurring in multi-thread library initialisation
    has been identified and fixed.

Removed

  • Free-standing functions get_id_type, is_valid_id, is_valid_user_id
    have been removed in favor of Handle methods.