Summary — v0.2.2 (April 2026)
Permutation entropy
Support for 2D arrays
perm_entropynow accepts 2-D arrays of shape(n_channels, n_times)fororder∈ {3, 4}, computing entropy for every row in a single vectorised call.
Speed-up:
perm_entropyfast path (only for order 3 or 4): ordinal patterns are now encoded via pairwise comparison bit-keys and counted withnp.bincountrather thanargsort+np.unique, giving a major speed-upperm_entropygeneral path (order > 4): the embedded matrix is now built as a zero-copyas_stridedview and the hash is computed via a single@product instead of an element-wise multiply + sum (faster).
Bugfixes
perm_entropynow 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_entropyoutput is clipped to[0, 1]to prevent returning-0.0for perfectly regular signals.
Docs
- Fixed doctest failures in
spectral_entropy,num_zerocross, andhjorth_paramscaused by NumPy's new scalarrepr(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, andapp_entropy/sample_entropy. - Performance tables now show timings at both 1 000 and 10 000 samples.
- Added
perm_entropydocstring warning about tie-breaking and the jitter strategy. - Added
benchmarks/benchmark_all.pyscript to reproduce all table timings. - Rewrote
docs/index.rstto matchREADME.rstin content and style.
Maintenance
- Clean up
docs/conf.py(remove redundantsys.pathmanipulation) and tightenpyproject.toml(remove stale extras, fix editable-install metadata).
What's Changed
- DOC: Better README by @raphaelvallat in #49
- MAINT: Fix imports and clean up project configuration by @raphaelvallat in #50
- [v0.2.2] perm_entropy improvements; better doc/doctest by @raphaelvallat in #51
Full Changelog: v0.2.1...v0.2.2