Repository navigation
Fix pyOpenMS enum bindings out of sync with C++ enums - #9705
Conversation
NASequence::NASFragmentType, ProteomicsPkaScale, OSWHierarchy::Level, and LPWrapper::SOLVER were missing enumerators in the nanobind bindings that exist in the corresponding C++ enum definitions, making those values inaccessible from Python. - NASFragmentType: add 8 missing values (BIonMinusH20, YIonMinusH20, BIonMinusNH3, YIonMinusNH3, NonIdentified, Unannotated, AminusB, SizeOfNASFragmentType) - ProteomicsPkaScale: add missing SIZE_OF_PROTEOMICS_PKA_SCALES sentinel - OSWHierarchy::Level: add missing SIZE_OF_VALUES sentinel, used as the "unset" marker by OSWIndexTrace::lowest - LPWrapper::SOLVER: bind SOLVER_COINOR/SOLVER_HIGHS under the same OPENMS_HAS_COINOR/OPENMS_HAS_HIGHS guards used by the C++ enum Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01GhhgiwwEafRKTMtWeKSaEA
|
@timosachsenberg The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-07-03 05:40:03.707319626 +0000
+++ AUTHORS.new 2026-07-03 05:40:09.043198469 +0000
@@ -25,6 +25,7 @@
- Chris Bielow
- Christian Ehrlich
- Christie Mathews
+ - Claude
- Clemens Groepl
- Cornelia Friedle
- Daniel Jameson |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR updates pyOpenMS bindings to expose additional enum values. ChangesEnum binding expansions
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Routine changelog sweep found three merged develop PRs without changelog coverage: FileInfo progress-logging restoration (#9707), a pyOpenMS enum binding completeness fix (#9705), and OpenMP parallelization of the QPX feature Parquet export (#9699, extending #9698). Also updated the #9698 entry's now-inaccurate "Serial only" note to point at #9699. Claude-Session: https://claude.ai/code/session_014CUTttkkvRtTRtiV8ctAM6 Co-authored-by: Claude <[email protected]>
Three recently merged PRs landed on develop without changelog coverage: the OpenMP parallelization of the QPX feature Parquet export (#9699, follow-up to #9698), the pyOpenMS enum-binding drift fix restoring several inaccessible NASFragmentType/ProteomicsPkaScale/OSWHierarchy/ LPWrapper::SOLVER enumerators (#9705), and the re-added FileInfo progress logging exposed to pyOpenMS via Options.log_type (#9707). Claude-Session: https://claude.ai/code/session_01YCkM79JUnodCGEHtBKNWSz Co-authored-by: Claude <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Description
A routine audit of all 108
nb::enum_<...>registrations insrc/pyOpenMS/bindings/*.cppagainst their C++ enum definitions found 4 enums where the Python binding was missing enumerators present in the C++ header. This means those values were entirely inaccessible from Python (not a value-corruption issue — the bound values were correct, just incomplete). No ordering/value-mismatch issues were found anywhere else in the sweep (nanobind binds by explicitCppEnum::VALUE, not registration order, so omission is the only failure mode).Fixes:
NASequence::NASFragmentType(CHEMISTRY/NASequence.h) — added 8 missing values:BIonMinusH20,YIonMinusH20,BIonMinusNH3,YIonMinusNH3,NonIdentified,Unannotated,AminusB,SizeOfNASFragmentType. Python users could not construct/compare these nucleic-acid fragment ion types.ProteomicsPkaScale(CHEMISTRY/IsoelectricPoint.h) — added the missingSIZE_OF_PROTEOMICS_PKA_SCALESsentinel, for consistency with every otherSIZE_OF_*/NUMBER_OF_*sentinel bound elsewhere in the codebase.OSWHierarchy::Level(DATASTRUCTURES/OSWData.h) — added the missingSIZE_OF_VALUESsentinel, which is used byOSWIndexTrace::lowestas the "not set" marker.LPWrapper::SOLVER(DATASTRUCTURES/LPWrapper.h) —SOLVER_COINOR/SOLVER_HIGHSexist in the C++ enum under#ifdef OPENMS_HAS_COINOR/OPENMS_HAS_HIGHSbut were never bound in Python. Added them under matching#ifdefguards (the macros are already visible in this translation unit viaLPWrapper.h's own#include <OpenMS/config.h>).Only
.value(...)binding lines were added; no existing bindings were reordered or changed, so this cannot affect any currently-working Python code.Checklist
OPENMS_HAS_COINOR/OPENMS_HAS_HIGHSbranches ofLPWrapper::SOLVER.Generated by Claude Code
Summary by CodeRabbit
New Features
Bug Fixes