Releases: raphaelvallat/antropy
Releases · raphaelvallat/antropy
Antropy v0.2.2
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
Antropy v0.2.1
See full changelog at https://raphaelvallat.com/antropy/changelog.html
What's Changed
- DOC: Fix and improve docstrings across entropy, fractal, and utils modules by @raphaelvallat in #44
- CI: deploy documentation to GitHub Pages via GitHub Actions by @raphaelvallat in #45
- Code quality and API improvements by @raphaelvallat in #46
- FIX: correct off-by-one in Higuchi FD inner loop by @raphaelvallat in #47
- Release 0.2.1 by @raphaelvallat in #48
Full Changelog: v0.2.0...v0.2.1
AntroPy v0.2.0
v0.2.0 (March 2026)
Build & CI
- Drop Python 3.9 (EOL), add Python 3.13 support. Minimum is now Python 3.10.
- Switch from pip to uv in all GitHub Actions workflows.
- Add explicit minimum versions for core dependencies: numpy>=1.22.4, scipy>=1.8.0, scikit-learn>=1.2.0.
- Migrate [project.optional-dependencies] to PEP 735 [dependency-groups].
- Bump setuptools>=80.0.
- Split CI into three jobs: test-core (3 platforms × 4 Python versions), test-dependency-combinations (4 dep combos from minimum to latest), and coverage.
- Fix test-dependency-combinations job: separate antropy install (--no-deps) from test-dependency install so that pytest’s own dependencies (e.g. pluggy) are always resolved.
- Fix Codecov upload to use ${{ secrets.CODECOV_TOKEN }} instead of a hardcoded token.
- Switch Ruff workflow from astral-sh/ruff-action@v1 to uvx ruff via astral-sh/setup-uv@v7.
- Extend Ruff rules: add W (pycodestyle warnings) and NPY (NumPy rules).
Tests
- Increase test coverage from ~54 % to 100 %.
- Add tests/test_utils.py covering all branches of the _embed helper (1-D and 2-D paths, all error conditions).
- Add edge-case tests: sample_entropy returning inf (m-length matches exist but no (m+1)-length matches); detrended_fluctuation returning NaN for a constant signal; spectral_entropy raising on an invalid method string.
- Set NUMBA_DISABLE_JIT=1 in the coverage CI job so coverage.py can instrument Numba JIT function bodies; other CI jobs still exercise real compiled code.
Bug fixes
- Fix antropy.higuchi_fd() returning a ValueError (math domain error) on constant or integer-typed input arrays: log(0) is now guarded to return -inf, matching Numba’s IEEE 754 behaviour.
Docs
- Switch documentation theme from sphinx_bootstrap_theme to pydata-sphinx-theme (dark/light toggle, GitHub icon, improved layout).
- Fix three broken intersphinx URLs: NumPy, SciPy, and MNE-Python.
- Add sphinx.ext.mathjax for LaTeX math rendering in docstrings.
- Add contributing.rst guide.
- Fix stale :py:func: cross-references in changelog entries v0.1.1–v0.1.3 (entropy.XXX → antropy.XXX).
- Fix typo in v0.1.6 changelog (“Fox for KDTree” → “Fix for KDTree”).
- Modernize README.rst and docs/index.rst: add PyPI, conda-forge, downloads, and Ruff badges; add uv installation instructions; fix broken links.
v0.1.9
v0.1.8
What's Changed
- Modern python packaging + v0.1.8 by @raphaelvallat in #38
Full Changelog: v0.1.7...v0.1.8
v0.1.7
What's Changed
- update SampEn and AppEn to allow for variable tolerance values by @JAC28 in #32
- Update Katz_FD by @PiethonProgram in #36
- Release v0.1.7 by @raphaelvallat in #37
New Contributors
- @JAC28 made their first contribution in #32
- @PiethonProgram made their first contribution in #36
Full Changelog: v0.1.6...v0.1.7
v0.1.6
This release requires numba >= 0.57.
What's Changed
- Allow readonly arrays in numba jit signature by @jvdd in #23
- Improved sample entropy kernel by @FirefoxMetzger in #25
- fix:
KDTree.valid_metricsis method since sklearn 1.3 by @jvdd in #30 - Replaced Python 3.7 with 3.10 in Github Actions
- Fix pandas deprecation in notebooks
New Contributors
- @FirefoxMetzger made their first contribution in #25
Full Changelog: v0.1.5...v0.1.6
v0.1.5
This is a minor release.
What's Changed
- Handle the limit of p = 0 in p log2 p by @jftsang in #3
- Correlation between entropy/FD metrics for data traces from Hodgin-Huxley model by @antelk in #5
- Fix docstrings and rerun by @antelk in #7
- Improve performance in
_xlog2xby @jftsang in #8 - Prevent invalid operations in xlogx by @guiweber in #11
- Allow readonly arrays for higuchi_fd by @jvdd in #13
- modify the _embed function to fit the 2d input by @cheliu-computation in #15
- Fixed division by zero in linear regresion function (with test) by @Arritmic in #21
- Add conda install instructions by @raphaelvallat in #19
New Contributors
- @jftsang made their first contribution in #3
- @antelk made their first contribution in #5
- @guiweber made their first contribution in #11
- @jvdd made their first contribution in #13
- @cheliu-computation made their first contribution in #15
- @Arritmic made their first contribution in #21
- @raphaelvallat made their first contribution in #19
Full Changelog: v0.1.4...v0.1.5