Skip to content

[pyOpenMS][TEST] Pin DeprecationWarning + forwarding of the DataFrame shims (#9460) - #9539

Merged
timosachsenberg merged 1 commit into
OpenMS:developfrom
timosachsenberg:test/9460-deprecated-df-shims
Jun 16, 2026
Merged

timosachsenberg merged 1 commit into
OpenMS:developfrom
timosachsenberg:test/9460-deprecated-df-shims

Conversation

@timosachsenberg

Copy link
Copy Markdown
Contributor

What

Adds a pyOpenMS test (pandas-importorskip) for the two deprecated module-level DataFrame wrappers in pyopenms/_dataframes_compat.py. For each, it asserts the deprecate-and-forward contract:

  • pyopenms.peptide_identifications_to_df(peps) → emits a DeprecationWarning naming to_df, and forwards to peps.to_df() (same shape/columns);
  • pyopenms.update_scores_from_df(peps, df, "Mascot") → emits a DeprecationWarning naming update_scores_from_df, and forwards the score write-back, matching the direct (non-deprecated) peps.update_scores_from_df(df, "Mascot") call.

Why

Closes the deprecated-alias part of the §2 (pyOpenMS nanobind rewrite) [AUTO] task in the OpenMS 3.6.0 pre-release testing plan (#9460):

Assert the deprecated-alias … contracts … For each alias: assert it still resolves and emits its DeprecationWarning → replacement (pytest.warns). Pass: every shim warns and forwards.

The general dataframe tests (test000.py, test_dataframe_columns.py) call these wrappers but only check the resulting frame — the DeprecationWarning itself was never asserted (the one DeprecationWarning check in test_dataframe_columns.py is for to_arrow(long_format=…), a different alias). This pins the warning + forwarding directly.

Test plan

Tests only — no production code changed. Verified against the built nanobind bindings two ways: run as a direct script (All deprecated-dataframe-shim tests passed!) and via pytest (2 passed). pandas-importorskip keeps it optional; the classes used live in the metadata/chemistry/kernel modules (unaffected by the unrelated stale-build _pyopenms_analysis warning).

Part of #9460. Follows #9524, #9525, #9526, #9528, #9530, #9531, #9532, #9533, #9534, #9535, #9536, #9537, #9538.

🤖 Generated with Claude Code

… shims (OpenMS#9460)

pyopenms.peptide_identifications_to_df() and pyopenms.update_scores_from_df()
are deprecated module-level wrappers (pyopenms/_dataframes_compat.py) that
forward to PeptideIdentificationList.to_df() / .update_scores_from_df(). The
existing dataframe tests call them but never assert the deprecation contract.

Adds a test (pandas-importorskip) asserting that each wrapper:
- emits a DeprecationWarning naming its replacement (pytest.warns), and
- forwards correctly -- peptide_identifications_to_df() matches peps.to_df(),
  and update_scores_from_df() writes back the same scores as the direct call.

Closes the deprecated-alias part of issue OpenMS#9460 Section 2. Verified against the
built nanobind bindings (2 passed).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@timosachsenberg, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 65c2d031-6aa2-4f9e-a977-dc8e1c277b88

📥 Commits

Reviewing files that changed from the base of the PR and between aacd941 and 28f6b57.

📒 Files selected for processing (1)
  • src/pyOpenMS/tests/unittests/test_deprecated_dataframe_shims.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

Copy link
Copy Markdown
Contributor

@timosachsenberg The following names might be missing from the AUTHORS file:

  • Timo Sachsenberg

Please consider applying the following patch:

--- AUTHORS	2026-06-15 17:05:51.224826942 +0000
+++ AUTHORS.new	2026-06-15 17:05:56.460136222 +0000
@@ -23,8 +23,8 @@
  - Chirag Dave
  - Chris Bauer
  - Chris Bielow
- - Christie Mathews
  - Christian Ehrlich
+ - Christie Mathews
  - Clemens Groepl
  - Cornelia Friedle
  - Daniel Jameson

@timosachsenberg
timosachsenberg merged commit c22f64c into OpenMS:develop Jun 16, 2026
41 checks passed
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.

1 participant