Repository navigation
Pin public I/O behavior before record refactor - #750
Conversation
There was a problem hiding this comment.
Two assertions need strengthening for this to serve as a compatibility baseline:
-
MultiRecord pickle coverage (
tests/test_io_compatibility.py:121-134):sampto=8loads only the first of the three 75,000-frame segments. The assertions also omit top-level fields such asfs,n_sig, andsig_len, so losing those fields during serialization would pass. A two-frame window across the first boundary (sampfrom=74999, sampto=75001) exercises two loaded segments without a large read; please compare the top-level fields after unpickling too. -
rdsampmetadata values (tests/test_io_compatibility.py:65-77): The test checks the field names but does not pin the values offs,units, orcomments. Those could regress while this test still passes. Please assert the known values fromsample-data/100, giving the test an independent expected result.
These are gaps in the new tests, not observed production failures.
|
Thanks for the careful review. Addressed both gaps in 04a24e5.
Verification: all 8 compatibility tests pass; Ruff check and format pass. |
Summary
Add focused, offline characterization tests for the current public I/O behavior before changing the record model. This is the first compatibility baseline for #749; it changes no production API or behavior.
The tests cover:
Recordvalues, selected metadata, and expanded per-channel frame counts.Record/MultiRecordreturn choices and positionalrdrecordarguments.(signals, fields)shape and field keys returned byrdsamp.sig_namefollowed by writing and reading a copy.Record,MultiRecord, andAnnotation.MultiRecordis checked by its restored fields and segments because it does not currently implement value equality.Existing tests already cover many numerical values, formats, and multi-segment ranges; this PR pins the compatibility seams most likely to be affected by #743–#748.
Checks
tests/test_io_compatibility.py: 8 passed.git diff --checkpasses.