Repository navigation
Require explicit layout on read_record - #858
Conversation
d69a095 to
44277c5
Compare
tompollard
left a comment
There was a problem hiding this comment.
This matches what we agreed in #852: read_record and read_signals now both require layout, and rdrecord keeps its default. The changelog entry needs a format fix; otherwise it's ready to merge.
What I checked
read_record("sample-data/100")now raisesTypeError: read_record() missing 1 required keyword-only argument: 'layout', andrdrecordis unchanged.- I parsed every
read_record(call inREADME.md,docs/*.rstand thesrcdocstrings, including multi-line calls. All of them now passlayout, apart from prose that usesread_record(..., channels=[...]). The library doesn't callread_recordinternally withoutlayout. - 44277c5 fixes the README example that Ruff reformats; the style job failed on d69a095 and passes now.
- It merges cleanly with #859.
- The offline suite (1,716 passed, 4 skipped), Ruff, the strict docs build and CI pass.
Changelog format
changelog.d/require-read-record-layout.rst uses a Changed heading with a bullet, but changelog.d/README.rst asks for a bold heading and an indented paragraph. I simulated the release: I merged this PR, #859 and #860 onto main, ran towncrier build --version 9.9.9, and built the docs with -W. Each of the three entries puts an indented Changed / ------- (or Fixed / -----) pair into docs/changes.rst, and the strict build fails with ERROR: Unexpected section title or transition. at each one. For example:
**Require a layout in read_record**
``read_record`` now requires ``layout="uniform"`` or ``layout="expanded"``,
matching ``read_signals``; uniform layout averages samples within a frame.
This changes behavior available since 5.14.0; ``rdrecord`` keeps its default.
Summary
Require
layout="uniform"orlayout="expanded"onread_record, matchingread_signals. Uniform layout averages multiple samples within a frame, so the choice should be explicit before the modern API settles.rdrecordkeeps its existing default.This updates the tests and documentation examples that relied on the previous default, and adds a migration note and changelog entry. It changes the behavior available since 5.14.0: calling
read_record(path)now raisesTypeErroruntil a layout is supplied.Verification
Related: #852.