Skip to content

parseSEG 0.10.1: the SEG-D writer counts samples as the reader does - #4

Merged
xrfez merged 2 commits into
mainfrom
phase12-followups
Nov 13, 2026
Merged

xrfez merged 2 commits into
mainfrom
phase12-followups

Conversation

@xrfez

@xrfez xrfez commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Follow-ups to 0.10.0. No API change.

  • SEG-D writer (segd/writer.nim): the sample count a trace's headers declare now follows the reader's rule. A Rev 2 trace whose Trace Header Extension parseSEG 0.8.0: keysAt, failed-row reads, chunk window origin, SEG-Y from TraceKeys #1 gives 0 samples is sized by its channel set's window, as the reader sizes it. The writer used to take the 0 and refuse the trace, so a file the reader reads could not be written back. A negative window counts as no count. Rev 3 already followed the reader. New check in tests/tsegdreader.nim (extension_sample_count_of_zero): such a file writes back strictly with the same samples.
  • GH#1 times: model/keys.nim and convert/tosegd.nim call generalHeaderUtc(g1), which reads the year the same way (1950-2049).
  • Docs and tests: docs/design/vendor_maps.md no longer says NIF goes through the toolchain's NIF library (maps have their own tokenizer, the scaffold uses common/niftext). tests/tdocs.nim stops adding the toolchain's dist/nimony path.

Local: nim test, testRelease, testV3, asan and docs pass (58 test files).

🤖 Generated with Claude Code

xrfez and others added 2 commits November 13, 2026 04:31
- segd/writer: `declaredSamples` follows the reader's rule. A Rev 2
  trace whose Trace Header Extension #1 gives 0 samples is sized by its
  channel set's window, as the reader sizes it (with a warning); the
  writer took the 0 and refused such a trace, so a file the reader
  reads could not be written back. A negative window is no count (the
  reader stops there), not a negative one. Rev 3 was already the
  reader's rule. Test: tsegdreader extension_sample_count_of_zero
  writes the file it reads back strictly and gets the same samples
  (refused before the fix).
- keys, convert/tosegd: GH#1 times through `generalHeaderUtc(g1)` (the
  same 1950-2049 reading, NaN for a year outside 0-99), without the
  century worked out at each call; `common/years` is no longer
  imported there.
- docs/design/vendor_maps.md: the implementation notes said NIF went
  through the toolchain's nifbuilder/nifreader on a --path in
  config.nims. Maps are read by vendor/maps' own tokenizer and the
  scaffold is written with common/niftext; nothing comes from the
  toolchain.
- tests/tdocs: the examples are compiled without the toolchain's
  dist/nimony path, which src/ no longer uses.

nim test, testRelease, testV3, asan and docs pass (58 test files).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xrfez
xrfez merged commit cb3359c into main Nov 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant