Thanks for your interest in helping. entroscope aims to be the definitive entropy toolkit for time series, so contributions that add measures, sharpen the math, improve docs, or fix bugs are all welcome.
git clone https://github.com/Par-python/entroscope.git
cd entroscope
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]" # installs the package + pytest, pytest-cov, ruffThe same three checks run in CI; please run them locally before opening a PR.
# tests, with the 90% coverage gate CI enforces
pytest --cov=entroscope --cov-fail-under=90
# lint and formatting (ruff)
ruff check entroscope tests examples
ruff format --check entroscope tests examplesruff format entroscope tests examples (without --check) applies the
formatting for you.
A small shared core does the heavy lifting; each measure is a thin module on top.
entroscope/_core.py: input coercion (Series/ndarray), therollinganddeltadrivers, and the plotting scaffold. The "Series in, Series out (index preserved); ndarray in, ndarray out" contract lives here, once.entroscope/utils/:windows.py(sliding windows),normalize.py(scale to [0, 1]),plot.py(the cross-measurecompare/dashboard/drop_eventshelpers).entroscope/<measure>.py: each measure (shannon, permutation, spectral, sample, approximate, differential, multiscale) defines a private_kernel(values, **params) -> floatand thin public functions that delegate to the core drivers.tests/: one file per measure, plustest_consistency.py(verifies every measure honors the shared API) andtest_examples.py(runs the example scripts end-to-end).
Follow the existing modules as a template (shannon is the simplest):
- Create
entroscope/<name>.pywith a_kernel(values, **params) -> floatthat computes the single-value entropy, thencompute,rolling,delta, andplotthat delegate toentroscope._core. Addnormalizedonly if the measure has a well-defined theoretical maximum. - Export it from
entroscope/__init__.py. - Add
tests/test_<name>.pywith at least: a known-answer case, a higher-vs-lower-entropy ordering check, type/shape checks forrolling, and a validation-error case. - If it fits the cross-measure API, add it to the registry in
entroscope/utils/plot.pyand totests/test_consistency.py. - Keep coverage at or above 90%.
- Branch off
master, keep PRs focused on one change. - Write a clear description of what changed and why; reference an issue if there is one.
- Make sure tests, coverage, and ruff all pass.
- Add a line to
CHANGELOG.mdunder an## Unreleasedheading. - Match the style of the surrounding code (ruff handles formatting).
Open an issue at https://github.com/Par-python/entroscope/issues. For bugs, a minimal reproducible example (the input series, the call, what you expected, what you got) makes it much faster to fix.
By contributing, you agree that your contributions are licensed under the MIT License, the same as the rest of the project.