Repository navigation
[FIX,PYOPENMS] Restore 3.5's in/out list updates and lost overloads; fix OPXLHelper - #10289
Conversation
…fix OPXLHelper nanobind cannot bind a Python list to a non-const std::vector reference, so the 3.6 bindings take such vectors by value and return the updated copy. 3.5 code still ran, but the caller's list silently stayed unchanged: after IDFilter.removeUnreferencedProteins(prots, peps) or FalseDiscoveryRate().apply(prots), prots was untouched (#10260). - pyopenms/addons/inout_lists.py wraps the 34 affected methods. After the call it copies the result into a Python list passed at the in/out position, so both f(prots, peps) and prots = f(prots, peps) work. apply_addons() installs it. The stub step sets PYOPENMS_STUBGEN, which skips the wrappers, because stubgen would describe them as (*args, **kwargs). - MapAlignmentAlgorithmIdentification aligns several maps again, and accepts 3.5's align(maps, transformations, reference_index); setReference() takes a PeptideIdentificationList again. - IDFilter.filterHitsByScore() takes a list of ProteinIdentification again, and updateProteinReferences() is a deprecated alias of removeDanglingProteinReferences(). - OPXLHelper.computeDeltaScores() was bound without its argument. The in-place PeptideIdentificationList overloads of the OPXLHelper methods now come before the by-value vector ones, which also accepted a PeptideIdentificationList and updated a copy. - TransitionTSVFile and TransitionPQPFile take file names as std::string, which accepts bytes, instead of const char*. - CHANGELOG: the above, the five methods that now return a tuple, and the char arguments that take a one-character str instead of bytes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7
…ut _arrow_zerocopy An 'import warnings' inside the long_format branch made warnings a local name for the whole function. When pyopenms._arrow_zerocopy is missing, the fallback then raised UnboundLocalError instead of warning and exporting in Python. The module already imports warnings. Found while testing the bindings in a build without the zero-copy module: 11 to_arrow tests failed there with the UnboundLocalError. With the fix, 10 of them pass through the fallback. The 11th counts the warnings and so also sees the fallback's own. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (11)
💤 Files with no reviewable changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe changes restore several pyOpenMS binding call forms and add compatibility handling for Python lists passed to methods that return updated lists. They also update stub generation, document compatibility details, and test the Arrow export fallback when its optional zero-copy module is unavailable. ChangesBinding compatibility
Arrow fallback
Sequence Diagram(s)sequenceDiagram
participant PythonCaller
participant inout_lists
participant nanobindMethod
PythonCaller->>inout_lists: Call wrapped method with Python list
inout_lists->>nanobindMethod: Forward method call
nanobindMethod-->>inout_lists: Return result containing updated list
inout_lists->>PythonCaller: Write list contents back and return original result
Suggested reviewers: Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to The restored call forms and list updates have no established issue requiring a change before merge; normal checks remain appropriate. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changes affect how Python callers receive updated scientific data, but the reviewed paths do not show a new privilege boundary or broader external exposure. Some compatibility and security coverage remains incomplete. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 44 functions across 8 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 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. A rabbit checks the lists in spring, Comment |
The first complete nightly since 2026-09-25 (four wheels, four installers, all from f0f2424, develop after OpenMS/OpenMS#10285) was checked with the full lab matrix, the Release readiness workflow and the by-hand checks. Now passing: A1, A2, C3 on every platform (the seven macOS TOPPAS tests pass), C6, D1, D2, E8, E9, F1 and F6 (OpenSSL 3.6.4). Still blocking: - C5: the Thermo default reader, fixed on develop by OpenMS/OpenMS#10274 after this nightly; - D5: the char-argument BREAKING note, added by OpenMS/OpenMS#10289; - E4, F7 and F8, unchanged. Three user-guide pages still fail but no longer count as regressions, because 3.5.0 fails their rewritten versions too; the report notes this gap in D2. The supported-platform paragraph of RELEASE-READINESS now says macOS 15. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7
…#4) * Record the 2026-09-25 readiness check of the 3.6.0 nightly The nightly of 2026-09-24 (published 2026-09-25) is still NOT READY, but every artifact now comes from one revision, 8b25c6e, so this report can judge one build end to end. The whole release matrix ran for the first time, including the Windows, macOS and Linux Python 3.14 runs and the Ubuntu 22.04 wheel run. Changes against the 2026-09-24 report: - A2, D6, B2/B5/B8/B9, F2, F5 and E9 pass. The Release workflow's Linux job builds the docs and runs Doxygen_Warning_test, which the previous report said no workflow did. - F7 is new: the Windows installer is unsigned and release.yml has no Windows signing step. The macOS package is signed and notarized. - The blocking failures in D1, D2/D5, F6, C3 (macOS), C5, E1/E2/E4/E8 and F1/C6 are unchanged; the four commits since touch none of them. - FeatureLinkerWNet is no longer in any package (OpenMS#10255), so C1 counts 153 tools and C3 records its two tests as not registered. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * Draft pyOpenMS 3.6.0 BREAKING notes from a 3.5.0/3.6.0 signature diff The draft proposes CHANGELOG entries for D1 and D5 of the 2026-09-25 readiness check: output arguments that became return values, bytes that became str inside returned containers, LogConfigHandler.getInstance(), the callable database singletons and the renamed enums. Every example was run in pyopenms 3.5.0 and in the 3.6.0.dev20260925 nightly. Comparing the parsed method signatures of both builds also turned up binding bugs that need fixing rather than a note: - SimpleSearchEngineAlgorithm.search() raises std::bad_cast; - copy.copy() returns a base-class object for 52 classes; - in/out arguments were bound as pure outputs (XLMS spectrum generators, OPXLHelper.computeDeltaScores, IsotopeLabelingMDVs.calculateMDVAccuracy); - 27 call forms lost their C++ default arguments; - several overloads were dropped. The appendix lists every 3.5.0 call form that 3.6.0 rejects. The removed-classes section is still pending. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * Complete the pyOpenMS notes draft with the removed classes Fill in the D1 section: for each of the 22 removed classes, whether the C++ class went too, whether the binding was dropped on purpose, and the 3.6.0 replacement, run in the nightly. Propose BREAKING entries for the removed classes and for MassTrace, which now names the kernel mass trace rather than 3.5.0's FeatureFinder struct. Add bug B6: SignalToNoiseEstimatorMedianRapid, SplineInterpolatedPeaks, the ConsensusFeature ratio API and RealMassDecomposer are unusable because their argument or result types are not bound. Correct the enum accounting. Of the vanished nested members, 195 still resolve under their 3.5.0 spelling. The rest are renamed or announced, apart from five that are gone with no replacement. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * Point the pyOpenMS notes draft at the fix PRs and correct two counts Section 1's CHANGELOG entries and the fixes for B1, B2 and B4 are now in OpenMS/OpenMS#10272, and the C5 vendor-reader fixes are in #10273 and #10274. B2 now counts only classes that copied in 3.5.0: 52 slice and 10 cannot be copied, rather than 8. Classes new in 3.6 are counted separately. replaceCVTerms lost its overload on 16 classes, not 17. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * Readiness report for the 2026-09-26 nightly: NOT READY, no installers The wheels come from 3e73c70 (develop after OpenMS/OpenMS#10277). The Release run on the same revision failed while notarizing the macOS package, because the runner lost its network, so no installer of this nightly was deployed. Rerun here: A1-A3 for the wheels, D1 (19 unannounced names, 0 with #10272 in develop), D2 (unchanged, 15 regressions), D6 and the source audit (E1-E3 now pass). The package checks carry over from the 2026-09-25 report. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * Readiness report for the 2026-09-27 nightly: NOT READY The first complete nightly since 2026-09-25 (four wheels, four installers, all from f0f2424, develop after OpenMS/OpenMS#10285) was checked with the full lab matrix, the Release readiness workflow and the by-hand checks. Now passing: A1, A2, C3 on every platform (the seven macOS TOPPAS tests pass), C6, D1, D2, E8, E9, F1 and F6 (OpenSSL 3.6.4). Still blocking: - C5: the Thermo default reader, fixed on develop by OpenMS/OpenMS#10274 after this nightly; - D5: the char-argument BREAKING note, added by OpenMS/OpenMS#10289; - E4, F7 and F8, unchanged. Three user-guide pages still fail but no longer count as regressions, because 3.5.0 fails their rewritten versions too; the report notes this gap in D2. The supported-platform paragraph of RELEASE-READINESS now says macOS 15. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 --------- Co-authored-by: Claude <[email protected]>
Description
This fixes the pyOpenMS 3.6 binding regressions that the release-readiness replay of the user guide found (#10260). They fall into four groups:
chararguments that no longer takebytes.A fifth, unrelated bug turned up while testing:
MSExperiment.to_arrow()failed instead of falling back when its zero-copy module is missing.1. In/out lists update the caller's list again
Many OpenMS functions update a
std::vector<T>&argument. pyOpenMS 3.5 wrote the result back into the Python list the caller passed. nanobind cannot bind a Pythonlistto a non-const vector reference, so the 3.6 bindings take the vector by value and return the updated copy.As a result, 3.5 code still runs, but its list silently stays unchanged. For example, after
IDFilter.removeUnreferencedProteins(prots, peps)the caller'sprotsstill holds every protein.Fix:
pyopenms/addons/inout_lists.pywraps the 34 affected methods; the table in that file lists them. After the bound function returns, the wrapper copies the result into a Python list passed at the in/out position, positionally or by keyword, and it passes the return value through unchanged.f(prots, peps)(3.5) andprots = f(prots, peps)(3.6) work.None(an overload that updates a bound container in place) is left alone;listgoes to the in/out argument;apply_addons()installs the wrappers. They keep__name__,__qualname__and the overload signatures (__nb_signature__), and their docstring says which argument is updated.PYOPENMS_STUBGEN=1, which leaves the bound functions unwrapped. stubgen would otherwise write(*args, **kwargs)for the wrapped methods; with it the stubs are unchanged.A C++ caster that writes back after the call would be the cleaner long-term design, but it needs a new caster for every element type and a full rebuild on three platforms just before the release. The add-on works like the existing
convexhull.pywrapping.Five of these methods also changed their return type:
PeptideIndexing.run(),PosteriorErrorProbabilityModel.fit()andinitPlots(),IDFilter.updateProteinGroups()andAbsoluteQuantitation.optimizeCalibrationCurveIterative(). Each now returns a tuple instead of its 3.5 result.if model.fit(...)always true.2. Calls that 3.5 had
MapAlignmentAlgorithmIdentification:align(maps, reference_index=-1)aligns several FeatureMaps, ConsensusMaps or PeptideIdentificationLists and returns oneTransformationDescriptionper map.align(maps, transformations, reference_index)fills the list passed in.setReference()takes a PeptideIdentificationList again.align(map)was bound, so the median alignment of several maps was not available from Python (map_alignment.rst).IDFilter:filterHitsByScore()takes a list ofProteinIdentificationagain. It returns the filtered list, and the add-on updates the caller's list.updateProteinReferences()is back as a deprecated alias ofremoveDanglingProteinReferences(), its C++ name since rename updateProteinReferences function to removeDanglingProteinReferences #8500.peptide_search.rstuses both.TransitionTSVFileandTransitionPQPFiletook their file names asconst char*, which nanobind accepts only asstr. They now takestd::string, which acceptsbyteslike the other file methods.3. OPXLHelper
computeDeltaScores()was bound without a parameter: it scored an empty list and returned it. It now takes the identifications, a PeptideIdentificationList in place or a list.addXLTargetDecoyMV,addBetaAccessions,removeBetaPeptideHits,addProteinPositionMetaValuesandcomputeDeltaScores, the by-valuestd::vectoroverload was registered first. A PeptideIdentificationList is a sequence, so that overload also took it and updated a copy.4.
charargumentsnanobind's
charcaster accepts only a one-characterstr, while 3.5 accepted onlybytes. The error is immediate, and the fix is one character. So this PR documents it as BREAKING, listing the affected methods, rather than wrapping them. AAIndex is included: its methods are static in 3.6, and it has no constructor.5.
MSExperiment.to_arrow()without_arrow_zerocopyAn
import warningsinside thelong_formatbranch madewarningsa local name for the whole function. So whenpyopenms._arrow_zerocopyis missing, the fallback raisedUnboundLocalErrorinstead of warning and exporting in Python.Validation
test_inout_lists.py(the add-on) and five tests intest_restored_call_forms.py(the C++ changes). All 69 tests in the two files pass.test_inout_lists.pycannot even be imported (the add-on does not exist there), and the five new call-form tests fail.__nb_signature__._arrow_zerocopymodule, which this local build does not produce (three test files were left out of both runs for that reason; elevento_arrowtests hit theUnboundLocalErrorfrom section 5).nanobind.stubgenon the processing module withPYOPENMS_STUBGEN=1writes the typed overloads, e.g.removeUnreferencedProteins(proteins: Sequence[ProteinIdentification], peptides: PeptideIdentificationList) -> list[ProteinIdentification]. Without it, stubgen writesdef removeUnreferencedProteins(*args, **kwargs).doc-examples.py), in [DOC,PYOPENMS] Update the pyOpenMS user guide to the 3.6 API; macOS 15 minimum #10285's version:map_alignment.rstgets past the multi-mapalignat line 154.peptide_search.rstruns its 3.5-style protein inference, protein FDR, protein-list score filter and reference cleanup.updateProteinReferencesthere. [DOC,PYOPENMS] Update the pyOpenMS user guide to the 3.6 API; macOS 15 minimum #10285 now callsremoveDanglingProteinReferences, and with that the page passes without a flag.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7
Generated by Claude Code
Summary by CodeRabbit
True.bytesare rejected.AAIndexmethods are static, and its constructor is no longer available.