Skip to content

v2.0.0

Latest

Choose a tag to compare

@aschet aschet released this 16 Oct 14:04
9642e6d

Breaking release. The API is renamed to follow the standard, and the header now checks what it is given.

Breaking

  • Renamed: SdfDialect → Revision, SdfHeader → Header, SdfMetadata → Metadata, with_dialect → with_revision, --dialect → --revision.
  • Header.binary is replaced by Header.format. num_points and num_profiles are gone; use sdf.data.shape.
  • SdfFile.data_type and SdfFile.open are removed; use header.data_type and sdfio.read.
  • A Header rejects an unsupported data type, a non-positive z_scale and a non-ASCII manufacturer_id.
  • z_scale now defaults to "auto", and Metadata dates default to "now". None means "not recorded".
  • SdfFormatError is also a ValueError.
  • Codec helpers such as encode_raw and get_data_type are no longer in the top-level API.

New

  • SdfFile.from_array and SdfFile.with_data.
  • with_revision(..., refit_z_scale=True).
  • Revision.rules, for example max_binary_count.
  • Four examples: write, read, modify and plot.

Changed

  • Dates are held as UTC. Older revisions still store local time on disk.
  • Reading tolerates a byte order mark and NaN as BAD.

Fixed

  • A truncated or oversized binary header now raises SdfFormatError instead of struct.error or OverflowError.