Repository navigation
Use signal_alignment on modern readers - #854
Conversation
tompollard
left a comment
There was a problem hiding this comment.
The new wording works and changes nothing about the values. I compared 704 reads on this branch with main (all of sample-data, both layouts, read_record and read_signals). signal_alignment="aligned" matches the old default and "raw" matches ignore_skew=True in every case: same values and same record fields. Invalid values and the removed ignore_skew keyword are rejected. The offline suite (1,717 passed, 4 skipped), Ruff and the strict docs build pass locally. CI hasn't run because the PR targets the #851 branch, so it will run after the retarget.
What I checked
- The user-facing error messages that mentioned
ignore_skew=Truenow describe a raw read, including the tail-sample error. Remainingignore_skewmentions insrcare internal arguments or the legacyrdrecordandwrsampdocstrings, which is correct. - The provisional-API note in
docs/migration.rstcovers the last part of #852. Naming the release where the newer names become stable, for example "until 6.0", would make it more concrete for users. That's optional.
Suggestions
- Record the alignment used for the read. Since #851 requires the choice when writing, a
SignalReadorRecordfrom a raw read still makes the caller restate"raw". Exposing the read's choice on the read result, for examplesource_selection.signal_alignment, would let callers pass it on deliberately. It would also give the docs an example that doesn't depend on remembering how the data was read. This could be a follow-up. - Remaining inconsistency from #852.
read_signalsstill requireslayout, whileread_recorddefaults it to"uniform". This could go in this PR, since it's the same kind of signature cleanup, or in a follow-up. iter_dataframeskeepsignore_skew, along with its other legacy names. See my comment on #853. It needs a decision in #852 rather than a change here.
Merge order
This conflicts with #853 in read_signals and in tests/test_read_record.py. The conflicts are small, but if #853 merges first, the rebase onto main after #851 will need to resolve them.
23e77c9 to
81dd923
Compare
|
I rebased this branch onto the updated #851 branch and resolved the docstring and test conflicts. The affected 122 tests, Ruff, and the warning-strict docs build pass. I would keep the write choice explicit after a read. I agree that the |
tompollard
left a comment
There was a problem hiding this comment.
Thanks. The rebase onto the updated #851 looks right. The new skew error ends with "as from signal_alignment='raw' on a read" after the per-channel list. The offline suite (1,717 passed, 4 skipped), Ruff and the strict docs build pass locally.
I agree with the replies:
- Read alignment. Fair point: a field describing the original read could look like the alignment of arrays that have since been edited in place. Keeping the write choice explicit, and considering read history in the metadata redesign, is the safer order.
layout. Requiring it onread_recordtoo, so smoothing is never implicit, is a good resolution. A separate PR makes sense given how many call sites it touches.- 6.0. Agreed. It's better not to name a version until the data-model and legacy-removal decisions are made.
As planned, this branch still conflicts with #853 in read_signals and tests/test_read_record.py (I checked by merging #851 and #853 onto main first). It will need the rebase once those two are in, and CI will run after it is retargeted to main. Then it is ready to merge.
81dd923 to
8431519
Compare
Summary
Use
signal_alignment="aligned" | "raw"onread_recordandread_signalsin place ofignore_skew. The default remains aligned;"raw"retains the stored skew, equivalent to the oldignore_skew=True. Legacyrdrecordkeeps its existing parameter.This deliberately changes the recently released modern reader signatures so reads and writes use the same words. The migration guide, API docs, and changelog explain the change. The migration guide also notes that newer signatures are still being refined before the next major release.
Tests compare aligned and raw results with the legacy reader, reject invalid values and the removed modern keyword, and update the skew write tests to use the new read option.
Part of #852. Rebases on
mainafter #851 and #853.Verification
bxbunavailable), 23 network tests deselected