Skip to content

Fix wrap ignore jawn - #8119

Merged
poshul merged 10 commits into
developfrom
fix_wrap-ignore_jawn
Jul 15, 2025
Merged

poshul merged 10 commits into
developfrom
fix_wrap-ignore_jawn

Conversation

@poshul

@poshul poshul commented Jul 11, 2025 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor

    • Updated peptide identification collections to use a specialized container type for improved consistency.
    • Adjusted related method calls and list operations to align with the new container type.
  • Tests

    • Updated tests to utilize the specialized peptide identification container and corresponding methods.
    • Modified assertions and test logic to reflect updated data structure handling.
  • Style

    • Enhanced annotations and comments for abstract and ignored classes to improve clarity.
    • Added clarifying comments for method implementations in data array classes.

@coderabbitai

coderabbitai Bot commented Jul 11, 2025 •

Copy link
Copy Markdown
Contributor
## Walkthrough

The changes update type annotations and usage of peptide identification containers throughout the codebase, replacing Python lists with the more specific `_PeptideIdentificationList` type. Annotation comments for class declarations in Cython `.pxd` files are standardized. Test code is updated to use the new container type and associated methods. Minor comment additions and syntax cleanups are also included.

## Changes

| File(s)                                                    | Change Summary                                                                                                   |
|------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| src/pyOpenMS/pxds/ConsensusMap.pxd                         | Removed `# wrap-ignore` from `getUnassignedPeptideIdentifications()` method declaration.                         |
| src/pyOpenMS/pxds/FeatureGroupingAlgorithm.pxd,<br>src/pyOpenMS/pxds/SpectrumAccessTransforming.pxd | Added `# wrap-ignore`, `# ABSTRACT class`, and `# no-pxd-import` annotations to class declarations; updated comments. |
| src/pyOpenMS/pxds/StringDataArray.pxd                       | Added comment noting `resize(size_t n)` method implemented in `.pyx` file; no signature changes.                 |
| src/pyOpenMS/pyopenms/_dataframes.py                       | Replaced all `list[PeptideIdentification]` with `_PeptideIdentificationList`; updated function signatures and list operations accordingly. |
| src/pyOpenMS/tests/unittests/test000.py                    | Updated tests to use `PeptideIdentificationList` and related methods instead of Python lists; adjusted assertions.|
| src/pyOpenMS/tests/unittests/test_FileIO.py                | Replaced Python lists with `PeptideIdentificationList` for peptide identifications; updated size checks and removed redundant semicolons. |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant pyopenms._dataframes
    participant _PeptideIdentificationList

    User->>pyopenms._dataframes: Call peptide_identifications_to_df(peps)
    pyopenms._dataframes->>_PeptideIdentificationList: Iterate, access, push_back, size, etc.
    pyopenms._dataframes-->>User: Return DataFrame

    User->>pyopenms._dataframes: Call update_scores_from_df(peps, df, main_score_name)
    pyopenms._dataframes->>_PeptideIdentificationList: Update scores using push_back, size, etc.
    pyopenms._dataframes-->>User: (operation complete)

Poem

In the fields of code, a rabbit hops,
Swapping lists for types, it never stops.
With push_back and size, the data aligns,
Abstract classes marked with tidy lines.
Tests now leap with a bounding cheer—
Type-safe carrots, the changes are here! 🥕


<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 26276f702d92044b07bed31ea93c44d5ea550f46 and 83fc0adc1ed52530a91cf7dc5e3822a54517e7df.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `src/pyOpenMS/pyopenms/_dataframes.py` (7 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧠 Learnings (1)</summary>

<details>
<summary>📓 Common learnings</summary>

Learnt from: FreezB11
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: FreezB11
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.


</details>

</details><details>
<summary>🧬 Code Graph Analysis (1)</summary>

<details>
<summary>src/pyOpenMS/pyopenms/_dataframes.py (1)</summary><blockquote>

<details>
<summary>src/openms/include/OpenMS/KERNEL/MSExperiment.h (2)</summary>

* `size` (128-131)
* `size` (128-128)

</details>

</blockquote></details>

</details><details>
<summary>🪛 GitHub Check: CodeFactor</summary>

<details>
<summary>src/pyOpenMS/pyopenms/_dataframes.py</summary>

[notice] 517-614: src/pyOpenMS/pyopenms/_dataframes.py#L517-L614
Complex Method

</details>

</details>

</details>

<details>
<summary>⏰ 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)</summary>

* GitHub Check: build-lnx
* GitHub Check: build-win
* GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
* GitHub Check: build-and-test (macos-14, xcode, 15.0.1)
* GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
* GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
* GitHub Check: cppcheck-test

</details>

<details>
<summary>🔇 Additional comments (11)</summary><blockquote>

<details>
<summary>src/pyOpenMS/pyopenms/_dataframes.py (11)</summary>

`11-11`: **Import addition looks good.**

The import of `PeptideIdentificationList as _PeptideIdentificationList` is correctly added to support the type system updates throughout the file.

---

`109-109`: **Type annotation correctly updated.**

The type annotation change from `list[PeptideIdentification]` to `_PeptideIdentificationList` is consistent with the systematic migration to the specific container type.

---

`111-111`: **Method call correctly updated for new container type.**

The change from `len(pep)` to `pep.size()` is appropriate for the `_PeptideIdentificationList` container type.

---

`246-246`: **Type annotation correctly updated.**

The type annotation change from `list[PeptideIdentification]` to `_PeptideIdentificationList` maintains consistency with the container type migration.

---

`252-252`: **Method call correctly updated for new container type.**

The change from `len(pep)` to `pep.size()` is appropriate for the `_PeptideIdentificationList` container type.

---

`295-295`: **Return type annotation correctly updated.**

The return type annotation change from `list[PeptideIdentification]` to `_PeptideIdentificationList` is consistent with the function's implementation.

---

`297-297`: **Container initialization correctly updated.**

The initialization change from `result = []` to `result = _PeptideIdentificationList()` is appropriate for the new container type.

---

`310-310`: **Method call correctly updated for new container type.**

The change from `result.append(pep)` to `result.push_back(pep)` is appropriate for the `_PeptideIdentificationList` container type.

---

`517-532`: **Parameter type and mutable default argument correctly addressed.**

The changes successfully:
1. Update the parameter type from `list[PeptideIdentification]` to `_PeptideIdentificationList`
2. Fix the mutable default argument issue by setting `default_missing_values=None` and initializing it inside the function
3. Update the documentation to reflect the new parameter type

This addresses the previous review comment about the mutable default argument issue.

---

`536-536`: **Method call correctly updated for new container type.**

The change from `len(peps)` to `peps.size()` is appropriate for the `_PeptideIdentificationList` container type.

---

`621-621`: **Parameter type annotation correctly updated.**

The parameter type change from `list[PeptideIdentification]` to `_PeptideIdentificationList` maintains consistency with the container type migration throughout the codebase.

</details>

</blockquote></details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4AxeAA9IAdyrcURDPgolIQtE4wDADlsZgFKLgAOAEZogE4DAFVECJ58RFhsCyN9Y3AoMnp8ADMcAmIyZRp6JlZ2Ll5+YVFxKRl5JiUqVXUtHVyTKDhUVEwywlJyKmqFOoxOSConSERQ5jQKeTkFLpU1TW1dMEM80wNECgYAem5ZAHluMgBZAGUb+1pEK4BhfAwU/7YRBPNDcDTcD4cAwAIlhBgAxPDIABBACSFSm1DoKzWG3kJUYsEwpEQZlgPgYRIwpEWJGY+DakFw5MgAAMkS5QWB4B4vCRWZBaPBvGJJD5ihQWEyWUoGBYNtR4H9+KVmT42MzFGzSLhEhg0IhEDzy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gJE145E9EJYwE5fu0x0xANo8vpmHowY0YzaoUBo0AA== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=OpenMS/OpenMS&utm_content=8119):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@poshul
poshul marked this pull request as ready for review July 15, 2025 10:51

@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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91c4eb9 and 7a0fea1.

📒 Files selected for processing (5)
  • src/pyOpenMS/pxds/ConsensusMap.pxd (1 hunks)
  • src/pyOpenMS/pxds/FeatureGroupingAlgorithm.pxd (1 hunks)
  • src/pyOpenMS/pxds/SpectrumAccessTransforming.pxd (1 hunks)
  • src/pyOpenMS/pyopenms/_dataframes.py (9 hunks)
  • src/pyOpenMS/tests/unittests/test000.py (8 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
src/pyOpenMS/pxds/ConsensusMap.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
src/pyOpenMS/pxds/FeatureGroupingAlgorithm.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
src/pyOpenMS/pxds/SpectrumAccessTransforming.pxd (2)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
🪛 Ruff (0.12.2)
src/pyOpenMS/pyopenms/_dataframes.py

518-518: Do not use mutable data structures for argument defaults

Replace with None; initialize within function

(B006)

🪛 GitHub Check: CodeFactor
src/pyOpenMS/pyopenms/_dataframes.py

[notice] 517-614: src/pyOpenMS/pyopenms/_dataframes.py#L517-L614
Complex Method

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-macos
  • GitHub Check: build-lnx
  • GitHub Check: build-macos-arm
  • GitHub Check: build-win
  • GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
🔇 Additional comments (17)
src/pyOpenMS/pxds/FeatureGroupingAlgorithm.pxd (1)

12-15: LGTM! Proper annotation of abstract base class.

The addition of wrap-ignore, ABSTRACT class, and no-pxd-import annotations correctly identifies this as an abstract base class that should not be directly instantiated in Python. This standardization improves the Python bindings by preventing inappropriate usage.

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

92-92: LGTM! Correctly exposes method in Python interface.

Removing wrap-ignore from getUnassignedPeptideIdentifications() makes this method available in Python, which is consistent with the improvements to peptide identification handling mentioned in the PR.

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

13-16: LGTM! Consistent annotation standardization.

The addition of wrap-ignore, ABSTRACT class, and no-pxd-import annotations follows the same standardization pattern applied to other abstract base classes in this PR. This correctly identifies SpectrumAccessTransforming as an abstract class that should not be directly instantiated in Python.

src/pyOpenMS/tests/unittests/test000.py (7)

1737-1759: LGTM! Consistent update to use FeatureGroupingAlgorithmQT.

The changes correctly update references from FeatureGroupingAlgorithm to FeatureGroupingAlgorithmQT, which aligns with the FeatureGroupingAlgorithm class being marked as abstract and ignored for wrapping.


1873-1874: LGTM! Proper use of PeptideIdentificationList API.

The changes correctly update the test to use the new container type:

  • Using .empty() method to check if the container is empty instead of comparing to an empty Python list
  • Creating a new PeptideIdentificationList() instance instead of using an empty Python list

1925-1927: LGTM! Correct implementation of PeptideIdentificationList workflow.

The code properly demonstrates the new API usage:

  • Creates a PeptideIdentificationList instance
  • Uses .push_back() to add elements
  • Sets the container on the feature

This follows the expected pattern for the new container type.


1934-1934: LGTM! Appropriate use of container-specific method.

Using .size() instead of Python's len() is correct for the new container type and maintains the same test logic.


2063-2063: LGTM! Consistent container type usage.

The change from Python list to PeptideIdentificationList() is correct and consistent with the broader refactoring effort.


2088-2088: LGTM! Proper use of container's add method.

Using .push_back() instead of .append() is the correct way to add elements to the PeptideIdentificationList container.

Also applies to: 2097-2097


4683-4685: LGTM! Correct PeptideIdentificationList usage in test.

The changes properly demonstrate the new container API:

  • Creates PeptideIdentificationList instances
  • Uses .push_back() to add elements
  • Maintains the same test logic with the new container type
src/pyOpenMS/pyopenms/_dataframes.py (7)

11-11: LGTM: Import addition for PeptideIdentificationList

The import is correctly added to support the type annotation and usage changes throughout the file.


109-111: LGTM: Consistent type annotation and method usage

The changes correctly replace the Python list type annotation with _PeptideIdentificationList and update the length check to use the .size() method.


246-252: LGTM: Consistent type annotation and method usage

The changes correctly replace the Python list type annotation with _PeptideIdentificationList and update the length check to use the .size() method.


295-297: LGTM: Return type and initialization updated consistently

The return type annotation and variable initialization are correctly updated to use _PeptideIdentificationList instead of Python list.


310-310: LGTM: Method call updated for new container type

The change from append() to push_back() is correct for the _PeptideIdentificationList container type.


532-532: LGTM: Method call updated for new container type

The change from len() to .size() is correct for the _PeptideIdentificationList container type.


617-617: LGTM: Parameter type annotation updated

The parameter type annotation is correctly updated to use _PeptideIdentificationList instead of Python list.

Comment thread src/pyOpenMS/pyopenms/_dataframes.py Resolved
Comment thread src/pyOpenMS/pyopenms/_dataframes.py Resolved
poshul and others added 3 commits July 15, 2025 11:16

@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/pyopenms/_dataframes.py (1)

517-522: Mutable default argument issue still exists

The past review comment correctly identified a mutable default argument issue that should be addressed.

Apply this diff to fix the mutable default argument:

-def peptide_identifications_to_df(peps: _PeptideIdentificationList, decode_ontology : bool = True,
-                                  default_missing_values: dict = {bool: False, int: -9999, float: _np.nan, str: ''},
-                                  export_unidentified : bool = True):
+def peptide_identifications_to_df(peps: _PeptideIdentificationList, decode_ontology : bool = True,
+                                  default_missing_values: dict = None,
+                                  export_unidentified : bool = True):

Then add initialization inside the function:

+    if default_missing_values is None:
+        default_missing_values = {bool: False, int: -9999, float: _np.nan, str: ''}
🧹 Nitpick comments (1)
src/pyOpenMS/tests/unittests/test_FileIO.py (1)

27-27: Fix spacing after commas

The static analysis correctly identifies formatting issues with multiple spaces after commas.

Apply this diff to fix the formatting:

-        self.assertEqual( len(prots),  3)
-        self.assertEqual( peps.size(),  19)
+        self.assertEqual(len(prots), 3)
+        self.assertEqual(peps.size(), 19)
-        self.assertEqual( len(prots),  1)
-        self.assertEqual( peps.size(),  3)
+        self.assertEqual(len(prots), 1)
+        self.assertEqual(peps.size(), 3)

Also applies to: 50-50

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a0fea1 and 26276f7.

📒 Files selected for processing (3)
  • src/pyOpenMS/pxds/StringDataArray.pxd (1 hunks)
  • src/pyOpenMS/pyopenms/_dataframes.py (8 hunks)
  • src/pyOpenMS/tests/unittests/test_FileIO.py (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/pyOpenMS/pxds/StringDataArray.pxd
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
src/pyOpenMS/tests/unittests/test_FileIO.py (1)
Learnt from: FreezB11
PR: OpenMS/OpenMS#7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
🪛 Ruff (0.12.2)
src/pyOpenMS/pyopenms/_dataframes.py

518-518: Do not use mutable data structures for argument defaults

Replace with None; initialize within function

(B006)

🪛 GitHub Check: CodeFactor
src/pyOpenMS/pyopenms/_dataframes.py

[notice] 517-614: src/pyOpenMS/pyopenms/_dataframes.py#L517-L614
Complex Method

src/pyOpenMS/tests/unittests/test_FileIO.py

[notice] 27-27: src/pyOpenMS/tests/unittests/test_FileIO.py#L27
Multiple spaces after ','. (E241)


[notice] 50-50: src/pyOpenMS/tests/unittests/test_FileIO.py#L50
Multiple spaces after ','. (E241)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
  • GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
  • GitHub Check: build-and-test (macos-13, xcode, 14.2)
  • GitHub Check: build-and-test (macos-14, xcode, 15.0.1)
  • GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
  • GitHub Check: cppcheck-test
🔇 Additional comments (7)
src/pyOpenMS/tests/unittests/test_FileIO.py (3)

15-15: LGTM: Consistent refactoring to PeptideIdentificationList

The changes correctly replace Python lists with pyopenms.PeptideIdentificationList() instances, aligning with the broader refactoring effort to use more specific container types.

Also applies to: 22-22, 39-39, 45-45


27-27: LGTM: Correct method call updates

The changes from len(peps) to peps.size() are correct and consistent with the PeptideIdentificationList container interface.

Also applies to: 50-50


59-59: LGTM: Minor syntax cleanup

The removal of unnecessary semicolons improves code consistency.

Also applies to: 65-65

src/pyOpenMS/pyopenms/_dataframes.py (4)

11-11: LGTM: Required import for refactoring

The import of PeptideIdentificationList is necessary for the type system refactoring.


109-109: LGTM: Consistent type annotation updates

The changes to use _PeptideIdentificationList instead of list are consistent and improve type safety by aligning with the underlying C++ container semantics.

Also applies to: 246-246, 295-295, 517-517, 522-522, 617-617


111-111: LGTM: Correct method call updates

The changes from len() to .size() are correct and consistent with the _PeptideIdentificationList container interface.

Also applies to: 252-252, 532-532


297-297: LGTM: Correct container usage

The changes from [] to _PeptideIdentificationList() and append() to push_back() correctly align with the C++ container semantics.

Also applies to: 310-310

@poshul
poshul merged commit 60cd3f8 into develop Jul 15, 2025
@poshul
poshul deleted the fix_wrap-ignore_jawn branch July 15, 2025 14:38
@timosachsenberg

Copy link
Copy Markdown
Contributor

thanks for the cleanup

@jpfeuffer

jpfeuffer commented Jul 15, 2025 •

Copy link
Copy Markdown
Contributor

We could have used wrap-as "append" for push_back and add a __len__ method that calls size via a pyx.

@timosachsenberg

Copy link
Copy Markdown
Contributor

good point as this is a breaking change.will add

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.

3 participants