Repository navigation
Extract remaining write model helpers - #894
Merged
Merged
Conversation
tompollard
commented
Dec 3, 2026
tompollard
left a comment
Member
Author
There was a problem hiding this comment.
This is correct, and it can merge. After it, _WriteModel borrows nothing from Record in its class body. The focused helper, fixture, parity and warning-location tests pass (417 passed, 44 expected skips), as do the offline suite (2,292 passed, 48 skipped) and Ruff.
What I checked, against main (dbe4195)
- The moved code is unchanged.
_auto_signal_file_namesand_warn_about_replacing_other_filesare line-for-line moves, withself.replaced by explicit arguments. TheRecordmethods are now thin wrappers. get_write_fieldswith a snapshot. This is the one path that changes implementation: with a snapshot it now uses the #875 field-selection functions instead ofget_write_subset, andRecord.set_defaults()goes through it. On 3,000 randomRecords, I compared the exactget_write_fields(snapshot)result (lists, dict and order) and_auto_signal_file_names()withmain. The records had 1 to 19 channels, formats often sorted so groups form, many 508/516/524 channels to exercise the 8-channel and samples-per-frame group splits, and optional fields present or missing. All matched, including 2,010 multi-file groupings and 303 errors.- The public setters. My 4,000-record
set_defaults()/set_default(field)comparison from #889 still matchesmainexactly, with the same digest and the same 812 expected errors. - The overwrite warning. For
write_record,SignalRead.write,write_signalsand the legacyRecord.wrsamp, the warning text and the caller's file and line are identical tomain. - The new tests fail on
main. I copiedtests/test_explicit_write_helpers.pyinto amaincheckout: both fail there and pass here, unlike the ownership tests in #887 and #893.
The remaining dependencies are the inherited header and .dat encoders called from _write_prepared_files, which the description names as the next steps. When those land, the comparison against main will matter even more than here, since both write paths go through that shared code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract the last small helpers borrowed by
_WriteModelfor write-field selection, automatic signal file names, and overwrite warnings. The existingRecordmethods remain wrappers around the shared functions. The model now calls the field-selection and filename functions from its current metadata and has its own warning wrapper.This is another internal step toward #866. Header and
.datencoding still use the inherited mixins; those are the next, larger steps. No public behavior or output change is intended.Checks
git diff --checkpassed.No changelog entry because this only extracts internal helpers.