Skip to content

fix : Upgrade pyopenms_viz to v1.0.0 and Resolve Breaking API Changes #148

Merged
jcharkow merged 2 commits intoOpenMS:mainfrom
achalbajpai:main
Mar 4, 2025
Merged

fix : Upgrade pyopenms_viz to v1.0.0 and Resolve Breaking API Changes #148
jcharkow merged 2 commits intoOpenMS:mainfrom
achalbajpai:main

Conversation

@achalbajpai
Copy link
Contributor

@achalbajpai achalbajpai commented Mar 4, 2025

Changelog

Version Update and Improvements

1. Package Version Updates

  • Updated pyopenms_viz to version 1.0.0 in multiple configuration files:

    requirements.txt

    - pyopenms_viz==0.1.2
    + pyopenms_viz==1.0.0

    environment.yml

    - pyopenms_viz==0.1.2
    + pyopenms_viz==1.0.0

2. Breaking Changes Fixes in src/view.py

  • Removed deprecated fig parameter from all plot calls to comply with pyopenms_viz 1.0.0
  • Confirmed that the color parameter was already correctly updated (previously line_color)

Plot Method Improvements

Added aggregate_duplicates=True to all plot calls to prevent duplicate data warnings:

df.plot(
    backend="ms_plotly",
    kind="chromatogram",
    # ... other parameters ...
    aggregate_duplicates=True  # Added this parameter
)

Summary of Key Changes

  • ✅ Upgraded pyopenms_viz to version 1.0.0
  • ✅ Resolved breaking changes in plotting methods
  • ✅ Improved DataFrame handling to prevent warnings
  • ✅ Enhanced plot method calls with aggregate_duplicates
Screenshot 2025-03-04 at 10 08 31 PM

Summary by CodeRabbit

  • Chores

    • Updated a key visualization library to version 1.0.0 to ensure consistency across environments.
  • New Features

    • Improved plot rendering with refined color configuration and enhanced duplicate data aggregation for cleaner, more precise visualizations.

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2025

Walkthrough

The pull request updates package versioning and modifies plotting function parameters. In both environment.yml and requirements.txt, the pyopenms_viz package version is changed to ==1.0.0, with the YAML file also receiving a re-indentation for consistency. In src/view.py, the plotting functions are updated by renaming the line_color parameter to color, removing the fig parameter, adding an aggregate_duplicates option, and improving DataFrame handling using a copy and explicit loc assignment.

Changes

Files Change Summary
environment.yml, requirements.txt Updated pyopenms_viz version from >=0.1.2/0.1.2 to ==1.0.0. In environment.yml, the indentation for channels and dependencies was reformatted.
src/view.py Modified plotting functions: renamed line_color to color; removed the fig parameter; added aggregate_duplicates; updated DataFrame handling with a copy and loc assignment.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PlotFunction as plot_bpc_tic
    participant DataHandler as DataFrame Handler
    participant Renderer as Plot Renderer

    User->>PlotFunction: Call plot_bpc_tic(df)
    PlotFunction->>DataHandler: Filter data & create a copy
    DataHandler-->>PlotFunction: Return filtered data (with "type" set via loc)
    PlotFunction->>Renderer: Call plotting (using color & aggregate_duplicates)
    Renderer-->>PlotFunction: Generated plot
    PlotFunction-->>User: Return plot
Loading

Poem

Hey, I’m a happy rabbit on the run,
Hopping through changes, code full of fun,
Colors renamed and versions just right,
Leaving duplicates behind in a joyful flight,
With each line of code, my heart's delight!
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ca182a0 and d8e94cd.

📒 Files selected for processing (3)
  • environment.yml (1 hunks)
  • requirements.txt (1 hunks)
  • src/view.py (6 hunks)
🔇 Additional comments (9)
environment.yml (1)

4-17: Version update and indentation changes properly implemented

The changes correctly update the pyopenms_viz package version from >=0.1.2 to ==1.0.0 as specified in the PR objectives while also improving the indentation consistency throughout the file.

requirements.txt (1)

9-9: Version update correctly implemented

The update of pyopenms_viz to version 1.0.0 has been correctly implemented, matching the version update in environment.yml and aligning with the PR objectives.

src/view.py (7)

81-85: Parameter updates correctly address breaking changes

The changes properly replace the deprecated line_color parameter with color and add aggregate_duplicates=True to prevent warnings related to duplicate data as mentioned in the PR objectives.


97-101: Parameter updates correctly address breaking changes

The changes properly replace the deprecated line_color parameter with color and add aggregate_duplicates=True to prevent warnings related to duplicate data as mentioned in the PR objectives.


114-116: DataFrame handling improved to prevent chained assignment warnings

The implementation now uses .copy() when creating the df_eic DataFrame and .loc for setting values in the "type" column, which properly addresses potential warnings from chained assignments as mentioned in the PR objectives.


125-129: Parameter updates correctly address breaking changes

The changes properly replace the deprecated line_color parameter with color and add aggregate_duplicates=True to prevent warnings related to duplicate data as mentioned in the PR objectives.


152-159: Parameter updates correctly address breaking changes

The changes properly replace the deprecated line_color parameter with color and add aggregate_duplicates=True to prevent warnings related to duplicate data as mentioned in the PR objectives.


187-188: Parameter addition to prevent duplicate data warnings

The addition of aggregate_duplicates=True correctly addresses the need to prevent warnings related to duplicate data as specified in the PR objectives.


217-218: Parameter addition to prevent duplicate data warnings

The addition of aggregate_duplicates=True correctly addresses the need to prevent warnings related to duplicate data as specified in the PR objectives.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 for 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jcharkow
Copy link
Contributor

jcharkow commented Mar 4, 2025

@achalbajpai looks good! Please merge the current main branch into this branch locally and resolve merge conflicts.

e.g. on branch achalbajpai:main run git pull origin main

Copy link
Contributor

@jcharkow jcharkow left a comment

Choose a reason for hiding this comment

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

Looks good provided tests also pass on github server good to merge!

@achalbajpai
Copy link
Contributor Author

@jcharkow done with it !

@jcharkow
Copy link
Contributor

jcharkow commented Mar 4, 2025

Thanks! Will merge now.

@jcharkow jcharkow merged commit f64a8bb into OpenMS:main Mar 4, 2025
5 of 6 checks passed
@achalbajpai achalbajpai changed the title Fix : Update pyopenms_viz to 1.0.0 and fix breaking changes Fix : Upgrade pyopenms_viz to v1.0.0 and Resolve Breaking API Changes Mar 16, 2025
@achalbajpai achalbajpai changed the title Fix : Upgrade pyopenms_viz to v1.0.0 and Resolve Breaking API Changes fix : Upgrade pyopenms_viz to v1.0.0 and Resolve Breaking API Changes Mar 16, 2025
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.

2 participants