Skip to content

DOC: Fix and improve docstrings across entropy, fractal, and utils modules#44

Merged
raphaelvallat merged 3 commits intomasterfrom
improve_doc
Mar 6, 2026
Merged

DOC: Fix and improve docstrings across entropy, fractal, and utils modules#44
raphaelvallat merged 3 commits intomasterfrom
improve_doc

Conversation

@raphaelvallat
Copy link
Copy Markdown
Owner

This PR corrects several inaccuracies in docstrings and improves documentation clarity throughout the codebase.

Bug fixes in formulas and descriptions

  • perm_entropy: Fix formula — log2(π) → log2 p(π) (argument to log must be the probability, not the permutation label)
  • svd_entropy: Fix normalization factor — log2(order!) → log2(order) (copy-paste from perm_entropy); fix "permutation entropy" → "SVD entropy" in same line
  • spectral_entropy: Fix normalize description — psd.size → number of frequency bins (these differ for N-D arrays); clarify nperseg=None behaviour
  • detrended_fluctuation: Fix broken RST — stray double-backtick after :math: directives in Returns; fix "exponant" typo; replace internal entropy.utils._log_n(...) reference with a plain-English description;
    improve grammar in Returns

Typos and wording

  • lziv_complexity: Remove misleading "(binary)" from title; fix "begining" → "beginning"; "character" → "characters"
  • sample_entropy: "inferior to" → "less than"
  • hjorth_params: "EntroPy" → "AntroPy"
  • num_zerocross, hjorth_params: Fix .. versionadded: → .. versionadded:: (single colon broke the RST directive)

New content

  • higuchi_fd: Add mathematical derivation of L_m(k) and L(k) to Notes, matching the actual implementation (sum runs to N_m − 1, consistent with the upstream MNE-features source); add Esteller et al. (2001) and
    Paivinen et al. (2005) references cited by MNE-features

utils cleanup

  • Fix _xlog2x → _xlogx in all (function was never named _xlog2x)
  • Standardise _log_n docstring to NumPy style; fix return type (np.ndarray of int64, not "list of integers"); correct "< max_n" → "<= max_n"

@raphaelvallat raphaelvallat merged commit 372dd11 into master Mar 6, 2026
17 checks passed
@raphaelvallat raphaelvallat deleted the improve_doc branch March 6, 2026 14:58
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ab8c158) to head (440b207).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #44   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          302       302           
  Branches        45        45           
=========================================
  Hits           302       302           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants