-
Docs: README rewritten with a banner, runnable examples that show their real outputs, a "Why trust the numbers" validation table, a guide to choosing a measure, and an "Honest limits" section. The quickstart examples in the README and on the docs site crashed (
window=20on an 8-point series); they now run, andtests/test_readme.pyexecutes every example and checks the numbers it claims. -
CI: removed the tag-triggered PyPI publish workflow (
publish.yml). Releases are uploaded to PyPI manually; see "Releasing" inCONTRIBUTING.md.
- Fixed (changes results): missing and infinite values no longer produce
plausible-looking numbers. Previously one NaN made
permutation.computereturn a finite value,spectral.computereturn-0.0,sample.computereturn a large finite value, andshannon.computeraise. Now every measure (compute,normalized,multiscale,transfer,divergence.kl/js) returns NaN when its input holds NaN or ±inf, androlling/deltaare NaN for exactly the windows that contain one. Reported while building the training early-warning study. - Fixed: zero entropy is returned as
0.0, never-0.0(constant or perfectly ordered input, a single region inshannon.geographic). - CI: move the remaining GitHub Actions off the deprecated Node 20 runtime
(
upload-artifactanddownload-artifactto v7,upload-pages-artifactanddeploy-pagesto v5).
- Validated against independent implementations. Sample, approximate,
permutation, spectral and multiscale entropy now match antropy and/or
EntropyHub exactly (relative error < 1e-10) on four signal types; Shannon and
normal differential entropy match scipy. See
docs/validation.md. The checks live intests/test_reference.pyand run in a dedicated CI job. - Fixed (changes results): sample entropy counts length-
mmatches over the sameN - mtemplates as length-m+1matches (Richman & Moorman 2000). Values shift by roughly 0.001 to 0.003. - Fixed (changes results): multiscale entropy fixes the tolerance from the
original series instead of recomputing it per scale (Costa et al. 2002). The
old behaviour made white noise look more complex at coarser scales.
multiscale.computegainsmandrarguments. - Faster transfer entropy: KSG neighbour counting is vectorized with a single k-d tree query, about 250x faster on 20,000 points (identical results).
- polars support: every measure accepts a polars Series; rolling and delta return a polars Series with the input's name.
- scikit-learn integration:
entroscope.features.EntropyFeatures, a pipeline-ready transformer that turns time-series windows into entropy features. - New optional extras:
sklearn,polars,reference,docs. - Docs site (MkDocs Material) with validation and integrations pages.
- README: corrected the quick-start value (
shannon.computereturns 1.75, not 0.73), listed all nine measures, and fixed the PyPI Homepage and docs links. - CI: ruff pinned so new ruff releases can't break the build;
checkoutandsetup-pythonbumped off the deprecated Node 20 runtime.
- Transfer entropy (
entroscope.transfer) — the first bivariate measure: directional information flowTE(X→Y)(Schreiber 2000) with two estimators, Kraskov KSG k-NN (default, no binning) and a binned histogram cross-check. API:compute,rolling,delta,plot. A sample-size guard warns when the data is too thin for the embedding dimension. Correctness is validated against three independent authorities: the bivariate-Gaussian closed form, the Kraskov-2004 analytic mutual information, and a hand-checked isolated embedding. - Divergence (
entroscope.divergence) — distribution-vs-distribution measures:kl(Kullback-Leibler, directional) andjs(Jensen-Shannon, symmetric, bounded[0, 1]bits), plusplot. Inputs are two raw samples, binned over a shared range; KL uses epsilon smoothing to stay finite on empty bins. Useful for data-drift detection (training vs production distributions). - Fixed: importing a measure no longer forces matplotlib's
Aggbackend (issue #2). The library no longer mutates global matplotlib state on import, so interactive plotting (e.g.df.plot()in a notebook) keeps working. Headless, Docker, and CI users who want a guaranteed non-interactive backend should setMPLBACKEND=Aggin their environment. - Correlation-stability example (
examples/correlation_stability.py) — entropy of a rolling correlation series as a regime-stability gauge, shipped alongside a rolling-std baseline so the comparison stays honest. - New worked examples:
examples/information_flow.py(directional transfer entropy) andexamples/drift.py(KL/JS distribution drift).
- Added a
LICENSEfile (MIT) and aCONTRIBUTING.mdguide. - Rewrote the README: clearer intro, working PyPI/CI/Python/license badges, and links to the example write-ups.
- Added PyPI trove classifiers (supported Python versions, license, topics) so the Python-versions badge and PyPI sidebar populate correctly.
- Runnable example scripts in
examples/: four medical/biomedical scenarios (HRV/sample, EEG/permutation+spectral, respiration/approximate, glucose/differential) and four business scenarios (sales/shannon, web-traffic/spectral, prices/permutation, QC/multiscale), plus matchingdocs/examples/medical.mdanddocs/examples/business.mdpages. - Smoke tests (
tests/test_examples.py) run the example scripts in CI so they can't silently break; CI lint now coversexamples/too. - CI/CD via GitHub Actions: lint (ruff check + format), test matrix across
Python 3.9 to 3.14 with a 90% coverage gate, and a build +
twine checkjob. - Tag-triggered PyPI publish workflow using trusted publishing (inert until a PyPI publisher is configured).
- Applied
ruff formatacross the codebase; addedruffto thedevextra.
Initial release.
- Seven entropy measures: shannon, permutation, sample, approximate, spectral, differential, multiscale.
- Consistent API across measures:
compute,rolling,delta,plot, plusnormalized(shannon/permutation/spectral) andgeographic(shannon). - Works on
pd.Series(index preserved) andnp.ndarray. - Visualization helpers:
plot.compare,plot.dashboard,plot.drop_events.