Repository navigation
Conversation
M2 of the record-layer plan. EKDIST carried a second implementation of the SCN binary decoding, and two copies of a format parser is two places for a record to be read differently. It was: the interval array is stored as 4-byte floats, and under NEP 50 the millisecond-to-second multiply stayed in single precision here, discarding most of the digits the file carries. read_data now delegates to dcio.formats.scn.read. Verified identical on both shipped records before the change -- intervals equal bit for bit, raw amplitudes and flags equal, and the same trailing-gap trim. The contract is unchanged: amplitudes come back as raw stored integers, not pA, because that is what this has always returned and what load_SCN_file scales by calfac2. dcio applies the calibration on read, so it is divided back out. The round trip is exercised on 181003S8.SCN, whose calfac2 is 0.0025 rather than 1, with a test asserting that it stays non-unit so the check cannot become vacuous. read_header stays EKDIST's own. It parses about 130 header fields -- the full SCAN header including display and fitting parameters -- where dcio names 18. Shimming it would lose information dcio does not currently model, so the duplication removed here is the data decoding, which is where the numerical disagreement lived. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
M2 of the record-layer plan. EKDIST carried a second implementation of the SCN
binary decoding, and two copies of a format parser is two places for a record
to be read differently. It was: the interval array is stored as 4-byte floats,
and under NEP 50 the millisecond-to-second multiply stayed in single precision
here, discarding most of the digits the file carries.
read_datanow delegates todcio.formats.scn.read. Verified identicalbefore the change on both shipped records — intervals equal bit for bit
(max difference 0), raw amplitudes and flags equal, and the same trailing-gap
trim.
The contract is unchanged: amplitudes come back as raw stored integers, not pA,
because that is what this has always returned and what
load_SCN_filescalesby
calfac2. dcio applies the calibration on read, so it is divided back out.That round trip is exercised on
181003S8.SCN, whosecalfac2is 0.0025rather than 1 — with a test asserting it stays non-unit, so the check cannot
quietly become vacuous.
Scope:
read_headerstays EKDIST'sIt parses about 130 header fields — the full SCAN header including display
and fitting parameters — where dcio names 18. Shimming it would lose
information dcio does not currently model. The duplication removed here is the
data decoding, which is where the numerical disagreement actually lived.
Bringing the header across would mean extending dcio's parser first. Worth
doing, but it is its own piece of work, not a shim.
48 passing.
🤖 Generated with Claude Code