Skip to content

test+docs(morlet): zero-mean validation, citation cleanup, regenerate docs/html#262

Merged
Riley16 merged 4 commits into
masterfrom
morlet-validation
May 31, 2026
Merged

test+docs(morlet): zero-mean validation, citation cleanup, regenerate docs/html#262
Riley16 merged 4 commits into
masterfrom
morlet-validation

Conversation

@Riley16
Copy link
Copy Markdown
Contributor

@Riley16 Riley16 commented May 30, 2026

Summary

Follow-up to the 3.0.6 docs cleanup. Four commits, in order:

  1. test(morlet): assert complete=True zero-mean / DC-rejection
    the whole point of complete=True (zero-mean correction → DC
    rejection) was documented but not directly tested. Adds two
    complementary tests: the Python reference wavelet integrates to ~0
    (parameterized over widths) and PTSA's filter on a constant DC input
    has ~0 power on the interior; complete=False leaks measurably
    more, proving the correction does the work.
  2. docs(morlet): drop citations not in original PTSA; explain unit-energy — the Tallon-Baudry & Bertrand citation introduced
    during the docs overhaul wasn't in the pre-3.0.6 PTSA source, so
    remove all TB mentions from morlet.py, _python_reference.py,
    morlet.cpp, and morlet.rst. Software refs (MNE, scipy,
    Heisenberg/Gabor) are left intact. Also add inline comments to both
    the Python reference and the C++ kernel explaining the unit-energy
    derivation behind the inv_sq_a_c / inv_sq_a_s closed-form
    expressions (the three additive terms in inv_sq_a_c come from
    expanding (cos − offset)² and integrating each piece against the
    Gaussian; inv_sq_a_s is the single closed form for sin² · Gaussian on the offset-free imaginary arm).
  3. docs(html): regenerate GitHub Pages output — rebuild
    docs/html/ against the cleaned source via
    maint/build_docs.py (ptsa_dev env + pandoc, with
    PTSA_DOCS_BUILD_NOTEBOOKS=1) so the live site reflects the
    citation removal. Notebook examples (getting_started, eeg)
    rendered via nbsphinx.
  4. docs(README): 'Building the documentation' section — record
    the doc-build steps in the README so future developers don't have
    to rediscover them.

Validation

  • Full local test suite: 175 passed / 33 skipped / 0 failed under
    NO_RHINO=1 pytest tests/ docs/ (33 skips are the rhino-data tests,
    expected off-rhino; +4 vs prior count comes from the new
    DC-rejection cases).
  • 42/42 morlet-specific tests pass (test_morlet_formula.py +
    test_morlet_correctness.py).
  • Docs rebuild succeeded with the cleaned source; no TB references
    remain in docs/html/.

Notes

🤖 Generated with Claude Code

Riley16 and others added 4 commits May 30, 2026 19:43
The zero-mean correction (the whole point of complete=True) was
documented and implemented but not directly tested. Adds:

* test_complete_wavelet_real_arm_integrates_to_zero (3 widths) —
  python_morlet_wavelet(complete=True).real integrates to ~0 (bounded
  by the finite-support truncation floor, ~1e-5 of peak); complete=
  False at width=4 has a clearly larger DC component, proving the
  correction does the work rather than being a no-op.
* test_ptsa_morlet_power_rejects_DC_when_complete — feeding PTSA's
  filter a constant DC signal yields ~0 power on the interior with
  complete=True; complete=False leaves measurable DC leakage (>1000x
  larger).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The Tallon-Baudry & Bertrand citation introduced during the docs
overhaul wasn't present in the pre-3.0.6 PTSA source. Remove all TB
mentions from morlet.py, _python_reference.py, morlet.cpp, and
morlet.rst (References sections + the inline phrasing). Software
references (MNE, scipy, Heisenberg/Gabor) are left intact.

Also add inline comments to both the Python reference implementation
and the C++ kernel explaining the unit-energy derivation behind the
inv_sq_a_c / inv_sq_a_s closed-form expressions: the three additive
terms in inv_sq_a_c come from expanding (cos - offset)^2 = cos^2 -
2*offset*cos + offset^2 and integrating each against the Gaussian;
inv_sq_a_s is the single closed form for sin^2 * Gaussian on the
(offset-free) imaginary arm. The (1/freq_scale) prefactor falls out
of the time-rescale change of variables.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Rebuild docs/html via 'PATH=ptsa_dev/bin:$PATH PYTHONPATH=$PWD
PTSA_DOCS_BUILD_NOTEBOOKS=1 python maint/build_docs.py' so the
published site reflects the source cleanup in the preceding commit
(no more Tallon-Baudry citations). Notebook examples (getting_started,
eeg) rendered via nbsphinx + pandoc.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Document the doc-build steps for developers: install sphinx +
sphinx_rtd_theme + nbsphinx + pandoc, then
'PYTHONPATH=$PWD PTSA_DOCS_BUILD_NOTEBOOKS=1 python maint/build_docs.py'.
Explains why each env var matters (autodoc's ptsa import; the
pandoc-gated notebook rendering).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@Riley16 Riley16 merged commit 2d5490a into master May 31, 2026
13 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