Skip to content

docs: rewrite the README and fix the crashing quickstart - #12

Merged
Par-python merged 2 commits into
masterfrom
docs/readme-refresh
Sep 23, 2026
Merged

Par-python merged 2 commits into
masterfrom
docs/readme-refresh

Conversation

@Par-python

Copy link
Copy Markdown
Owner

Rewrites the README in the style of laya and fixes a bug: the first example anyone ran crashed.

Bug fixed

The Quickstart (README and docs/quickstart.md) ran shannon.rolling(s, window=20) on an 8-point series and raised ValueError: window (20) is larger than series length (8). The other three README examples used undefined variables (s, windows, labels) or a matcha_trends.csv that doesn't exist.

New layout

  • Centered banner (light and dark), drawn from entroscope's own rolling spectral entropy by docs/assets/make_banner.py, which is adapted from the original banner design. The badges now include the docs site.
  • Installation with an extras table.
  • Quickstart on a noise → cycle series, with real outputs as # -> comments. It ends on the case for nine measures: Shannon entropy can't tell noise from the cycle (3.08 vs 3.23 bits), while spectral entropy can (6.05 vs 0.88).
  • Why trust the numbers: the antropy / EntropyHub / scipy validation table.
  • Sections on rolling entropy over time (including missing values), transfer entropy and divergence, and scikit-learn / polars.
  • The nine measures: what each one captures and when to reach for it.
  • Honest limits: where entropy lost to a simple rule (the training-divergence study), measured rolling speed (sample entropy ~3 s per 3,000 points), sample entropy's finite ceiling, the spectral definition difference, and transfer entropy's data needs.

Guarding it

tests/test_readme.py runs every Python block in README.md and docs/quickstart.md in order, and checks each numeric # -> value claim (14 in total) against what the line returns.

Notes

  • The banner images use absolute raw.githubusercontent.com/.../master/... URLs so they also render on PyPI. They'll show as broken in this PR's preview until it merges.
  • PyPI only shows the new README after the next release.

Test plan

  • pytest: 250 passed, coverage 98.7% (includes the 2 new README tests)
  • mkdocs build --strict
  • Banner checked in both themes
  • ruff check / ruff format --check with local ruff 0.15.15. CI runs the pinned 0.16.7 (pypi.org was unreachable from my machine).
  • CI green

🤖 Generated with Claude Code

Par-python and others added 2 commits September 22, 2026 18:56
Laya-style layout: centered banner (light and dark, drawn with entroscope's
own rolling spectral entropy), badges including the docs site, installation
with extras, a quickstart whose comments show real outputs, a validation
table, sections on rolling entropy, two-signal measures and ML/polars, a
guide to choosing a measure, and an "Honest limits" section.

The quickstart in the README and on the docs site called rolling with
window=20 on an 8-point series and raised ValueError; the other README
examples used undefined variables or a missing CSV. Every example now runs,
and tests/test_readme.py executes them in CI and checks the 14 numbers they
print.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Use re.DOTALL instead of the re.S alias (FURB167), and mark the deliberate
exec of the docs' example code with a scoped noqa (S102).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Par-python
Par-python merged commit 2be6f62 into master Sep 23, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant