Skip to content

Clarify multi-segment read coordinates and provenance - #833

Merged
tompollard merged 2 commits into
mainfrom
docs/segment-contract-746
Dec 1, 2026
Merged

tompollard merged 2 commits into
mainfrom
docs/segment-contract-746

Conversation

@tompollard

Copy link
Copy Markdown
Member

Summary

  • Document the distinct coordinate systems of SegmentReference, SegmentView, and SourceSegment, including layout headers, gaps, and data segments whose selected channels were not loaded.
  • Explain how source_selection relates a selected view to its full source header, and which channel metadata read_multi_segment_headers can provide without loading samples.
  • Update the examples to use read_record and add regression tests for fixed and variable layouts.

The existing APIs cover the cases in #746. This PR makes their contract explicit without changing return types or defaults.

Closes #746.

Verification

  • Focused offline tests: 133 passed, 1 network test deselected.
  • Strict Sphinx build, Ruff lint and formatting: passed.

@tompollard tompollard left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The table makes the three descriptors much easier to tell apart, and it settles the earlier question of whether they should converge: each describes a different coordinate system. The updated example runs as written with -W error::DeprecationWarning, combined source_segments omit the layout entry as stated, and segment_views on an rdheader result covers the full source (layout 0–0, gap 0–25740). Each decision listed in #746 now has a documented answer, so closing it makes sense. The offline suite, Ruff and the strict docs build pass locally.

Optional: the paragraph about inspecting channel names without loading samples points to read_multi_segment_headers. read_channel_header(path) is the single call that works for both record forms, so mentioning it there (with read_multi_segment_headers for when the master header is needed too) would point most readers to the simpler function.

Ready to merge once CI is green.

@tompollard

Copy link
Copy Markdown
Member Author

Thanks, that's a better entry point. I updated the multi-segment section in 88ed91a to recommend read_channel_header(path) for channel names and calibration, and read_multi_segment_headers(path) when the master header and segment references are also needed. It still notes that calibration from the channel-defining header may not describe every segment.

The strict docs build and Ruff checks pass.

@tompollard
tompollard merged commit 0f57872 into main Dec 1, 2026
19 checks passed
@tompollard
tompollard deleted the docs/segment-contract-746 branch December 1, 2026 15:37
tompollard added a commit that referenced this pull request Dec 1, 2026
## Summary

- Bump the package version to 5.14.0.
- Collect the changelog entries from #832 and #833 into the release
notes.

This release adds remote `.wfdb` archive reading and clarifies
multi-segment read coordinates and provenance. After merging, publish a
GitHub release tagged `v5.14.0` to trigger the configured PyPI workflow.

## Verification

- Strict Sphinx docs build: passed.
- Source distribution and wheel build: passed.
- Ruff lint and formatting: passed.
- #832 and #833 CI checks: passed before merge.
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.

Clarify the multi-segment record and flattening model

1 participant