Repository navigation
Fix pyopenms - #8106
Fix pyopenms#8106
Conversation
… to work with new cython and autowrap
WalkthroughThe changes update type checks, operator overloads, and formatting across pyOpenMS Cython bindings and build scripts. Integer type assertions are standardized to Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BuildSystem
participant CMake
participant Generator
User->>BuildSystem: Start parallel build
BuildSystem->>CMake: Process custom commands
CMake->>Generator: Generate C++ extension files (single command)
Generator->>CMake: Touch .cpp_extension_generated sentinel
CMake->>BuildSystem: Mark generated files as ready (after sentinel)
BuildSystem->>User: Build completes without race condition
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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (30)
src/pyOpenMS/CMakeLists.txt(1 hunks)src/pyOpenMS/addons/AASequence.pyx(1 hunks)src/pyOpenMS/addons/Base64.pyx(4 hunks)src/pyOpenMS/addons/ConsensusMap.pyx(1 hunks)src/pyOpenMS/addons/DIAScoring.pyx(1 hunks)src/pyOpenMS/addons/FloatDataArray.pyx(2 hunks)src/pyOpenMS/addons/IntegerDataArray.pyx(2 hunks)src/pyOpenMS/addons/MSExperiment.pyx(2 hunks)src/pyOpenMS/addons/Param.pyx(1 hunks)src/pyOpenMS/addons/StringDataArray.pyx(2 hunks)src/pyOpenMS/addons/streampos.pyx(1 hunks)src/pyOpenMS/extra_includes/python_ms_data_consumer.hpp(1 hunks)src/pyOpenMS/pxds/BasicProteinInferenceAlgorithm.pxd(1 hunks)src/pyOpenMS/pxds/FASTAFile.pxd(2 hunks)src/pyOpenMS/pxds/FeatureGroupingAlgorithm.pxd(1 hunks)src/pyOpenMS/pxds/FloatDataArray.pxd(1 hunks)src/pyOpenMS/pxds/IntegerDataArray.pxd(1 hunks)src/pyOpenMS/pxds/KDTreeFeatureNode.pxd(1 hunks)src/pyOpenMS/pxds/LevMarqFitter1D.pxd(1 hunks)src/pyOpenMS/pxds/LinearInterpolation.pxd(1 hunks)src/pyOpenMS/pxds/MetaboliteFeatureDeconvolution.pxd(1 hunks)src/pyOpenMS/pxds/ReactionMonitoringTransition.pxd(1 hunks)src/pyOpenMS/pxds/Ribonucleotide.pxd(1 hunks)src/pyOpenMS/pxds/SpectrumAccessTransforming.pxd(1 hunks)src/pyOpenMS/pxds/SpectrumAlignment.pxd(1 hunks)src/pyOpenMS/pxds/SpectrumAlignmentScore.pxd(2 hunks)src/pyOpenMS/pxds/StringDataArray.pxd(1 hunks)src/pyOpenMS/pxds/TargetedExperimentHelper.pxd(9 hunks)src/pyOpenMS/pxds/Weights.pxd(1 hunks)src/pyOpenMS/requirements_bld.txt(1 hunks)
🧰 Additional context used
🧠 Learnings (20)
📓 Common learnings
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/SpectrumAlignment.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
src/pyOpenMS/pxds/Ribonucleotide.pxd (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/BasicProteinInferenceAlgorithm.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/SpectrumAlignmentScore.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/LevMarqFitter1D.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
src/pyOpenMS/pxds/KDTreeFeatureNode.pxd (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/LinearInterpolation.pxd (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/SpectrumAccessTransforming.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/MetaboliteFeatureDeconvolution.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
src/pyOpenMS/CMakeLists.txt (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/Weights.pxd (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/ReactionMonitoringTransition.pxd (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/extra_includes/python_ms_data_consumer.hpp (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/FeatureGroupingAlgorithm.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
src/pyOpenMS/pxds/FASTAFile.pxd (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/StringDataArray.pxd (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/addons/DIAScoring.pyx (1)
Learnt from: jpfeuffer
PR: OpenMS/OpenMS#7970
File: src/pyOpenMS/addons/MSSpectrum.pyx:38-38
Timestamp: 2025-04-07T21:15:07.674Z
Learning: In mass spectrometry data, precursor charges can be negative, so signed integer types (like np.int16) should be used instead of unsigned integers (like np.uint16) when storing charge values.
src/pyOpenMS/pxds/IntegerDataArray.pxd (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/TargetedExperimentHelper.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
- GitHub Check: build-and-test (macos-14, xcode, 15.0.1)
- GitHub Check: build-and-test (macos-13, xcode, 14.2)
- GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
- GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
🔇 Additional comments (36)
src/pyOpenMS/pxds/BasicProteinInferenceAlgorithm.pxd (1)
100-102: Whitespace-only change – no action neededThe inserted blank line after the wrap-doc block is purely cosmetic and does not affect the generated bindings or readability.
src/pyOpenMS/pxds/SpectrumAlignment.pxd (1)
11-14: Cosmetic newline looks fineAdding a single blank line after the
# wrap-inherits:list slightly improves visual separation without side-effects.src/pyOpenMS/pxds/LevMarqFitter1D.pxd (1)
9-9: Minor comment-format tweak acknowledgedExtra leading space in the wrap-doc comment is harmless; no further action required.
src/pyOpenMS/pxds/Ribonucleotide.pxd (1)
10-10: Spacing adjustment acceptedThe added space inside the wrap-attach comment does not influence binding generation.
src/pyOpenMS/pxds/KDTreeFeatureNode.pxd (1)
7-9: Indent / spacing change is fineMinor formatting change in the wrap-doc comment maintains consistency with other files.
src/pyOpenMS/pxds/MetaboliteFeatureDeconvolution.pxd (1)
33-36: LGTM! Formatting improvement for comment consistency.The spacing after
#in wrap comments improves readability and follows standard Python comment formatting conventions.src/pyOpenMS/pxds/FASTAFile.pxd (1)
22-22: LGTM! Whitespace cleanup improves code consistency.Removing trailing spaces is good practice and prevents unnecessary diff noise in version control.
Also applies to: 30-30, 44-44
src/pyOpenMS/addons/Base64.pyx (1)
10-10: LGTM! Correctly removes Python 2 long type support.The change from
(int, long)tointin type assertions is appropriate for Python 3 compatibility, whereintandlongare unified. This aligns with the PR objective to remove Python 2 specific code.Also applies to: 22-22, 35-35, 47-47
src/pyOpenMS/addons/ConsensusMap.pyx (1)
28-28: LGTM! Correctly modernizes type checking for Python 3.The change from
(int, long)tointin dictionary key type assertions is appropriate for Python 3 compatibility and aligns with the PR objective to remove Python 2 specific code.src/pyOpenMS/pxds/SpectrumAlignmentScore.pxd (1)
24-25: LGTM: Redundant constructor declaration removed.The removal of the duplicate default constructor declaration is a good cleanup. The remaining single declaration is correct for the default constructor.
src/pyOpenMS/requirements_bld.txt (2)
6-6: LGTM: Cython version update is appropriate.The update to Cython >= 3.1.0 is reasonable and likely provides better compatibility with the autowrap changes.
3-3: Confirm autowrap 0.23.0 availability and compatibilityautowrap 0.23.0 is published on PyPI (wheel and sdist are available). Before merging, please review the v0.23.0 release notes (GitHub tag v0.23.0 or CHANGELOG) to ensure your
.pxdwrap-ignore annotation updates align with any new semantics.• File:
src/pyOpenMS/requirements_bld.txt
– Line 3:autowrap >= 0.23.0src/pyOpenMS/pxds/LinearInterpolation.pxd (2)
8-10: LGTM: Improved annotation placement and formatting.Moving the
wrap-instancesdirective immediately after the class declaration improves clarity and follows better annotation practices for the wrapper generation.
15-27: LGTM: Formatting cleanup removes trailing spaces.The removal of trailing spaces in the docstring comments is a good cleanup that improves code consistency.
src/pyOpenMS/pxds/SpectrumAccessTransforming.pxd (1)
13-15: LGTM: Annotation removal aligns with autowrap 0.23.0 behavior.The removal of the
wrap-ignoreannotation is correct for autowrap 0.23.0, which properly respects ignore annotations unlike version 0.22. The explanatory comment is helpful for understanding the change.src/pyOpenMS/addons/Param.pyx (1)
80-80: LGTM: Fixed incorrect method call syntax.The change from
__str__(self)toself.__str__()corrects the improper method invocation syntax and follows Python conventions for special method calls.src/pyOpenMS/extra_includes/python_ms_data_consumer.hpp (1)
83-84: LGTM: Correct Python 3 compatibility updateThe change from
PyInt_FromSize_ttoPyLong_FromSize_tis appropriate for Python 3 compatibility. In Python 3, the int and long types are unified, andPyLong_FromSize_tis the correct function to convertsize_tvalues to Python integer objects.src/pyOpenMS/addons/DIAScoring.pyx (1)
7-7: LGTM: Appropriate type assertion update for Python 3The change from
(int, long)tointis correct for Python 3 compatibility, where int and long types are unified. Theinttype in Python 3 can handle both positive and negative charge values as needed in mass spectrometry.src/pyOpenMS/addons/AASequence.pyx (1)
11-12: LGTM: Type narrowing is appropriate for this use caseThe change from
unsigned longtounsigned intfor sequence size and iteration variables is acceptable since protein sequences are unlikely to exceed the range ofunsigned int. This standardizes the integer types across the codebase.src/pyOpenMS/pxds/FeatureGroupingAlgorithm.pxd (1)
12-13: LGTM: Appropriate autowrap version compatibility updateThe removal of the
# wrap-ignoreannotation is correctly aligned with the autowrap upgrade to version 0.23.0. The comment clearly explains that the newer version properly respects ignore annotations, so removing it allows derived classes to reference this base class during the wrapping process.src/pyOpenMS/pxds/FloatDataArray.pxd (1)
23-24: LGTM: Useful addition of comparison operatorsThe addition of
operator==andoperator!=enhances theFloatDataArrayclass with standard comparison functionality. Theexcept + nogilannotations are appropriate for these operators, allowing them to be called without the GIL while ensuring proper exception handling.src/pyOpenMS/addons/streampos.pyx (1)
3-8: LGTM! Python 3 modernization is correctly implemented.The conversion from
__long__to__int__method along with updating thelong()call toint()is the correct approach for Python 3 compatibility. The underlying C++<long>cast is appropriately preserved.src/pyOpenMS/pxds/StringDataArray.pxd (1)
22-23: LGTM! Comparison operators correctly added.The equality and inequality operators are properly declared with consistent signatures and exception handling. This enhancement provides valuable comparison functionality for StringDataArray instances.
src/pyOpenMS/pxds/ReactionMonitoringTransition.pxd (1)
78-79: LGTM! Comparison operators correctly added.The equality and inequality operators are properly declared with appropriate reference parameters and consistent exception handling. This enhancement enables direct comparison of ReactionMonitoringTransition instances.
src/pyOpenMS/addons/MSExperiment.pyx (2)
115-115: LGTM! Type assertion correctly modernized for Python 3.The change from accepting both
intandlongto strictlyintis appropriate for Python 3 compatibility wherelongwas merged intoint.
125-125: LGTM! Consistent type assertion modernization.The same Python 3 modernization pattern is correctly applied to the
getSpectrummethod, maintaining consistency with thegetChromatogrammethod.src/pyOpenMS/pxds/IntegerDataArray.pxd (1)
23-24: LGTM! Comparison operators correctly added.The equality and inequality operators are properly declared with consistent signatures and exception handling. This enhancement provides valuable comparison functionality for IntegerDataArray instances, maintaining consistency with other data array classes.
src/pyOpenMS/addons/StringDataArray.pyx (2)
6-6: LGTM: Python 2 cleanup - type assertions modernized.The removal of
longtype support from the type assertions aligns with the PR's objective of dropping Python 2 compatibility. This change is consistent across multiple pyOpenMS addon modules.Also applies to: 18-18
9-9: LGTM: Index variable types appropriately narrowed.Changing the internal index variables from
unsigned longtounsigned intis consistent with the stricter type checks and appropriate for array indexing operations.Also applies to: 22-22
src/pyOpenMS/addons/IntegerDataArray.pyx (2)
6-6: LGTM: Consistent type modernization.The type assertion changes from
(int, long)tointare consistent with the Python 2 cleanup effort and align with similar changes across other data array modules.Also applies to: 18-19
9-9: LGTM: Internal variable types appropriately updated.The change from
unsigned longtounsigned intfor index variables is consistent with the narrowed type checks and appropriate for array operations.Also applies to: 22-22
src/pyOpenMS/addons/FloatDataArray.pyx (2)
6-6: LGTM: Type assertions modernized for Python 3.The removal of
longtype support is consistent with the Python 2 cleanup effort across pyOpenMS addon modules.Also applies to: 18-18
9-9: LGTM: Index variable types appropriately narrowed.The change from
unsigned longtounsigned intaligns with the stricter type checks and is appropriate for array indexing.Also applies to: 22-22
src/pyOpenMS/CMakeLists.txt (2)
388-416: LGTM: Excellent solution to parallel build race condition.The sentinel file approach is a well-established pattern for preventing race conditions in parallel builds. The implementation correctly:
- Uses a single sentinel file as the primary output
- Touches the sentinel upon successful completion
- Declares actual generated files as dependent on the sentinel
- Includes clear documentation of the problem and solution
This ensures proper serialization of the code generation step without affecting build dependencies.
418-419: LGTM: Proper dependency management maintained.The
compile_pxdstarget correctly depends on the generated files, ensuring proper build ordering is maintained with the new sentinel-based approach.src/pyOpenMS/pxds/TargetedExperimentHelper.pxd (1)
42-43: LGTM: Comprehensive equality operator support added.The addition of
operator==andoperator!=overloads to multiple TargetedExperiment classes enables direct instance comparisons in Python. The consistent use ofexcept + nogilannotations ensures thread-safe operations without holding the Python GIL.This change aligns with similar operator additions across other pyOpenMS data array classes and enhances the consistency of the C++ interface exposed to Python.
Also applies to: 51-52, 69-70, 88-89, 99-99, 122-123, 151-152, 161-162, 169-170, 205-206, 216-217, 255-256, 278-279
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
| # value. else this method may return an int or long, depending on the magnitude of | ||
| # the value ! | ||
| return long(<long>(deref(self.inst.get()))) | ||
| return int(<long>(deref(self.inst.get()))) |
There was a problem hiding this comment.
we should think about this. is cast to long necessary?
There was a problem hiding this comment.
maybe the whole addon is not needed anymore?
There was a problem hiding this comment.
I would guess that it's not, but my understanding of why we had it is cursory at best. Was this to handle different size integer values?
There was a problem hiding this comment.
we should check where it is used and add a test to see if it fails if this addon is removed. I also have the feeling it is not necessary anymore now that python long is completely gone.
There was a problem hiding this comment.
As far as I can tell it's not used explicitly anywhere. My concern was that it gets used somewhere implicitly.
There was a problem hiding this comment.
It is used here:
OpenMS/src/pyOpenMS/tests/unittests/test000.py
Line 5175 in 16e128a
There was a problem hiding this comment.
Hm, so all of the other tests pass if it's removed.
| # wrap-ignore | ||
| # Abstract Class | ||
|
|
||
| #TODO: This was included in wrap-ignore with autowrap 22. 22 just didn't ignore it. 23 does, so we remove the annotiation since derived classes refer to it. |
There was a problem hiding this comment.
So this TODO comment will be parsed for the preceding class in your new Autowrap parser?
Not necessarily cleaner but fine if it is easier that way.
There was a problem hiding this comment.
Nope. It starts with # but doesn't have wrap- afterwards, so it gets discarded. The logic I added handles the situation where there are multiple wrap- annotations that apply to a class, but have empty lines in between.
…issing accessor functions (plus a major PITA issue where _testMetaData was clearing the metadata on a test)
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/pyOpenMS/tests/unittests/test000.py (1)
51-83: Review meta information handling logic carefully.The logic for preserving and restoring essential meta values appears sound, but consider these aspects:
Hardcoded essential keys: The list
["rank"]may not be comprehensive. Consider making this configurable or documenting why only "rank" is preserved.Type safety: Ensure that
preserved_valuesdictionary handling is robust for different value types.Error handling: The code assumes
setMetaValuewill always succeed during restoration. Consider adding error handling for edge cases.The core logic is correct, but consider this improvement:
- # Store essential meta values (like rank for PeptideHit) before testing - essential_keys = [b"rank"] - preserved_values = {} - for key in essential_keys: - if what.metaValueExists(key): - preserved_values[key] = what.getMetaValue(key) + # Store essential meta values (like rank for PeptideHit) before testing + essential_keys = [b"rank"] # TODO: Consider making this configurable + preserved_values = {} + for key in essential_keys: + try: + if what.metaValueExists(key): + preserved_values[key] = what.getMetaValue(key) + except Exception as e: + # Log warning but continue testing + print(f"Warning: Could not preserve meta value {key}: {e}")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/pyOpenMS/pxds/MSExperiment.pxd(1 hunks)src/pyOpenMS/pxds/SpectrumRangeManager.pxd(1 hunks)src/pyOpenMS/pyopenms/_dataframes.py(0 hunks)src/pyOpenMS/tests/unittests/test000.py(3 hunks)
💤 Files with no reviewable changes (1)
- src/pyOpenMS/pyopenms/_dataframes.py
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
src/pyOpenMS/pxds/SpectrumRangeManager.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
src/pyOpenMS/pxds/MSExperiment.pxd (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
src/pyOpenMS/tests/unittests/test000.py (3)
undefined
<retrieved_learning>
Learnt from: jpfeuffer
PR: #7970
File: src/pyOpenMS/addons/MSSpectrum.pyx:24-28
Timestamp: 2025-04-07T21:16:06.557Z
Learning: In OpenMS, the proper way to access ion mobility data in MSSpectrum is to use the getIMData() method, which returns a tuple with (position, unit). The position corresponds to the index in the FloatDataArrays where the ion mobility data is stored. Always use this method rather than assuming the first FloatDataArray contains ion mobility data.
</retrieved_learning>
<retrieved_learning>
Learnt from: jpfeuffer
PR: #7970
File: src/pyOpenMS/addons/MSSpectrum.pyx:24-28
Timestamp: 2025-04-07T21:16:06.557Z
Learning: In OpenMS, the proper way to access ion mobility data in MSSpectrum is to use the getIMData() method, which returns a tuple with (position, unit). The position corresponds to the index in the FloatDataArrays where the ion mobility data is stored. Always use this method rather than assuming the first FloatDataArray contains ion mobility data.
</retrieved_learning>
<retrieved_learning>
Learnt from: jpfeuffer
PR: #7970
File: src/pyOpenMS/addons/MSSpectrum.pyx:38-38
Timestamp: 2025-04-07T21:15:07.674Z
Learning: In mass spectrometry data, precursor charges can be negative, so signed integer types (like np.int16) should be used instead of unsigned integers (like np.uint16) when storing charge values.
</retrieved_learning>
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: build-and-test (macos-14, xcode, 15.0.1)
- 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: build-and-test (ubuntu-22.04, g++, 11)
- GitHub Check: cppcheck-test
🔇 Additional comments (4)
src/pyOpenMS/pxds/SpectrumRangeManager.pxd (1)
26-27: LGTM: Operator overloads are correctly implemented.The equality and inequality operators are properly declared with appropriate signatures, exception handling, and nogil annotations. This enhances the API by enabling direct comparison of SpectrumRangeManager instances.
src/pyOpenMS/pxds/MSExperiment.pxd (2)
120-129: Well-implemented convenience methods with good documentation.The range accessor methods are properly declared with clear documentation comments and consistent exception handling. These methods will provide a convenient API for accessing range information.
118-129: Combined ranges functionality is implemented and in useThe C++ class MSExperiment defines and maintains
combined_ranges_(see MSExperiment.cpp/MSExperiment.h), and exposes inline getters (getMinRT(),getMaxMZ(), etc.) that the Cython convenience methods bind to. Your test suite already calls these methods (in tests for MSExperiment, spectra, chromatograms, and in_dataframes.py), and exercisesupdateRanges(), so the underlying range manager is being populated and used at runtime. No further action is needed here.• The TODO for exposing
combinedRanges()in the .pxd can be removed or deferred to a separate cleanup
• All new convenience methods are backed by tested, working C++ implementationssrc/pyOpenMS/tests/unittests/test000.py (1)
3151-3151: No other tests expect 11 DataFrame columns
Verified that searching the entiresrc/pyOpenMS/testsdirectory for any remainingdf.shape == (…, 11)yields no results. The updated assertion in:
- File:
src/pyOpenMS/tests/unittests/test000.py(line 3151)- Changed from
- assert df.shape == (2, 11) + assert df.shape == (2, 10)accurately reflects the removal of the peptide sequence column in
spec.get_df(). All tests now consistently expect 10 columns.
… to need it in py3.
Remove comment referring to earlier debugging efforts
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/pyOpenMS/tests/unittests/test000.py (1)
3716-3910: Comprehensive ReactionMonitoringTransition test needs style improvementsThe test function is well-structured and covers all the documented methods thoroughly. However, there are several style issues that should be addressed:
Apply these style improvements:
- assert tr == tr # test __eq__ with self + assert tr == tr # test __eq__ with self - assert not tr != tr # test __ne__ + assert tr == tr # test __ne__ - assert tr.isDetectingTransition() == True + assert tr.isDetectingTransition() - assert tr.isDetectingTransition() == False + assert not tr.isDetectingTransition() - assert tr.isIdentifyingTransition() == True + assert tr.isIdentifyingTransition() - assert tr.isIdentifyingTransition() == False + assert not tr.isIdentifyingTransition() - assert tr.isQuantifyingTransition() == True + assert tr.isQuantifyingTransition() - assert tr.isQuantifyingTransition() == False + assert not tr.isQuantifyingTransition() - assert tr.hasPrecursorCVTerms() == False or tr.hasPrecursorCVTerms() == True + assert not tr.hasPrecursorCVTerms() or tr.hasPrecursorCVTerms() - assert tr.isProductChargeStateSet() == True + assert tr.isProductChargeStateSet() - assert tr.hasPrediction() == False or tr.hasPrediction() == True + assert not tr.hasPrediction() or tr.hasPrediction() - assert not tr == tr_different + assert tr != tr_different
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/pyOpenMS/create_cpp_extension.py(0 hunks)src/pyOpenMS/tests/unittests/test000.py(7 hunks)
💤 Files with no reviewable changes (1)
- src/pyOpenMS/create_cpp_extension.py
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/tests/unittests/test000.py (3)
undefined
<retrieved_learning>
Learnt from: jpfeuffer
PR: #7970
File: src/pyOpenMS/addons/MSSpectrum.pyx:24-28
Timestamp: 2025-04-07T21:16:06.557Z
Learning: In OpenMS, the proper way to access ion mobility data in MSSpectrum is to use the getIMData() method, which returns a tuple with (position, unit). The position corresponds to the index in the FloatDataArrays where the ion mobility data is stored. Always use this method rather than assuming the first FloatDataArray contains ion mobility data.
</retrieved_learning>
<retrieved_learning>
Learnt from: jpfeuffer
PR: #7970
File: src/pyOpenMS/addons/MSSpectrum.pyx:24-28
Timestamp: 2025-04-07T21:16:06.557Z
Learning: In OpenMS, the proper way to access ion mobility data in MSSpectrum is to use the getIMData() method, which returns a tuple with (position, unit). The position corresponds to the index in the FloatDataArrays where the ion mobility data is stored. Always use this method rather than assuming the first FloatDataArray contains ion mobility data.
</retrieved_learning>
<retrieved_learning>
Learnt from: jpfeuffer
PR: #7970
File: src/pyOpenMS/addons/MSSpectrum.pyx:38-38
Timestamp: 2025-04-07T21:15:07.674Z
Learning: In mass spectrometry data, precursor charges can be negative, so signed integer types (like np.int16) should be used instead of unsigned integers (like np.uint16) when storing charge values.
</retrieved_learning>
🪛 Ruff (0.11.9)
src/pyOpenMS/tests/unittests/test000.py
3765-3765: Use tr == tr instead of not tr != tr
Replace with == operator
(SIM202)
3801-3801: Avoid equality comparisons to True; use if tr.isDetectingTransition(): for truth checks
Replace with tr.isDetectingTransition()
(E712)
3803-3803: Avoid equality comparisons to False; use if not tr.isDetectingTransition(): for false checks
Replace with not tr.isDetectingTransition()
(E712)
3806-3806: Avoid equality comparisons to True; use if tr.isIdentifyingTransition(): for truth checks
Replace with tr.isIdentifyingTransition()
(E712)
3808-3808: Avoid equality comparisons to False; use if not tr.isIdentifyingTransition(): for false checks
Replace with not tr.isIdentifyingTransition()
(E712)
3811-3811: Avoid equality comparisons to True; use if tr.isQuantifyingTransition(): for truth checks
Replace with tr.isQuantifyingTransition()
(E712)
3813-3813: Avoid equality comparisons to False; use if not tr.isQuantifyingTransition(): for false checks
Replace with not tr.isQuantifyingTransition()
(E712)
3825-3825: Avoid equality comparisons to False; use if not tr.hasPrecursorCVTerms(): for false checks
Replace with not tr.hasPrecursorCVTerms()
(E712)
3825-3825: Avoid equality comparisons to True; use if tr.hasPrecursorCVTerms(): for truth checks
Replace with tr.hasPrecursorCVTerms()
(E712)
3878-3878: Avoid equality comparisons to True; use if tr.isProductChargeStateSet(): for truth checks
Replace with tr.isProductChargeStateSet()
(E712)
3888-3888: Avoid equality comparisons to False; use if not tr.hasPrediction(): for false checks
Replace with not tr.hasPrediction()
(E712)
3888-3888: Avoid equality comparisons to True; use if tr.hasPrediction(): for truth checks
Replace with tr.hasPrediction()
(E712)
3909-3909: Use tr != tr_different instead of not tr == tr_different
Replace with != operator
(SIM201)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- 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 (windows-2022, cl.exe, 14.36)
- GitHub Check: cppcheck-test
🔇 Additional comments (3)
src/pyOpenMS/tests/unittests/test000.py (3)
51-83: Meta information handling logic is well-implementedThe preservation and restoration of essential meta values (particularly the "rank" key) is a good approach to maintain data integrity during testing. The logic correctly stores essential keys before clearing meta info and restores them afterward, with the assertion properly accounting for preserved values.
3151-3151: DataFrame column count reduction is consistent with peptide sequence removalThe change from 11 to 10 expected columns aligns with the removal of peptide sequence extraction from DataFrame generation mentioned in the AI summary.
3223-3263: Equality tests for data arrays are appropriateThe addition of
__eq__tests for StringDataArray, IntegerDataArray, and FloatDataArray objects is good for ensuring proper equality operator implementation. The commented-out inequality tests suggest these may not be working as expected currently.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/pyOpenMS/tests/unittests/test000.py (1)
3719-3912: Comprehensive ReactionMonitoringTransition test - Address style issuesThis is an excellent comprehensive test that covers all aspects of the ReactionMonitoringTransition class. However, there are several style improvements that should be addressed based on static analysis:
Apply these style improvements:
- assert tr == tr # test __eq__ with self - assert tr == tr2 # test __eq__ with another default instance - assert not tr != tr # test __ne__ + assert tr == tr # test __eq__ with self + assert tr == tr2 # test __eq__ with another default instance + assert tr != tr # test __ne__- assert tr.isDetectingTransition() == True + assert tr.isDetectingTransition() - assert tr.isDetectingTransition() == False + assert not tr.isDetectingTransition()- assert tr.isIdentifyingTransition() == True + assert tr.isIdentifyingTransition() - assert tr.isIdentifyingTransition() == False + assert not tr.isIdentifyingTransition()- assert tr.isQuantifyingTransition() == True + assert tr.isQuantifyingTransition() - assert tr.isQuantifyingTransition() == False + assert not tr.isQuantifyingTransition()- assert tr.hasPrecursorCVTerms() == False or tr.hasPrecursorCVTerms() == True # should not crash + assert not tr.hasPrecursorCVTerms() or tr.hasPrecursorCVTerms() # should not crash- assert tr.isProductChargeStateSet() == True + assert tr.isProductChargeStateSet()- assert tr.hasPrediction() == False or tr.hasPrediction() == True # should not crash + assert not tr.hasPrediction() or tr.hasPrediction() # should not crash- assert not tr == tr_different + assert tr != tr_differentThe test logic is excellent and thoroughly covers all the ReactionMonitoringTransition functionality including construction, equality, setters/getters, CV terms, intermediate products, retention time, and prediction.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/pyOpenMS/tests/unittests/test000.py(6 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/tests/unittests/test000.py (3)
undefined
<retrieved_learning>
Learnt from: jpfeuffer
PR: #7970
File: src/pyOpenMS/addons/MSSpectrum.pyx:24-28
Timestamp: 2025-04-07T21:16:06.557Z
Learning: In OpenMS, the proper way to access ion mobility data in MSSpectrum is to use the getIMData() method, which returns a tuple with (position, unit). The position corresponds to the index in the FloatDataArrays where the ion mobility data is stored. Always use this method rather than assuming the first FloatDataArray contains ion mobility data.
</retrieved_learning>
<retrieved_learning>
Learnt from: jpfeuffer
PR: #7970
File: src/pyOpenMS/addons/MSSpectrum.pyx:24-28
Timestamp: 2025-04-07T21:16:06.557Z
Learning: In OpenMS, the proper way to access ion mobility data in MSSpectrum is to use the getIMData() method, which returns a tuple with (position, unit). The position corresponds to the index in the FloatDataArrays where the ion mobility data is stored. Always use this method rather than assuming the first FloatDataArray contains ion mobility data.
</retrieved_learning>
<retrieved_learning>
Learnt from: jpfeuffer
PR: #7970
File: src/pyOpenMS/addons/MSSpectrum.pyx:38-38
Timestamp: 2025-04-07T21:15:07.674Z
Learning: In mass spectrometry data, precursor charges can be negative, so signed integer types (like np.int16) should be used instead of unsigned integers (like np.uint16) when storing charge values.
</retrieved_learning>
🧬 Code Graph Analysis (1)
src/pyOpenMS/tests/unittests/test000.py (5)
src/openms/include/OpenMS/KERNEL/MSSpectrum.h (16)
setName(249-249)setStringDataArrays(285-285)getStringDataArrays(279-279)getStringDataArrays(282-282)MSSpectrum(167-167)MSSpectrum(170-170)MSSpectrum(173-173)MSSpectrum(176-176)getIntegerDataArrays(288-288)getIntegerDataArrays(291-291)setIntegerDataArrays(294-294)setFloatDataArrays(276-276)getFloatDataArrays(267-267)getFloatDataArrays(270-273)getFloatDataArrays(270-270)getName(246-246)src/openms/source/KERNEL/MSSpectrum.cpp (23)
setName(630-633)setName(630-630)setStringDataArrays(650-653)setStringDataArrays(650-650)getStringDataArrays(645-648)getStringDataArrays(645-645)getStringDataArrays(655-658)getStringDataArrays(655-655)MSSpectrum(515-515)MSSpectrum(517-520)MSSpectrum(522-522)getIntegerDataArrays(660-663)getIntegerDataArrays(660-660)getIntegerDataArrays(665-668)getIntegerDataArrays(665-665)setIntegerDataArrays(670-673)setIntegerDataArrays(670-670)setFloatDataArrays(640-643)setFloatDataArrays(640-640)getFloatDataArrays(635-638)getFloatDataArrays(635-635)getName(625-628)getName(625-625)src/openms/include/OpenMS/FORMAT/HANDLERS/MzIdentMLHandler.h (2)
setName(97-97)getName(100-100)src/openms/include/OpenMS/ANALYSIS/MRM/ReactionMonitoringTransition.h (34)
setPeptideRef(81-81)getPeptideRef(83-83)setCompoundRef(85-85)getCompoundRef(87-87)setProductMZ(108-108)setPrecursorMZ(90-90)getPrecursorMZ(93-93)setLibraryIntensity(151-151)getLibraryIntensity(148-148)setDetectingTransition(201-201)isDetectingTransition(199-199)setIdentifyingTransition(219-219)isIdentifyingTransition(217-217)setQuantifyingTransition(236-236)isQuantifyingTransition(234-234)setDecoyTransitionType(145-145)getDecoyTransitionType(142-142)hasPrecursorCVTerms(96-96)addPrecursorCVTerm(100-100)getPrecursorCVTermList(106-106)setPrecursorCVTermList(98-98)addProductCVTerm(116-116)getIntermediateProducts(118-118)addIntermediateProduct(120-120)setIntermediateProducts(122-122)setProduct(124-124)getProduct(126-126)getProductChargeState(112-112)isProductChargeStateSet(114-114)setRetentionTime(171-171)hasPrediction(129-129)setPrediction(131-131)addPredictionTerm(133-133)getPrediction(139-139)src/openms/include/OpenMS/CHEMISTRY/AASequence.h (1)
getMZ(485-485)
🪛 Ruff (0.11.9)
src/pyOpenMS/tests/unittests/test000.py
3768-3768: Use tr == tr instead of not tr != tr
Replace with == operator
(SIM202)
3804-3804: Avoid equality comparisons to True; use if tr.isDetectingTransition(): for truth checks
Replace with tr.isDetectingTransition()
(E712)
3806-3806: Avoid equality comparisons to False; use if not tr.isDetectingTransition(): for false checks
Replace with not tr.isDetectingTransition()
(E712)
3809-3809: Avoid equality comparisons to True; use if tr.isIdentifyingTransition(): for truth checks
Replace with tr.isIdentifyingTransition()
(E712)
3811-3811: Avoid equality comparisons to False; use if not tr.isIdentifyingTransition(): for false checks
Replace with not tr.isIdentifyingTransition()
(E712)
3814-3814: Avoid equality comparisons to True; use if tr.isQuantifyingTransition(): for truth checks
Replace with tr.isQuantifyingTransition()
(E712)
3816-3816: Avoid equality comparisons to False; use if not tr.isQuantifyingTransition(): for false checks
Replace with not tr.isQuantifyingTransition()
(E712)
3828-3828: Avoid equality comparisons to False; use if not tr.hasPrecursorCVTerms(): for false checks
Replace with not tr.hasPrecursorCVTerms()
(E712)
3828-3828: Avoid equality comparisons to True; use if tr.hasPrecursorCVTerms(): for truth checks
Replace with tr.hasPrecursorCVTerms()
(E712)
3881-3881: Avoid equality comparisons to True; use if tr.isProductChargeStateSet(): for truth checks
Replace with tr.isProductChargeStateSet()
(E712)
3891-3891: Avoid equality comparisons to False; use if not tr.hasPrediction(): for false checks
Replace with not tr.hasPrediction()
(E712)
3891-3891: Avoid equality comparisons to True; use if tr.hasPrediction(): for truth checks
Replace with tr.hasPrediction()
(E712)
3912-3912: Use tr != tr_different instead of not tr == tr_different
Replace with != operator
(SIM201)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- 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 (macos-14, xcode, 15.0.1)
- GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
- GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
- GitHub Check: cppcheck-test
🔇 Additional comments (5)
src/pyOpenMS/tests/unittests/test000.py (5)
42-49: LGTM: Comment formatting updatesThe comment formatting changes look good and maintain consistency.
51-77: Good improvement: Essential meta value preservationThis is a well-implemented solution to preserve essential meta values like "rank" for PeptideHit before clearing meta info. The preservation and restoration logic ensures that critical metadata is maintained during testing.
The code correctly:
- Stores essential values before clearing
- Restores them after
clearMetaInfo()- Uses proper key existence checks
81-83: Correct assertion update for preserved keysThe assertion correctly accounts for the preserved essential meta values. The dynamic length check based on
len(preserved_values)is appropriate and flexible.
3217-3217: Excellent addition of equality operator testsThe new equality (
==) and inequality (!=) tests for StringDataArray, IntegerDataArray, and FloatDataArray are valuable additions that ensure these operators work correctly. The tests properly verify both self-equality and inequality between different arrays.Also applies to: 3224-3225, 3233-3233, 3240-3241, 3258-3258, 3265-3266
3151-3151: Confirm the additional column in MSSpectrum.get_dfIt looks like
spec.get_df()now returns 10 columns (shape(2, 10)) instead of 9. Please ensure this aligns with your intended changes:
- File:
src/pyOpenMS/tests/unittests/test000.py, line 3151_MSSpectrumDF.get_df()defines these core columns:
['mz', 'intensity', 'ion_mobility', 'ion_mobility_unit', 'ms_level', 'precursor_mz', 'precursor_charge', 'native_id', 'ion_annotation']- Since
export_meta_values=Trueby default, any meta‐value keys on the spectrum will add extra columns via_add_meta_values.- Verify whether:
- A new default meta key was introduced (and identify its name), or
- You intended to include a new data column (e.g. an added annotation), or
- You should call
get_df(export_meta_values=False)if no meta columns are desired.- Update the test to explicitly assert the new column name (or disable metadata export) so the expected shape remains clear.
Update pxds and pyx files to work with Autowrap 0.23.0, remove py2 specific stuff from pyopenms. General cleanup.
Summary by CodeRabbit
New Features
Bug Fixes
Chores