Repository navigation
fix: more pyopenms fixes - #8065
Conversation
WalkthroughThis update removes the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AnnotatedMSRun
participant MapAlignmentAlgorithmIdentification
User->>AnnotatedMSRun: setProteinIdentifications(ids) / setProteinIdentifications(std::move(ids))
AnnotatedMSRun-->>User: (protein_ids_ updated)
%% The getRetentionTimes_ flow for AnnotatedMSRun is now removed
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
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: 1
🧹 Nitpick comments (2)
src/pyOpenMS/pxds/MSExperiment.pxd (2)
83-83: Good documentation improvement.The updated documentation for
updateRanges()clearly specifies that it recalculates ranges for "both spectra and chromatograms," which improves API clarity for users. There's also a minor typo in "chromatrograms" that should be "chromatograms."- void updateRanges() except + nogil # wrap-doc:Recalculate global ranges for both spectra and chromatrograms after changes to the data has been made. + void updateRanges() except + nogil # wrap-doc:Recalculate global ranges for both spectra and chromatograms after changes to the data has been made.
118-118: Track the TODO for combinedRanges() functionality.The TODO comment indicates that
combinedRanges()functionality is not yet implemented. This should be tracked to ensure it's completed in a future iteration.Would you like me to create an issue to track the implementation of the
combinedRanges()functionality?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
src/openms/include/OpenMS/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmIdentification.h(0 hunks)src/openms/include/OpenMS/METADATA/AnnotatedMSRun.h(2 hunks)src/openms/source/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmIdentification.cpp(0 hunks)src/pyOpenMS/pxds/AnnotatedMSRun.pxd(1 hunks)src/pyOpenMS/pxds/MSExperiment.pxd(2 hunks)src/pyOpenMS/pxds/MapAlignmentAlgorithmIdentification.pxd(0 hunks)src/pyOpenMS/pxds/ProteinIdentification.pxd(1 hunks)src/pyOpenMS/pxds/RangeManager.pxd(1 hunks)
💤 Files with no reviewable changes (3)
- src/pyOpenMS/pxds/MapAlignmentAlgorithmIdentification.pxd
- src/openms/source/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmIdentification.cpp
- src/openms/include/OpenMS/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmIdentification.h
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: build-and-test (macos-14, xcode, 15.0.1)
- GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
- GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
- GitHub Check: build-and-test (macos-13, xcode, 14.2)
- GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
- GitHub Check: cppcheck-test
🔇 Additional comments (4)
src/pyOpenMS/pxds/RangeManager.pxd (1)
123-123: Good practice: Controlling constructor bindings.Adding the
# wrap-ignorecomment for theRangeManagerRtMzIntMobconstructors is consistent with the pattern used for other RangeManager classes in this file. This helps control which constructors are exposed in the Python bindings, maintaining a cleaner API surface.src/pyOpenMS/pxds/AnnotatedMSRun.pxd (1)
32-33:Details
❓ Verification inconclusive
Verify impact of constructor removal.
The removal of the
AnnotatedMSRun(MSExperiment)constructor simplifies the class interface, requiring users to use the default constructor followed bysetMSExperiment(). This is a good simplification but represents a breaking change.
🏁 Script executed:
#!/bin/bash # Search for usage of AnnotatedMSRun constructor with MSExperiment parameter rg -A 3 -B 3 "AnnotatedMSRun.*MSExperiment" --type cpp --type pythonLength of output: 101
To ensure we catch all direct uses of the now-removed
AnnotatedMSRun(MSExperiment)constructor across C++ and Cython layers, let’s search in.cpp,.h,.pxd,.pxy, and.pyxfiles:
🏁 Script executed:
#!/bin/bash # Search for any calls to AnnotatedMSRun(MSExperiment) in C++ and Cython files rg -A3 -B3 'AnnotatedMSRun\s*\(\s*MSExperiment' -g '*.cpp' -g '*.h' -g '*.pxd' -g '*.pxy' -g '*.pyx'Length of output: 1922
Verify external impact of removing MSExperiment constructor
We confirmed via grep across C++ and Cython wrapper files that:
- The C++ class still defines
AnnotatedMSRun(MSExperiment&&)(move constructor).- The Cython
.pxdnow only exposes the default and copy constructors.- There are no in-repo calls to
AnnotatedMSRun(MSExperiment)in.cpp,.h,.pxd,.pxy, or.pyxfiles.Since this change only affects downstream Cython/Python users who relied on the
AnnotatedMSRun(MSExperiment)constructor, please review any external code, update documentation, and ensure clients migrate to:run = AnnotatedMSRun() run.setMSExperiment(exp)src/openms/include/OpenMS/METADATA/AnnotatedMSRun.h (2)
81-98: Setter methods are well-implemented and follow best practices.The addition of both copy and move setter methods for protein identifications is appropriate and follows the same pattern as the existing peptide identification setters. This provides flexibility for callers and enables efficient move semantics when transferring ownership.
112-112: Good documentation update for clarity.The comment now accurately reflects that this is the move version of the setter, which helps distinguish it from the copy version on line 119.
| void assignRanks() except + nogil # wrap-doc:Sorts the protein hits by score and assigns ranks (best score has rank 1) | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify removal of assignRanks() method usage.
The removal of the assignRanks() method aligns with the interface simplification efforts mentioned in the PR. However, ensure that all code that previously used this method has been updated or that alternative ranking mechanisms are in place.
🏁 Script executed:
#!/bin/bash
# Search for any remaining usage of assignRanks method in the codebase
rg -n "assignRanks" --type cpp --type pythonLength of output: 75
🏁 Script executed:
#!/bin/bash
# Search for any remaining usage of assignRanks method across all files
rg -n 'assignRanks' .Length of output: 346
Fix remaining assignRanks() references in tests
The assignRanks() method has been removed (per CHANGELOG), but there are still calls in the unit tests. Please update or remove these to use the new ranking API (e.g., sorting by score) so tests compile and pass.
• src/pyOpenMS/tests/unittests/test000.py:
– Line 4350: PeptideIdentification.assignRanks
– Line 4409: pi.assignRanks()
Ensure the tests reflect the replacement ranking mechanism.
🤖 Prompt for AI Agents
In src/pyOpenMS/pxds/ProteinIdentification.pxd at line 58, there is no code
present, but the review indicates that references to the assignRanks() method
still exist in the codebase and tests. The assignRanks() method has been
removed, so update or remove all calls to this method in the tests and code,
replacing them with the new ranking approach such as sorting by score.
Specifically, in src/pyOpenMS/tests/unittests/test000.py at lines 4350 and 4409,
remove or replace the assignRanks() calls to ensure tests compile and pass with
the new ranking mechanism.
Description
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
New Features
Bug Fixes
Documentation
Chores