Repository navigation
Fix_pms - #8063
Fix_pms#8063
Conversation
WalkthroughThe changes primarily reorder the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant IDFilter
participant AnnotatedMSRun
participant IDMapper
participant MSPFile
User->>IDFilter: filterHitsByScore(AnnotatedMSRun, ...)
User->>IDFilter: keepNBestHits(AnnotatedMSRun, ...)
User->>IDFilter: keepHitsMatchingProteins(AnnotatedMSRun, ...)
User->>IDMapper: annotate(AnnotatedMSRun, ...)
User->>MSPFile: store(filename, AnnotatedMSRun)
Suggested labels
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (6)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (4)
src/pyOpenMS/pxds/MSExperiment.pxd (1)
117-119: Changed return types from references to valuesThe range manager accessor methods now return values instead of references. This change:
- Makes the Python bindings more intuitive since Python doesn't have the concept of references
- Avoids potential memory management issues with references in Python bindings
- Provides a cleaner interface for Python users
Consider updating the method documentation to clarify that these methods return copies rather than references, especially since the documentation still says "Returns a reference to..."
src/pyOpenMS/pxds/AnnotatedMSRun.pxd (3)
32-34: Specifier order change is syntactically fine – keep it consistent across pxd files
Bothnogil except +andexcept + nogilare valid in Cython; switching here is harmless.
Just double-check the other modified *.pxd files so all constructors use the same ordering – this prevents unnecessary churn in future diffs.
37-43: Consider returning / acceptingconstreferences to avoid extra copies
getProteinIdentifications()/getPeptideIdentifications()now return the wholestd::vectorby value and the setters take a non-const reference.
For large ID lists this causes a full copy on every getter call and prevents passing r-values to the setter.- libcpp_vector[ProteinIdentification] getProteinIdentifications() except + nogil - void setProteinIdentifications(libcpp_vector[ProteinIdentification]& ids) except + nogil + const libcpp_vector[ProteinIdentification]& getProteinIdentifications() except + nogil + void setProteinIdentifications(const libcpp_vector[ProteinIdentification]& ids) except + nogil - libcpp_vector[PeptideIdentification] getPeptideIdentifications() except + nogil - void setPeptideIdentifications(libcpp_vector[PeptideIdentification]& ids) except + nogil + const libcpp_vector[PeptideIdentification]& getPeptideIdentifications() except + nogil + void setPeptideIdentifications(const libcpp_vector[PeptideIdentification]& ids) except + nogilReturning/accepting
const&avoids the copy while still protecting the data.
If the copy semantics are required for capsule-safety in the Python layer, please add a short comment explaining this choice.
49-49: Potentially costly value return inoperator[]
operator[]now returns astd::pairby value, meaning both the spectrum and peptide ID are copied on every index access.
Depending on typical use-cases this could be acceptable, but if random access is performance-critical consider returning a view/tuple of (const) references instead.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
src/pyOpenMS/README_WRAPPING_NEW_CLASSES(1 hunks)src/pyOpenMS/addons/MzMLFile.pyx(1 hunks)src/pyOpenMS/addons/SequestOutfile.pyx(1 hunks)src/pyOpenMS/pxds/AnnotatedMSRun.pxd(1 hunks)src/pyOpenMS/pxds/ConsensusMap.pxd(1 hunks)src/pyOpenMS/pxds/IDFilter.pxd(2 hunks)src/pyOpenMS/pxds/IDMapper.pxd(4 hunks)src/pyOpenMS/pxds/MSExperiment.pxd(1 hunks)src/pyOpenMS/pxds/MSPFile.pxd(2 hunks)src/pyOpenMS/pxds/RangeManager.pxd(0 hunks)src/pyOpenMS/tests/unittests/test000.py(3 hunks)tools/PythonExtensionChecker.py(5 hunks)
💤 Files with no reviewable changes (1)
- src/pyOpenMS/pxds/RangeManager.pxd
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
- GitHub Check: build-and-test (macos-13, xcode, 14.2)
- GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
- GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
- GitHub Check: build-and-test (macos-14, xcode, 15.0.1)
- GitHub Check: cppcheck-test
🔇 Additional comments (22)
src/pyOpenMS/addons/SequestOutfile.pyx (1)
10-10: Standardized order of exception specifiers in comment.The comment has been updated to use the
except + nogilorder instead of the previous order. This appears to be part of a broader standardization effort across the codebase to maintain consistent ordering of these specifiers.src/pyOpenMS/README_WRAPPING_NEW_CLASSES (1)
35-36: Standardized order of exception specifiers in example code.The example code has been updated to use the
except + nogilorder instead of the previous order. This change maintains consistency with the standardization effort applied throughout the codebase.src/pyOpenMS/pxds/MSPFile.pxd (2)
5-5: Added import for AnnotatedMSRun.Added import statement for
AnnotatedMSRunwhich is now used as a parameter type in thestoremethod.
14-14:Details
✅ Verification successful
Updated parameter type from MSExperiment to AnnotatedMSRun.
The
storemethod now accepts anAnnotatedMSRunreference instead of anMSExperimentreference. This change aligns with a broader pattern in the PR where several method parameters have been updated to use the more specificAnnotatedMSRuntype.
🏁 Script executed:
#!/bin/bash # Check if the C++ implementation of MSPFile has been updated to match this interface change grep -A 5 "void store" $(find . -name "MSPFile.h" | grep -v build) # Check for other instances of similar changes in the codebase grep -r "AnnotatedMSRun" --include="*.pxd" src/pyOpenMS/pxds/Length of output: 2207
store signature correctly updated to AnnotatedMSRun
Verified that in
src/openms/include/OpenMS/FORMAT/MSPFile.hthe C++ method signature has been updated to:void store(const String & filename, const AnnotatedMSRun & exp) const;which matches the
.pxdchange. No further action needed.src/pyOpenMS/addons/MzMLFile.pyx (1)
16-19: Consistent ordering of Cython specifiers.The reordering of
nogil except +toexcept + nogilin these commented function declarations aligns with the PR's objective to fix pyopenms builds. This standardization ensures consistent specifier ordering across the codebase, which can help prevent subtle Cython compilation issues.src/pyOpenMS/tests/unittests/test000.py (1)
42-49: Standardizing Cython exception and GIL specifier orderThe changes here reorder the exception and GIL specifiers in the commented method declarations from
nogil except +toexcept + nogil. This aligns with a broader pattern of standardization across the codebase to ensure consistent ordering of these specifiers.This change is purely in the comments and has no functional impact on the test code, but it's important for consistency with the actual implementation in the .pxd files.
tools/PythonExtensionChecker.py (7)
199-199: Ordering of exception specification changed for consistencyThe order of
except +andnogilspecifiers has been swapped to standardize the syntax across the codebase.
209-209: Ordering of exception specification changed for consistencyThe order of
except +andnogilspecifiers has been swapped to standardize the syntax across the codebase.
489-490: Ordering of exception specification changed for consistencyThe order of
except +andnogilspecifiers has been swapped to standardize the syntax across the codebase for both regular and static methods.
492-492: Ordering of exception specification changed for consistencyThe order of
except +andnogilspecifiers has been swapped to standardize the syntax across the codebase.
501-501: Ordering of exception specification changed for consistencyThe order of
except +andnogilspecifiers has been swapped to standardize the syntax for default constructor declarations.
503-505: Ordering of exception specification changed for consistencyThe order of
except +andnogilspecifiers has been swapped to standardize the syntax for copy constructor declarations.
648-649: Ordering of exception specification changed for consistencyThe order of
except +andnogilspecifiers has been swapped in the string replacement logic that generates Cython function declarations.src/pyOpenMS/pxds/IDFilter.pxd (4)
13-14: Added import for AnnotatedMSRunThe import for
AnnotatedMSRunhas been added to support the type changes in the method signatures below.
179-179: Changed parameter type from MSExperiment to AnnotatedMSRunThe method now uses
AnnotatedMSRuninstead ofMSExperimentas the experiment parameter type, which is more specific for representing experiment data with annotations.
181-181: Changed parameter type from MSExperiment to AnnotatedMSRunThe method now uses
AnnotatedMSRuninstead ofMSExperimentas the experiment parameter type, which is more specific for representing experiment data with annotations.
187-187: Changed parameter type from MSExperiment to AnnotatedMSRunThe method now uses
AnnotatedMSRuninstead ofMSExperimentas the experiment parameter type, which is more specific for representing experiment data with annotations.src/pyOpenMS/pxds/IDMapper.pxd (5)
10-11: Added import for AnnotatedMSRunThe import for
AnnotatedMSRunhas been added to support the type changes in the method signatures below.
24-28: Changed parameter type from MSExperiment to AnnotatedMSRunThe first parameter of the
annotatemethod has been changed fromMSExperimenttoAnnotatedMSRun, which is more specific for representing experiment data with annotations.
37-38: Updated documentation to reflect parameter type changeThe documentation has been correctly updated to mention
AnnotatedMSRuninstead ofMSExperiment.
45-48: Changed parameter type from MSExperiment to AnnotatedMSRunThe first parameter of the
annotatemethod overload has been changed fromMSExperimenttoAnnotatedMSRun, which is more specific for representing experiment data with annotations.
59-60: Updated documentation to reflect parameter type changeThe documentation has been correctly updated to mention
AnnotatedMSRuninstead ofMSExperiment.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Description
fix pyopenms builds
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI buildsSummary by CodeRabbit