Skip to content

Antropy v0.2.2

Latest

Choose a tag to compare

@raphaelvallat raphaelvallat released this 01 Apr 21:31
dfbe688

Summary — v0.2.2 (April 2026)

Permutation entropy

Support for 2D arrays

  • perm_entropy now accepts 2-D arrays of shape (n_channels, n_times) for order ∈ {3, 4}, computing entropy for every row in a single vectorised call.

Speed-up:

  • perm_entropy fast path (only for order 3 or 4): ordinal patterns are now encoded via pairwise comparison bit-keys and counted with np.bincount rather than argsort + np.unique, giving a major speed-up
  • perm_entropy general path (order > 4): the embedded matrix is now built as a zero-copy as_strided view and the hash is computed via a single @ product instead of an element-wise multiply + sum (faster).

Bugfixes

  • perm_entropy now applies a small positional epsilon jitter before sorting, making results fully deterministic across platforms and dtypes. Previously, integer-typed signals (and float signals with exact ties) could give different outputs depending on the platform's unstable-sort tie-breaking behaviour.
  • Normalized perm_entropy output is clipped to [0, 1] to prevent returning -0.0 for perfectly regular signals.

Docs

  • Fixed doctest failures in spectral_entropy, num_zerocross, and hjorth_params caused by NumPy's new scalar repr (np.float64(x) / np.int64(x) instead of bare literals).
  • Added a Big O complexity column to the performance tables, with footnotes for perm_entropy, svd_entropy, higuchi_fd, spectral_entropy, and app_entropy / sample_entropy.
  • Performance tables now show timings at both 1 000 and 10 000 samples.
  • Added perm_entropy docstring warning about tie-breaking and the jitter strategy.
  • Added benchmarks/benchmark_all.py script to reproduce all table timings.
  • Rewrote docs/index.rst to match README.rst in content and style.

Maintenance

  • Clean up docs/conf.py (remove redundant sys.path manipulation) and tighten pyproject.toml (remove stale extras, fix editable-install metadata).

What's Changed

Full Changelog: v0.2.1...v0.2.2