Repository navigation
[doc-sync] docs(pyOpenMS): document zero-copy API naming conventions (_view, _struct, deprecated _mv) - #8890
Merged
timosachsenberg merged 1 commit intoMar 12, 2026
Conversation
…ruct, deprecated _mv) The zero-copy API naming convention was standardized in #8857 (Fix ChromatogramPeak IntensityType consistency and unify zero-copy API conventions). Enforcement tests were added in test_zerocopy_conventions.py, but the naming convention itself was not documented in the developer README. Add a 'Zero-copy API Naming Conventions' subsection to README.md explaining: - _view suffix: typed 1-D ndarray column views - _struct suffix: structured ndarray record views - _mv suffix: deprecated (aliases live in deprecated_mv_aliases.py) - Empty-container return behavior for each suffix Co-authored-by: Copilot <[email protected]>
timosachsenberg
approved these changes
Mar 12, 2026
timosachsenberg
marked this pull request as ready for review
March 12, 2026 08:52
timosachsenberg
deleted the
doc-sync/zero-copy-api-conventions-2026-03-12-95b2c357efd808cd
branch
March 12, 2026 08:52
This was referenced Mar 13, 2026
Merged
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
This PR documents the zero-copy API naming conventions that were standardized in #8857 but were not captured in the developer README.
Source files that triggered this doc review
src/pyOpenMS/bindings/bind_chromatogram.cpp— addedget_peaks_structwith structured dtypesrc/pyOpenMS/bindings/bind_spectrum.cpp— movedget_peaks_structfrom addon to C++ bindingsrc/pyOpenMS/bindings/bind_analysis.cpp— added empty guards to OpenSwath_mvmethodssrc/pyOpenMS/pyopenms/addons/deprecated_mv_aliases.py— added/renamed deprecated aliasessrc/pyOpenMS/tests/unittests/test_zerocopy_conventions.py— new test file enforcing naming conventionsDocumentation file updated
src/pyOpenMS/README.mdAdded a new subsection "Zero-copy API Naming Conventions" under "Development Patterns → Adding Pythonic Methods".
What changed and why
The
_view/_structnaming convention was formalized and enforced with tests in #8857, but the developer README only mentionedget_data_view()in passing with a note thatget_data_mv()is a deprecated alias. Nothing explained:_viewvs_struct_mvis deprecated and where the aliases live_as_viewshould not be used for new methodsThe new subsection fills this gap with a lookup table and explicit rules, making it easy for contributors to follow the convention when adding new zero-copy bindings.